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)
  • Loading branch information
manu0466 committed Dec 11, 2024
1 parent 5e805a1 commit 6c51312
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 342 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.

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
14 changes: 7 additions & 7 deletions x/liquidvesting/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (suite *KeeperTestSuite) TestKeepr_InitGenesis() {
{
name: "should block negative insurance fund percentage",
genesis: types.NewGenesisState(
types.NewParams(math.LegacyNewDec(-1), nil, nil, nil, nil),
types.NewParams(math.LegacyNewDec(-1), nil, nil, nil),
nil,
nil,
),
Expand All @@ -201,7 +201,7 @@ func (suite *KeeperTestSuite) TestKeepr_InitGenesis() {
{
name: "should block 0 insurance fund percentage",
genesis: types.NewGenesisState(
types.NewParams(math.LegacyNewDec(0), nil, nil, nil, nil),
types.NewParams(math.LegacyNewDec(0), nil, nil, nil),
nil,
nil,
),
Expand All @@ -210,7 +210,7 @@ func (suite *KeeperTestSuite) TestKeepr_InitGenesis() {
{
name: "should allow 100 insurance fund percentage",
genesis: types.NewGenesisState(
types.NewParams(math.LegacyNewDec(100), nil, nil, nil, nil),
types.NewParams(math.LegacyNewDec(100), nil, nil, nil),
nil,
nil,
),
Expand All @@ -223,7 +223,7 @@ func (suite *KeeperTestSuite) TestKeepr_InitGenesis() {
{
name: "should block > 100 insurance fund percentage",
genesis: types.NewGenesisState(
types.NewParams(math.LegacyNewDec(101), nil, nil, nil, nil),
types.NewParams(math.LegacyNewDec(101), nil, nil, nil),
nil,
nil,
),
Expand All @@ -232,7 +232,7 @@ func (suite *KeeperTestSuite) TestKeepr_InitGenesis() {
{
name: "should block invalid minter address",
genesis: types.NewGenesisState(
types.NewParams(math.LegacyNewDec(2), nil, []string{"cosmos1fdsfd"}, nil, nil),
types.NewParams(math.LegacyNewDec(2), nil, []string{"cosmos1fdsfd"}, nil),
nil,
nil,
),
Expand All @@ -241,7 +241,7 @@ func (suite *KeeperTestSuite) TestKeepr_InitGenesis() {
{
name: "should block invalid burners address",
genesis: types.NewGenesisState(
types.NewParams(math.LegacyNewDec(2), []string{"cosmos1fdsfd"}, nil, nil, nil),
types.NewParams(math.LegacyNewDec(2), []string{"cosmos1fdsfd"}, nil, nil),
nil,
nil,
),
Expand All @@ -250,7 +250,7 @@ func (suite *KeeperTestSuite) TestKeepr_InitGenesis() {
{
name: "should block invalid allowed depositors address",
genesis: types.NewGenesisState(
types.NewParams(math.LegacyNewDec(2), nil, nil, []string{"cosmos1fdsfd"}, nil),
types.NewParams(math.LegacyNewDec(2), nil, nil, []string{"cosmos1fdsfd"}),
nil,
nil,
),
Expand Down
Loading

0 comments on commit 6c51312

Please sign in to comment.