Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mapped accounts #436

Merged
merged 31 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (s *AppTestSuite) initTestZone() {
BaseDenom: "uatom",
MultiSend: false,
LiquidityModule: true,
Is_118Cointype: true,
}
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetZone(s.chainA.GetContext(), &zone)

Expand All @@ -94,6 +95,7 @@ func (s *AppTestSuite) initTestZone() {
BaseDenom: "uatom",
MultiSend: false,
LiquidityModule: false,
Is_118Cointype: true,
}
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetZone(s.chainA.GetContext(), &zone)

Expand All @@ -106,6 +108,7 @@ func (s *AppTestSuite) initTestZone() {
BaseDenom: "uosmo",
MultiSend: false,
LiquidityModule: true,
Is_118Cointype: true,
}
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetZone(s.chainA.GetContext(), &zone)
// uni-5 zone
Expand All @@ -117,6 +120,7 @@ func (s *AppTestSuite) initTestZone() {
BaseDenom: "ujunox",
MultiSend: false,
LiquidityModule: true,
Is_118Cointype: true,
}
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetZone(s.chainA.GetContext(), &zone)

Expand Down
4 changes: 4 additions & 0 deletions docs/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2607,6 +2607,8 @@ paths:
type: boolean
return_to_sender:
type: boolean
is_118_cointype:
type: boolean
stats:
type: object
properties:
Expand Down Expand Up @@ -2888,6 +2890,8 @@ paths:
type: boolean
return_to_sender:
type: boolean
is_118_cointype:
type: boolean
stats:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ message Zone {
bool unbonding_enabled = 25;
bool deposits_enabled = 26;
bool return_to_sender = 27;
bool is_118_cointype = 28;
aljo242 marked this conversation as resolved.
Show resolved Hide resolved
}

message ICAAccount {
Expand Down
11 changes: 6 additions & 5 deletions x/airdrop/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ func (s *KeeperTestSuite) SetupTest() {
func (s *KeeperTestSuite) initTestZone() {
// test zone
zone := icstypes.Zone{
ConnectionId: s.path.EndpointB.ConnectionID,
ChainId: s.chainB.ChainID,
AccountPrefix: "cosmos",
LocalDenom: "uqatom",
BaseDenom: "uatom",
ConnectionId: s.path.EndpointB.ConnectionID,
ChainId: s.chainB.ChainID,
AccountPrefix: "cosmos",
LocalDenom: "uqatom",
BaseDenom: "uatom",
Is_118Cointype: true,
}

s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetZone(s.chainA.GetContext(), &zone)
Expand Down
3 changes: 3 additions & 0 deletions x/claimsmanager/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func (s *KeeperTestSuite) initTestZone() {
UnbondingEnabled: false,
LiquidityModule: true,
Decimals: 6,
Is_118Cointype: true,
}
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetZone(s.chainA.GetContext(), &zone)

Expand All @@ -93,6 +94,7 @@ func (s *KeeperTestSuite) initTestZone() {
UnbondingEnabled: false,
LiquidityModule: true,
Decimals: 6,
Is_118Cointype: true,
}
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetZone(s.chainA.GetContext(), &zone)

Expand All @@ -107,6 +109,7 @@ func (s *KeeperTestSuite) initTestZone() {
UnbondingEnabled: false,
LiquidityModule: true,
Decimals: 6,
Is_118Cointype: true,
}
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetZone(s.chainA.GetContext(), &zone)
}
2 changes: 2 additions & 0 deletions x/interchainstaking/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
Tvl: sdk.ZeroDec(),
UnbondingPeriod: 0,
MessagesPerTx: 0,
Is_118Cointype: true,
}
zone.Validators = append(zone.Validators,
&types.Validator{ValoperAddress: "cosmosvaloper14lultfckehtszvzw4ehu0apvsr77afvyju5zzy", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000), Score: sdk.ZeroDec()},
Expand Down Expand Up @@ -163,6 +164,7 @@ func (s *IntegrationTestSuite) ZonesEqual(zoneA, zoneB types.Zone) bool {
for i := range zoneA.Validators {
s.Require().Equal(zoneA.Validators[i], zoneB.Validators[i])
}
s.Require().Equal(zoneA.Is_118Cointype, zoneB.Is_118Cointype)

return true
}
Expand Down
2 changes: 1 addition & 1 deletion x/interchainstaking/keeper/callbacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (s *KeeperTestSuite) TestHandleValidatorCallbackNilValue() {

func (s *KeeperTestSuite) TestHandleValidatorCallback() {
newVal := utils.GenerateAccAddressForTestWithPrefix("cosmosvaloper")
zone := icstypes.Zone{ConnectionId: "connection-0", ChainId: "cosmoshub-4", AccountPrefix: "cosmos", LocalDenom: "uqatom", BaseDenom: "uatom"}
zone := icstypes.Zone{ConnectionId: "connection-0", ChainId: "cosmoshub-4", AccountPrefix: "cosmos", LocalDenom: "uqatom", BaseDenom: "uatom", Is_118Cointype: true}
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetValidator(s.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetValidator(s.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper.SetValidator(s.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper14lultfckehtszvzw4ehu0apvsr77afvyju5zzy", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
Expand Down
1 change: 1 addition & 0 deletions x/interchainstaking/keeper/zones_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func TestKeeperWithZonesRoundTrip(t *testing.T) {
sdk.NewCoin("uqck", sdk.NewInt(700000)),
),
},
Is_118Cointype: true,
}
kpr.SetAddressZoneMapping(ctx, delegationAddr, zone.ChainId)
kpr.SetZone(ctx, &zone)
Expand Down
Loading