Skip to content

Commit

Permalink
refactor(liquidvesting): remove trusted delegates (#215)
Browse files Browse the repository at this point in the history
## Description

Closes: #XXXX

This PR removes the `trusted_delegates` from the `x/liquidvesting`
module with the logic that restricts the insurance fund to accept
deposits only from those accounts.

---

### Author Checklist

*All items are required. Please add a note to the item if the item is
not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type
prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json)
in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR
Targeting](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building
modules](https://docs.cosmos.network/v0.44/building-modules/intro.html)
- [ ] included the necessary unit and integration
[tests](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go
code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable
and please add
your handle next to the items reviewed if you only reviewed selected
items.*

I have...

- [ ] confirmed the correct [type
prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json)
in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

(cherry picked from commit c0e4365)
  • Loading branch information
manu0466 authored and RiccardoM committed Dec 9, 2024
1 parent 69f153e commit e61acb3
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 352 deletions.
182 changes: 22 additions & 160 deletions api/milkyway/liquidvesting/v1/params.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions app/upgrades/v3/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ func CreateUpgradeHandler(
if err != nil {
return nil, err
}
liquidVestingParams.TrustedDelegates = []string{
"celestia1nyk8qsfkrplvzex5yc4l5kghdr60nj7mutnw6z", // goose self-delegation address
"celestia1vre9kvtw6w9lxkl3620zpzs5lpczhvjc0s6r2a", // bot address
}
err = keepers.LiquidVestingKeeper.SetParams(ctx, liquidVestingParams)
if err != nil {
return nil, err
Expand Down
6 changes: 1 addition & 5 deletions app/upgrades/v3/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,8 @@ func (suite *UpgradeTestSuite) TestUpgradeV3() {
sdk.NewInt64Coin("ibc/8D4FC51F696E03711B9B37A5787FB89BD2DDBAF788813478B002D552A12F9157", 1000000),
), rewardsParams.RewardsPlanCreationFee)

liquidVestingParams, err := suite.App.LiquidVestingKeeper.GetParams(suite.Ctx)
_, err = suite.App.LiquidVestingKeeper.GetParams(suite.Ctx)
suite.Require().NoError(err)
suite.Require().Equal([]string{
"celestia1nyk8qsfkrplvzex5yc4l5kghdr60nj7mutnw6z",
"celestia1vre9kvtw6w9lxkl3620zpzs5lpczhvjc0s6r2a",
}, liquidVestingParams.TrustedDelegates)

slashingParams, err := suite.App.SlashingKeeper.GetParams(suite.Ctx)
suite.Require().NoError(err)
Expand Down
8 changes: 3 additions & 5 deletions proto/milkyway/liquidvesting/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ option go_package = "github.com/milkyway-labs/milkyway/v3/x/liquidvesting/types"

// Params defines the parameters for the module.
message Params {
// List of fields that have been removed and should not be used.
reserved 4;

// This value represents the percentage that needs to be sent to the
// insurance fund in order to restake a certain amount of locked tokens.
// For example, if this value is 2%, a user must send 2 tokens to
Expand All @@ -28,11 +31,6 @@ message Params {
repeated string minters = 3
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// TrustedDelegates represents the list of users who are allowed to deposit
// on the insurance fund.
repeated string trusted_delegates = 4
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// List of channels from which is allowed to receive deposits to the insurance
// fund.
repeated string allowed_channels = 5;
Expand Down
1 change: 0 additions & 1 deletion x/liquidvesting/keeper/burn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ func (suite *KeeperTestSuite) TestKeeper_TestIsBurner() {
[]string{"cosmos1pgzph9rze2j2xxavx4n7pdhxlkgsq7raqh8hre"},
nil,
nil,
nil,
))
suite.Assert().NoError(err)
},
Expand Down
Loading

0 comments on commit e61acb3

Please sign in to comment.