From 47d8bc11c78ec2ea4b81f6c32b1818747fd8b527 Mon Sep 17 00:00:00 2001 From: Tuan Tran Date: Fri, 22 Mar 2024 02:53:52 +0700 Subject: [PATCH 1/4] Feat: Add val denylist (#1268) * initial work * refactor * remove new msg type * [wip]: add query type * add grpc query * add crud tests for val deny list * refactor deny list storage Now store validator address bytes instead of serialized form of the Validator struct * filter validator based on denylist * linting * add initial supply if user doesn't have balance * add comment * Add grpc test for query deny list * Update x/interchainstaking/keeper/intent_test.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * refactor based on review, return string instead of validator object, using sdk.ValAddress as argument * linting * refactor: remove unused marshal code --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../interchainstaking/v1/query.proto | 8 + x/interchainstaking/keeper/deny_list.go | 60 ++ x/interchainstaking/keeper/deny_list_test.go | 103 +++ x/interchainstaking/keeper/grpc_query.go | 11 + x/interchainstaking/keeper/grpc_query_test.go | 65 ++ x/interchainstaking/keeper/intent_test.go | 9 +- x/interchainstaking/keeper/keeper.go | 9 +- x/interchainstaking/types/deny_list.go | 1 + x/interchainstaking/types/deny_list_test.go | 1 + x/interchainstaking/types/error.go | 5 +- x/interchainstaking/types/keys.go | 11 + x/interchainstaking/types/query.pb.go | 635 ++++++++++++++---- 12 files changed, 797 insertions(+), 121 deletions(-) create mode 100644 x/interchainstaking/keeper/deny_list.go create mode 100644 x/interchainstaking/keeper/deny_list_test.go create mode 100644 x/interchainstaking/types/deny_list.go create mode 100644 x/interchainstaking/types/deny_list_test.go diff --git a/proto/quicksilver/interchainstaking/v1/query.proto b/proto/quicksilver/interchainstaking/v1/query.proto index 0734f1b73..19fcbb572 100644 --- a/proto/quicksilver/interchainstaking/v1/query.proto +++ b/proto/quicksilver/interchainstaking/v1/query.proto @@ -255,3 +255,11 @@ message QueryMappedAccountsResponse { map RemoteAddressMap = 1 [(gogoproto.nullable) = false]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } + +message QueryDenyListRequest { + string chain_id = 1 [(gogoproto.moretags) = "yaml:\"chain_id\""]; +} +message QueryDenyListResponse { + repeated string validators = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/x/interchainstaking/keeper/deny_list.go b/x/interchainstaking/keeper/deny_list.go new file mode 100644 index 000000000..eb26f0420 --- /dev/null +++ b/x/interchainstaking/keeper/deny_list.go @@ -0,0 +1,60 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/quicksilver-zone/quicksilver/utils/addressutils" + "github.com/quicksilver-zone/quicksilver/x/interchainstaking/types" +) + +// SetZoneValidatorToDenyList sets the zone validator deny list +func (k *Keeper) SetZoneValidatorToDenyList(ctx sdk.Context, chainID string, validatorAddress sdk.ValAddress) error { + store := ctx.KVStore(k.storeKey) + + key := types.GetDeniedValidatorKey(chainID, validatorAddress) + store.Set(key, validatorAddress) + return nil +} + +// GetZoneValidatorDenyList get the validator deny list of a specific zone +func (k *Keeper) GetZoneValidatorDenyList(ctx sdk.Context, chainID string) (denyList []string) { + zone, found := k.GetZone(ctx, chainID) + if !found { + return denyList + } + k.IterateZoneDeniedValidator(ctx, chainID, func(validator sdk.ValAddress) bool { + denyList = append(denyList, addressutils.MustEncodeAddressToBech32(zone.GetValoperPrefix(), validator)) + return false + }) + + return denyList +} + +func (k *Keeper) GetDeniedValidatorInDenyList(ctx sdk.Context, chainID string, validatorAddress sdk.ValAddress) bool { + key := types.GetDeniedValidatorKey(chainID, validatorAddress) + store := ctx.KVStore(k.storeKey) + bz := store.Get(key) + return bz != nil +} + +// RemoveValidatorFromDenyList removes a validator from the deny list. Panic if the validator is not in the deny list +func (k *Keeper) RemoveValidatorFromDenyList(ctx sdk.Context, chainID string, validator sdk.ValAddress) { + store := ctx.KVStore(k.storeKey) + key := types.GetDeniedValidatorKey(chainID, validator) + store.Delete(key) +} + +func (k *Keeper) IterateZoneDeniedValidator(ctx sdk.Context, chainID string, cb func(validator sdk.ValAddress) (stop bool)) { + store := ctx.KVStore(k.storeKey) + deniedValPrefixKey := types.GetZoneDeniedValidatorKey(chainID) + + iterator := sdk.KVStorePrefixIterator(store, deniedValPrefixKey) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + validator := sdk.ValAddress(iterator.Value()) + if cb(validator) { + break + } + } +} diff --git a/x/interchainstaking/keeper/deny_list_test.go b/x/interchainstaking/keeper/deny_list_test.go new file mode 100644 index 000000000..258e4c620 --- /dev/null +++ b/x/interchainstaking/keeper/deny_list_test.go @@ -0,0 +1,103 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/quicksilver-zone/quicksilver/utils/addressutils" +) + +func (suite *KeeperTestSuite) TestStoreGetDeleteDenyList() { + suite.Run("deny list - store / get / delete single", func() { + suite.SetupTest() + suite.setupTestZones() + + qApp := suite.GetQuicksilverApp(suite.chainA) + ctx := suite.chainA.GetContext() + + zone, found := qApp.InterchainstakingKeeper.GetZone(ctx, suite.chainB.ChainID) + suite.True(found) + vals := qApp.InterchainstakingKeeper.GetValidators(ctx, zone.ChainId) + suite.Len(vals, 4) + val := vals[0] + validator := sdk.ValAddress(val.ValoperAddress) + // Initially the deny list should be empty + found = qApp.InterchainstakingKeeper.GetDeniedValidatorInDenyList(ctx, zone.ChainId, validator) + suite.False(found) + // Add a validator to the deny list + err := qApp.InterchainstakingKeeper.SetZoneValidatorToDenyList(ctx, zone.ChainId, validator) + suite.NoError(err) + + // Ensure the deny list contains the validator + + denyList := qApp.InterchainstakingKeeper.GetZoneValidatorDenyList(ctx, zone.ChainId) + suite.Len(denyList, 1) + suite.Equal(addressutils.MustEncodeAddressToBech32(zone.GetValoperPrefix(), validator), denyList[0]) + + found = qApp.InterchainstakingKeeper.GetDeniedValidatorInDenyList(ctx, zone.ChainId, validator) + suite.True(found) + + // Remove the validator from the deny list + qApp.InterchainstakingKeeper.RemoveValidatorFromDenyList(ctx, zone.ChainId, validator) + found = qApp.InterchainstakingKeeper.GetDeniedValidatorInDenyList(ctx, zone.ChainId, validator) + suite.False(found) + + denyList = qApp.InterchainstakingKeeper.GetZoneValidatorDenyList(ctx, zone.ChainId) + suite.Len(denyList, 0) + }) + + suite.Run("deny list - store / get / delete multiple", func() { + suite.SetupTest() + suite.setupTestZones() + + qApp := suite.GetQuicksilverApp(suite.chainA) + ctx := suite.chainA.GetContext() + + zone, found := qApp.InterchainstakingKeeper.GetZone(ctx, suite.chainB.ChainID) + suite.True(found) + vals := qApp.InterchainstakingKeeper.GetValidators(ctx, zone.ChainId) + suite.Len(vals, 4) + valAddr := make([]sdk.ValAddress, 4) + for i, v := range vals { + valAddr[i] = sdk.ValAddress(v.ValoperAddress) + } + // Initially the deny list should be empty + found = qApp.InterchainstakingKeeper.GetDeniedValidatorInDenyList(ctx, zone.ChainId, valAddr[0]) + suite.False(found) + + // Add three validators to the deny list + err := qApp.InterchainstakingKeeper.SetZoneValidatorToDenyList(ctx, zone.ChainId, valAddr[0]) + suite.NoError(err) + err = qApp.InterchainstakingKeeper.SetZoneValidatorToDenyList(ctx, zone.ChainId, valAddr[1]) + suite.NoError(err) + err = qApp.InterchainstakingKeeper.SetZoneValidatorToDenyList(ctx, zone.ChainId, valAddr[2]) + suite.NoError(err) + + denyList := qApp.InterchainstakingKeeper.GetZoneValidatorDenyList(ctx, zone.ChainId) + suite.Len(denyList, 3) + + // Ensure the deny list contains the three validators + suite.Contains(denyList, addressutils.MustEncodeAddressToBech32(zone.GetValoperPrefix(), valAddr[0])) + suite.Contains(denyList, addressutils.MustEncodeAddressToBech32(zone.GetValoperPrefix(), valAddr[1])) + suite.Contains(denyList, addressutils.MustEncodeAddressToBech32(zone.GetValoperPrefix(), valAddr[2])) + + // Remove the validator from the deny list + qApp.InterchainstakingKeeper.RemoveValidatorFromDenyList(ctx, zone.ChainId, valAddr[1]) + found = qApp.InterchainstakingKeeper.GetDeniedValidatorInDenyList(ctx, zone.ChainId, valAddr[1]) + suite.False(found) + + // Ensure the deny list contains the two remaining validators + denyList = qApp.InterchainstakingKeeper.GetZoneValidatorDenyList(ctx, zone.ChainId) + suite.Len(denyList, 2) + suite.NotContains(denyList, addressutils.MustEncodeAddressToBech32(zone.GetValoperPrefix(), valAddr[1])) + suite.Contains(denyList, addressutils.MustEncodeAddressToBech32(zone.GetValoperPrefix(), valAddr[0])) + suite.Contains(denyList, addressutils.MustEncodeAddressToBech32(zone.GetValoperPrefix(), valAddr[2])) + + // Remove the remaining two validators from the deny list + qApp.InterchainstakingKeeper.RemoveValidatorFromDenyList(ctx, zone.ChainId, valAddr[0]) + qApp.InterchainstakingKeeper.RemoveValidatorFromDenyList(ctx, zone.ChainId, valAddr[2]) + + // Ensure the deny list is empty + denyList = qApp.InterchainstakingKeeper.GetZoneValidatorDenyList(ctx, zone.ChainId) + suite.Len(denyList, 0) + }) +} diff --git a/x/interchainstaking/keeper/grpc_query.go b/x/interchainstaking/keeper/grpc_query.go index e8cd63105..dbfbad160 100644 --- a/x/interchainstaking/keeper/grpc_query.go +++ b/x/interchainstaking/keeper/grpc_query.go @@ -337,3 +337,14 @@ func (k *Keeper) MappedAccounts(c context.Context, req *types.QueryMappedAccount return &types.QueryMappedAccountsResponse{RemoteAddressMap: remoteAddressMap}, nil } + +func (k *Keeper) ValidatorDenyList(c context.Context, req *types.QueryDenyListRequest) (*types.QueryDenyListResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(c) + + validators := k.GetZoneValidatorDenyList(ctx, req.ChainId) + + return &types.QueryDenyListResponse{Validators: validators}, nil +} diff --git a/x/interchainstaking/keeper/grpc_query_test.go b/x/interchainstaking/keeper/grpc_query_test.go index c7ce5e104..da3b76390 100644 --- a/x/interchainstaking/keeper/grpc_query_test.go +++ b/x/interchainstaking/keeper/grpc_query_test.go @@ -1346,3 +1346,68 @@ func (suite *KeeperTestSuite) TestKeeper_Zone() { }) } } + +func (suite *KeeperTestSuite) TestKeeper_ZoneValidatorDenyList() { + testCases := []struct { + name string + req *types.QueryDenyListRequest + wantErr bool + expectedLength int + }{ + { + name: "empty request", + req: nil, + wantErr: true, + expectedLength: 0, + }, + { + name: "zone not found", + req: &types.QueryDenyListRequest{ChainId: "abcd"}, + wantErr: false, + expectedLength: 0, + }, + { + name: "zone valid request", + req: &types.QueryDenyListRequest{ChainId: suite.chainB.ChainID}, + wantErr: false, + expectedLength: 2, + }, + } + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + suite.setupTestZones() + + quicksilver := suite.GetQuicksilverApp(suite.chainA) + ctx := suite.chainA.GetContext() + icsKeeper := quicksilver.InterchainstakingKeeper + + // Set 2 validators to deny list + validator1 := icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[0] + valAddr, err := sdk.ValAddressFromBech32(validator1.ValoperAddress) + suite.NoError(err) + err = icsKeeper.SetZoneValidatorToDenyList(ctx, suite.chainB.ChainID, valAddr) + suite.NoError(err) + + validator2 := icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[1] + valAddr, err = sdk.ValAddressFromBech32(validator2.ValoperAddress) + suite.NoError(err) + err = icsKeeper.SetZoneValidatorToDenyList(ctx, suite.chainB.ChainID, valAddr) + suite.NoError(err) + denyList, err := icsKeeper.ValidatorDenyList(ctx, tc.req) + if tc.wantErr { + suite.T().Logf("Error:\n%v\n", err) + suite.Error(err) + suite.Empty(denyList) + } else { + suite.NotNil(denyList) + if tc.expectedLength == 2 { + suite.Equal(&types.QueryDenyListResponse{Validators: []string{validator1.ValoperAddress, validator2.ValoperAddress}}, denyList) + } else { + suite.Empty(denyList.Validators) + } + + } + }) + } +} diff --git a/x/interchainstaking/keeper/intent_test.go b/x/interchainstaking/keeper/intent_test.go index 817631c13..2d8f3a968 100644 --- a/x/interchainstaking/keeper/intent_test.go +++ b/x/interchainstaking/keeper/intent_test.go @@ -324,7 +324,6 @@ func (suite *KeeperTestSuite) TestAggregateIntent() { icsKeeper := quicksilver.InterchainstakingKeeper zone, found := icsKeeper.GetZone(ctx, suite.chainB.ChainID) suite.True(found) - // give each user some funds for addrString, balance := range tt.balances() { suite.giveFunds(ctx, zone.LocalDenom, balance, addrString) @@ -334,7 +333,13 @@ func (suite *KeeperTestSuite) TestAggregateIntent() { icsKeeper.SetDelegatorIntent(ctx, &zone, intent, false) } - _ = icsKeeper.AggregateDelegatorIntents(ctx, &zone) + // If the supply is zero, mint some coins to avoid zero ordializedSum + if quicksilver.BankKeeper.GetSupply(ctx, zone.LocalDenom).IsZero() { + err := quicksilver.MintKeeper.MintCoins(ctx, sdk.NewCoins(sdk.NewCoin(zone.LocalDenom, sdk.NewInt(1000)))) + suite.NoError(err) + } + err := icsKeeper.AggregateDelegatorIntents(ctx, &zone) + suite.NoError(err) // refresh zone to pull new aggregate zone, found = icsKeeper.GetZone(ctx, suite.chainB.ChainID) diff --git a/x/interchainstaking/keeper/keeper.go b/x/interchainstaking/keeper/keeper.go index c81db1681..fc85d9466 100644 --- a/x/interchainstaking/keeper/keeper.go +++ b/x/interchainstaking/keeper/keeper.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "fmt" + "slices" "time" "github.com/tendermint/tendermint/libs/log" @@ -739,7 +740,7 @@ func (k *Keeper) GetAggregateIntentOrDefault(ctx sdk.Context, zone *types.Zone) } jailedThreshold := k.EpochsKeeper.GetEpochInfo(ctx, "epoch").Duration * 2 - + denyList := k.GetZoneValidatorDenyList(ctx, zone.ChainId) // filter intents here... // check validators for tombstoned for _, validatorIntent := range intents { @@ -764,9 +765,9 @@ func (k *Keeper) GetAggregateIntentOrDefault(ctx sdk.Context, zone *types.Zone) } // we should never let denylist validators into the list, even if they are explicitly selected - // if in deny list { - // continue - // } + if slices.Contains(denyList, validator.ValoperAddress) { + continue + } filteredIntents = append(filteredIntents, validatorIntent) } diff --git a/x/interchainstaking/types/deny_list.go b/x/interchainstaking/types/deny_list.go new file mode 100644 index 000000000..ab1254f4c --- /dev/null +++ b/x/interchainstaking/types/deny_list.go @@ -0,0 +1 @@ +package types diff --git a/x/interchainstaking/types/deny_list_test.go b/x/interchainstaking/types/deny_list_test.go new file mode 100644 index 000000000..d932b4650 --- /dev/null +++ b/x/interchainstaking/types/deny_list_test.go @@ -0,0 +1 @@ +package types_test diff --git a/x/interchainstaking/types/error.go b/x/interchainstaking/types/error.go index 82637c324..57f51b3ef 100644 --- a/x/interchainstaking/types/error.go +++ b/x/interchainstaking/types/error.go @@ -4,4 +4,7 @@ import ( "errors" ) -var ErrCoinAmountNil = errors.New("coin amount is nil") +var ( + ErrCoinAmountNil = errors.New("coin amount is nil") + ErrValidatorAlreadyInDenyList = errors.New("validator already in deny list") +) diff --git a/x/interchainstaking/types/keys.go b/x/interchainstaking/types/keys.go index 396384af5..29723aee2 100644 --- a/x/interchainstaking/types/keys.go +++ b/x/interchainstaking/types/keys.go @@ -63,6 +63,7 @@ var ( KeyPrefixRedelegationRecord = []byte{0x10} KeyPrefixLsmCaps = []byte{0x11} KeyPrefixLocalDenomZoneMapping = []byte{0x12} + KeyPrefixDeniedValidator = []byte{0x13} ) // ParseStakingDelegationKey parses the KV store key for a delegation from Cosmos x/staking module, @@ -165,3 +166,13 @@ func GetRemoteAddressPrefix(locaAddress []byte) []byte { func GetZoneValidatorAddrsByConsAddrKey(chainID string) []byte { return append(KeyPrefixValidatorAddrsByConsAddr, []byte(chainID)...) } + +// GetDeniedValidatorKey gets the validator deny list key prefix for a given chain. +func GetDeniedValidatorKey(chainID string, validatorAddress sdk.ValAddress) []byte { + return append(KeyPrefixDeniedValidator, append([]byte(chainID), validatorAddress.Bytes()...)...) +} + +// GetZoneValidatorDenyListKey gets the validator deny list key prefix for a given chain. +func GetZoneDeniedValidatorKey(chainID string) []byte { + return append(KeyPrefixDeniedValidator, []byte(chainID)...) +} diff --git a/x/interchainstaking/types/query.pb.go b/x/interchainstaking/types/query.pb.go index 90378d72f..927f22e05 100644 --- a/x/interchainstaking/types/query.pb.go +++ b/x/interchainstaking/types/query.pb.go @@ -1597,6 +1597,102 @@ func (m *QueryMappedAccountsResponse) GetPagination() *query.PageResponse { return nil } +type QueryDenyListRequest struct { + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" yaml:"chain_id"` +} + +func (m *QueryDenyListRequest) Reset() { *m = QueryDenyListRequest{} } +func (m *QueryDenyListRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenyListRequest) ProtoMessage() {} +func (*QueryDenyListRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c8e4d79429548821, []int{29} +} +func (m *QueryDenyListRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenyListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenyListRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenyListRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenyListRequest.Merge(m, src) +} +func (m *QueryDenyListRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenyListRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenyListRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenyListRequest proto.InternalMessageInfo + +func (m *QueryDenyListRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +type QueryDenyListResponse struct { + Validators []string `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenyListResponse) Reset() { *m = QueryDenyListResponse{} } +func (m *QueryDenyListResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenyListResponse) ProtoMessage() {} +func (*QueryDenyListResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c8e4d79429548821, []int{30} +} +func (m *QueryDenyListResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenyListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenyListResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenyListResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenyListResponse.Merge(m, src) +} +func (m *QueryDenyListResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenyListResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenyListResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenyListResponse proto.InternalMessageInfo + +func (m *QueryDenyListResponse) GetValidators() []string { + if m != nil { + return m.Validators + } + return nil +} + +func (m *QueryDenyListResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*Statistics)(nil), "quicksilver.interchainstaking.v1.Statistics") proto.RegisterType((*QueryZonesRequest)(nil), "quicksilver.interchainstaking.v1.QueryZonesRequest") @@ -1628,6 +1724,8 @@ func init() { proto.RegisterType((*QueryMappedAccountsRequest)(nil), "quicksilver.interchainstaking.v1.QueryMappedAccountsRequest") proto.RegisterType((*QueryMappedAccountsResponse)(nil), "quicksilver.interchainstaking.v1.QueryMappedAccountsResponse") proto.RegisterMapType((map[string][]byte)(nil), "quicksilver.interchainstaking.v1.QueryMappedAccountsResponse.RemoteAddressMapEntry") + proto.RegisterType((*QueryDenyListRequest)(nil), "quicksilver.interchainstaking.v1.QueryDenyListRequest") + proto.RegisterType((*QueryDenyListResponse)(nil), "quicksilver.interchainstaking.v1.QueryDenyListResponse") } func init() { @@ -1635,120 +1733,123 @@ func init() { } var fileDescriptor_c8e4d79429548821 = []byte{ - // 1808 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0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0x7f, 0x11, 0x48, 0x06, 0x2b, 0xc6, - 0xc8, 0x37, 0x44, 0x93, 0x1a, 0x38, 0xf2, 0x0d, 0xd1, 0xac, 0x54, 0x95, 0xbe, 0xc2, 0x89, 0xae, - 0xd1, 0x95, 0x18, 0x0b, 0x5b, 0xfb, 0x43, 0xa4, 0xe0, 0xf8, 0x1f, 0x02, 0x67, 0x42, 0xaa, 0x36, - 0xba, 0x14, 0xf9, 0x88, 0x6c, 0x56, 0x8d, 0xa6, 0x73, 0x27, 0x81, 0x68, 0xff, 0x3a, 0x0c, 0x39, - 0x70, 0x6b, 0xb8, 0x1e, 0xdf, 0x97, 0x04, 0x46, 0xea, 0x0b, 0x9c, 0xc8, 0x8f, 0xd5, 0xd0, 0x62, - 0x30, 0xf2, 0x63, 0x35, 0xbc, 0xaa, 0x92, 0x56, 0x38, 0xc1, 0x6b, 0xf4, 0x6a, 0x6b, 0x82, 0x3b, - 0x1c, 0x41, 0x64, 0xac, 0xc3, 0x55, 0x24, 0x6f, 0xee, 0xd1, 0xf3, 0x57, 0x19, 0xf2, 0xe2, 0x55, - 0x86, 0xfc, 0xf3, 0x55, 0x86, 0xfc, 0xe0, 0x75, 0xa6, 0xeb, 0xc5, 0xeb, 0x4c, 0xd7, 0xdf, 0x5f, - 0x67, 0xba, 0x1e, 0x2e, 0x95, 0x34, 0x7b, 0xbb, 0xba, 0x95, 0x2d, 0x18, 0x3b, 0x7e, 0x0f, 0x17, - 0xf8, 0x23, 0xde, 0xef, 0x72, 0x3f, 0xc4, 0xa9, 0x7d, 0x50, 0x61, 0xd6, 0x56, 0x3f, 0xff, 0x0f, - 0x82, 0xf9, 0x4f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x16, 0xe6, 0xf3, 0x68, 0x21, 0x00, 0x00, + // 1844 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4d, 0x6c,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 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x90, 0x5c, 0x63, + 0x4d, 0x22, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3651,6 +3752,80 @@ func (m *QueryMappedAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *QueryDenyListRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenyListRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenyListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenyListResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenyListResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenyListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Validators[iNdEx]) + copy(dAtA[i:], m.Validators[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Validators[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -4190,6 +4365,38 @@ func (m *QueryMappedAccountsResponse) Size() (n int) { return n } +func (m *QueryDenyListRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenyListResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Validators) > 0 { + for _, s := range m.Validators { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7778,6 +7985,206 @@ func (m *QueryMappedAccountsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryDenyListRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenyListRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenyListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenyListResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenyListResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenyListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validators = append(m.Validators, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 60e77b3786829f036e83fb8e34356590fc3f82fd Mon Sep 17 00:00:00 2001 From: Joe Bowman Date: Fri, 22 Mar 2024 02:52:00 +0000 Subject: [PATCH 2/4] Int64 to math (#1319) * fix zones page with 1e18 decimals * fix nil reference * remove int64 output in delegations query * remove int64s * add test to validate int64 fix * lint --- app/upgrades/v1_5.go | 8 +- app/upgrades_test.go | 60 +- docs/swagger.yml | 59 +- .../claimsmanager/v1/claimsmanager.proto | 7 +- .../v1/interchainstaking.proto | 20 +- .../interchainstaking/v1/query.proto | 24 +- x/airdrop/types/messages.pb.go | 88 +-- x/claimsmanager/keeper/claims_test.go | 20 +- x/claimsmanager/types/claimsmanager.go | 6 +- x/claimsmanager/types/claimsmanager.pb.go | 141 ++-- x/claimsmanager/types/claimsmanager_test.go | 14 +- x/claimsmanager/types/genesis_test.go | 6 +- x/interchainquery/types/messages.pb.go | 8 +- x/interchainstaking/keeper/callbacks_test.go | 20 +- x/interchainstaking/keeper/grpc_query.go | 5 +- x/interchainstaking/keeper/grpc_query_test.go | 14 +- .../keeper/ibc_packet_handlers.go | 22 +- .../keeper/ibc_packet_handlers_test.go | 444 ++++++------ x/interchainstaking/keeper/intent.go | 4 +- x/interchainstaking/keeper/keeper.go | 2 +- x/interchainstaking/keeper/msg_server_test.go | 2 +- .../keeper/redelegation_record_test.go | 28 +- x/interchainstaking/keeper/redemptions.go | 28 +- .../keeper/redemptions_test.go | 14 +- .../keeper/withdrawal_record.go | 6 +- .../keeper/withdrawal_record_test.go | 56 +- x/interchainstaking/keeper/zones.go | 9 +- x/interchainstaking/keeper/zones_test.go | 8 +- .../types/interchainstaking.pb.go | 647 +++++++----------- x/interchainstaking/types/messages.pb.go | 34 +- x/interchainstaking/types/query.pb.go | 442 ++++++------ x/participationrewards/keeper/keeper_test.go | 2 +- .../keeper/msg_server_test.go | 60 +- .../keeper/rewards_holdings.go | 7 +- .../keeper/rewards_holdings_test.go | 44 +- x/participationrewards/keeper/submodule.go | 4 +- .../keeper/submodule_liquid.go | 18 +- .../keeper/submodule_osmosis.go | 24 +- .../keeper/submodule_umee.go | 18 +- x/participationrewards/types/messages.pb.go | 64 +- 40 files changed, 1261 insertions(+), 1226 deletions(-) diff --git a/app/upgrades/v1_5.go b/app/upgrades/v1_5.go index e50a99bf5..10efbd320 100644 --- a/app/upgrades/v1_5.go +++ b/app/upgrades/v1_5.go @@ -5,6 +5,8 @@ import ( "fmt" "time" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" @@ -526,16 +528,16 @@ func collateRequeuedWithdrawals(ctx sdk.Context, appKeepers *keepers.AppKeepers) } // merge distributions newRecord.Distribution = func(dist1, dist2 []*icstypes.Distribution) []*icstypes.Distribution { - distMap := map[string]uint64{} + distMap := map[string]math.Int{} for _, dist := range dist1 { distMap[dist.Valoper] = dist.Amount } for _, dist := range dist2 { if _, ok = distMap[dist.Valoper]; !ok { - distMap[dist.Valoper] = 0 + distMap[dist.Valoper] = math.ZeroInt() } - distMap[dist.Valoper] += dist.Amount + distMap[dist.Valoper] = distMap[dist.Valoper].Add(dist.Amount) } out := make([]*icstypes.Distribution, 0, len(distMap)) diff --git a/app/upgrades_test.go b/app/upgrades_test.go index 62d764f49..2609ae59b 100644 --- a/app/upgrades_test.go +++ b/app/upgrades_test.go @@ -413,15 +413,15 @@ func (s *AppTestSuite) TestV010500UpgradeHandler() { Distribution: []*icstypes.Distribution{ { Valoper: "cosmosvaloper100000000000000000000000000000000000", - Amount: 600, + Amount: math.NewInt(600), }, { Valoper: "cosmosvaloper111111111111111111111111111111111111", - Amount: 400, + Amount: math.NewInt(400), }, { Valoper: "cosmosvaloper122222222222222222222222222222222222", - Amount: 200, + Amount: math.NewInt(200), }, }, BurnAmount: sdk.NewCoin("uqatom", math.NewInt(1000)), @@ -440,19 +440,19 @@ func (s *AppTestSuite) TestV010500UpgradeHandler() { Distribution: []*icstypes.Distribution{ { Valoper: "cosmosvaloper100000000000000000000000000000000000", - Amount: 600, + Amount: math.NewInt(600), }, { Valoper: "cosmosvaloper111111111111111111111111111111111111", - Amount: 800, + Amount: math.NewInt(800), }, { Valoper: "cosmosvaloper122222222222222222222222222222222222", - Amount: 800, + Amount: math.NewInt(800), }, { Valoper: "cosmosvaloper133333333333333333333333333333333333", - Amount: 800, + Amount: math.NewInt(800), }, }, BurnAmount: sdk.NewCoin("uqatom", math.NewInt(2000)), @@ -471,19 +471,19 @@ func (s *AppTestSuite) TestV010500UpgradeHandler() { Distribution: []*icstypes.Distribution{ { Valoper: "cosmosvaloper100000000000000000000000000000000000", - Amount: 600, + Amount: math.NewInt(600), }, { Valoper: "cosmosvaloper122222222222222222222222222222222222", - Amount: 200, + Amount: math.NewInt(200), }, { Valoper: "cosmosvaloper133333333333333333333333333333333333", - Amount: 800, + Amount: math.NewInt(800), }, { Valoper: "cosmosvaloper144444444444444444444444444444444444", - Amount: 2000, + Amount: math.NewInt(2000), }, }, BurnAmount: sdk.NewCoin("uqatom", math.NewInt(3000)), @@ -502,19 +502,19 @@ func (s *AppTestSuite) TestV010500UpgradeHandler() { Distribution: []*icstypes.Distribution{ { Valoper: "cosmosvaloper100000000000000000000000000000000000", - Amount: 800, + Amount: math.NewInt(800), }, { Valoper: "cosmosvaloper122222222222222222222222222222222222", - Amount: 400, + Amount: math.NewInt(400), }, { Valoper: "cosmosvaloper133333333333333333333333333333333333", - Amount: 1200, + Amount: math.NewInt(1200), }, { Valoper: "cosmosvaloper144444444444444444444444444444444444", - Amount: 2200, + Amount: math.NewInt(2200), }, }, BurnAmount: sdk.NewCoin("uqatom", math.NewInt(4000)), @@ -532,19 +532,19 @@ func (s *AppTestSuite) TestV010500UpgradeHandler() { Distribution: []*icstypes.Distribution{ { Valoper: "cosmosvaloper100000000000000000000000000000000000", - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: "cosmosvaloper122222222222222222222222222222222222", - Amount: 1200, + Amount: math.NewInt(1200), }, { Valoper: "cosmosvaloper133333333333333333333333333333333333", - Amount: 1200, + Amount: math.NewInt(1200), }, { Valoper: "cosmosvaloper144444444444444444444444444444444444", - Amount: 1600, + Amount: math.NewInt(1600), }, }, BurnAmount: sdk.NewCoin("uqatom", math.NewInt(5000)), @@ -562,23 +562,23 @@ func (s *AppTestSuite) TestV010500UpgradeHandler() { Distribution: []*icstypes.Distribution{ { Valoper: "cosmosvaloper100000000000000000000000000000000000", - Amount: 1500, + Amount: math.NewInt(1500), }, { Valoper: "cosmosvaloper122222222222222222222222222222222222", - Amount: 1500, + Amount: math.NewInt(1500), }, { Valoper: "cosmosvaloper133333333333333333333333333333333333", - Amount: 1500, + Amount: math.NewInt(1500), }, { Valoper: "cosmosvaloper144444444444444444444444444444444444", - Amount: 1500, + Amount: math.NewInt(1500), }, { Valoper: "cosmosvaloper155555555555555555555555555555555555", - Amount: 1500, + Amount: math.NewInt(1500), }, }, BurnAmount: sdk.NewCoin("uqatom", math.NewInt(6000)), @@ -596,23 +596,23 @@ func (s *AppTestSuite) TestV010500UpgradeHandler() { Distribution: []*icstypes.Distribution{ { Valoper: "cosmosvaloper100000000000000000000000000000000000", - Amount: 1750, + Amount: math.NewInt(1750), }, { Valoper: "cosmosvaloper122222222222222222222222222222222222", - Amount: 1750, + Amount: math.NewInt(1750), }, { Valoper: "cosmosvaloper133333333333333333333333333333333333", - Amount: 1750, + Amount: math.NewInt(1750), }, { Valoper: "cosmosvaloper144444444444444444444444444444444444", - Amount: 1750, + Amount: math.NewInt(1750), }, { Valoper: "cosmosvaloper155555555555555555555555555555555555", - Amount: 1750, + Amount: math.NewInt(1750), }, }, BurnAmount: sdk.NewCoin("uqatom", math.NewInt(7000)), @@ -701,7 +701,7 @@ func (s *AppTestSuite) TestV010500UpgradeHandler() { s.True(wdr.Requeued) s.True(wdr.Acknowledged) s.Equal(wdr.Amount, sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(3600)))) - s.ElementsMatch(wdr.Distribution, []*icstypes.Distribution{{Valoper: "cosmosvaloper100000000000000000000000000000000000", Amount: 1200}, {Valoper: "cosmosvaloper111111111111111111111111111111111111", Amount: 1200}, {Valoper: "cosmosvaloper122222222222222222222222222222222222", Amount: 1000}, {Valoper: "cosmosvaloper133333333333333333333333333333333333", Amount: 800}}) + s.ElementsMatch(wdr.Distribution, []*icstypes.Distribution{{Valoper: "cosmosvaloper100000000000000000000000000000000000", Amount: math.NewInt(1200)}, {Valoper: "cosmosvaloper111111111111111111111111111111111111", Amount: math.NewInt(1200)}, {Valoper: "cosmosvaloper122222222222222222222222222222222222", Amount: math.NewInt(1000)}, {Valoper: "cosmosvaloper133333333333333333333333333333333333", Amount: math.NewInt(800)}}) wdrs := app.InterchainstakingKeeper.AllWithdrawalRecords(ctx) s.Equal(35, len(wdrs)) // 8 from requeue collation, 27 new records from restituion diff --git a/docs/swagger.yml b/docs/swagger.yml index 5090e6577..1d1f2dd5d 100644 --- a/docs/swagger.yml +++ b/docs/swagger.yml @@ -775,9 +775,11 @@ paths: spec) source_chain_id: type: string - amount: + _amount: type: string format: uint64 + amount: + type: string description: >- Claim define the users claim for holding assets within a given zone. @@ -935,9 +937,11 @@ paths: spec) source_chain_id: type: string - amount: + _amount: type: string format: uint64 + amount: + type: string description: >- Claim define the users claim for holding assets within a given zone. @@ -1097,9 +1101,11 @@ paths: spec) source_chain_id: type: string - amount: + _amount: type: string format: uint64 + amount: + type: string description: >- Claim define the users claim for holding assets within a given zone. @@ -1259,9 +1265,11 @@ paths: spec) source_chain_id: type: string - amount: + _amount: type: string format: uint64 + amount: + type: string description: >- Claim define the users claim for holding assets within a given zone. @@ -1651,10 +1659,7 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. + type.googleapis.com. Schemes other than `http`, `https` (or the empty scheme) @@ -1699,10 +1704,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -1742,6 +1743,7 @@ paths: name "y.z". + JSON ==== @@ -1968,10 +1970,7 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. + type.googleapis.com. Schemes other than `http`, `https` (or the empty scheme) @@ -2016,10 +2015,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -2059,6 +2054,7 @@ paths: name "y.z". + JSON ==== @@ -2685,9 +2681,11 @@ paths: properties: valoper: type: string - amount: + _amount: type: string format: uint64 + amount: + type: string recipient: type: string amount: @@ -3103,7 +3101,6 @@ paths: type: string deposited: type: string - format: int64 deposits: type: string format: int64 @@ -3112,10 +3109,8 @@ paths: format: int64 delegated: type: string - format: int64 supply: type: string - format: int64 distance_to_target: type: string unbonding_amount: @@ -3445,7 +3440,6 @@ paths: type: string deposited: type: string - format: int64 deposits: type: string format: int64 @@ -3454,10 +3448,8 @@ paths: format: int64 delegated: type: string - format: int64 supply: type: string - format: int64 distance_to_target: type: string unbonding_amount: @@ -3653,7 +3645,6 @@ paths: format: int64 tvl: type: string - format: int64 pagination: type: object properties: @@ -4130,12 +4121,14 @@ paths: type: string destination: type: string - amount: + _amount: type: string format: int64 completion_time: type: string format: date-time + amount: + type: string pagination: type: object properties: @@ -4587,9 +4580,11 @@ paths: properties: valoper: type: string - amount: + _amount: type: string format: uint64 + amount: + type: string recipient: type: string amount: @@ -4783,9 +4778,11 @@ paths: properties: valoper: type: string - amount: + _amount: type: string format: uint64 + amount: + type: string recipient: type: string amount: diff --git a/proto/quicksilver/claimsmanager/v1/claimsmanager.proto b/proto/quicksilver/claimsmanager/v1/claimsmanager.proto index 6b21526e5..6b6a66e20 100644 --- a/proto/quicksilver/claimsmanager/v1/claimsmanager.proto +++ b/proto/quicksilver/claimsmanager/v1/claimsmanager.proto @@ -33,7 +33,12 @@ message Claim { string chain_id = 2; ClaimType module = 3; string source_chain_id = 4; - uint64 amount = 5; + uint64 _amount = 5 [deprecated = true]; + string amount = 6 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; } // Proof defines a type used to cryptographically prove a claim. diff --git a/proto/quicksilver/interchainstaking/v1/interchainstaking.proto b/proto/quicksilver/interchainstaking/v1/interchainstaking.proto index c02d38d35..a027b51de 100644 --- a/proto/quicksilver/interchainstaking/v1/interchainstaking.proto +++ b/proto/quicksilver/interchainstaking/v1/interchainstaking.proto @@ -89,7 +89,12 @@ message ICAAccount { message Distribution { string valoper = 1; - uint64 amount = 2; + uint64 _amount = 2 [deprecated = true]; + string amount = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; } message WithdrawalRecord { @@ -134,19 +139,14 @@ message RedelegationRecord { int64 epoch_number = 2; string source = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string destination = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - int64 amount = 5; + int64 _amount = 5 [deprecated = true]; google.protobuf.Timestamp completion_time = 6 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; -} - -message TransferRecord { - string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string recipient = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - cosmos.base.v1beta1.Coin amount = 3 [ - (cosmos_proto.scalar) = "cosmos.Coin", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + string amount = 7 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; } diff --git a/proto/quicksilver/interchainstaking/v1/query.proto b/proto/quicksilver/interchainstaking/v1/query.proto index 19fcbb572..d023b36cb 100644 --- a/proto/quicksilver/interchainstaking/v1/query.proto +++ b/proto/quicksilver/interchainstaking/v1/query.proto @@ -97,11 +97,23 @@ service Query { message Statistics { string chain_id = 1; - int64 deposited = 2; + string deposited = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; int64 deposits = 3; int64 depositors = 4; - int64 delegated = 5; - int64 supply = 6; + string delegated = 5 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string supply = 6 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; string distance_to_target = 7; // Current number of tokens in the unbonding state. @@ -187,7 +199,11 @@ message QueryDelegationsRequest { message QueryDelegationsResponse { repeated Delegation delegations = 1 [(gogoproto.nullable) = false]; - int64 tvl = 2; + string tvl = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; cosmos.base.query.v1beta1.PageResponse pagination = 3; } diff --git a/x/airdrop/types/messages.pb.go b/x/airdrop/types/messages.pb.go index 3509cf722..32aa7f26b 100644 --- a/x/airdrop/types/messages.pb.go +++ b/x/airdrop/types/messages.pb.go @@ -202,50 +202,50 @@ func init() { } var fileDescriptor_2b0828c7de1949a1 = []byte{ - // 684 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xbd, 0x6f, 0xd3, 0x4e, - 0x18, 0x8e, 0x93, 0xf4, 0xeb, 0xaa, 0xdf, 0x07, 0xa6, 0x94, 0x34, 0x02, 0x3b, 0x32, 0xaa, 0x14, - 0x8a, 0x62, 0x37, 0xe5, 0xa3, 0x52, 0x36, 0x52, 0x96, 0x0e, 0x45, 0x25, 0xdd, 0x58, 0xa2, 0x8b, - 0x7d, 0xb8, 0xa7, 0xda, 0xf7, 0x1a, 0xdf, 0x25, 0x6a, 0x99, 0x50, 0x25, 0x24, 0x46, 0x24, 0xfe, - 0x81, 0xce, 0x4c, 0x0c, 0x88, 0x8d, 0x81, 0xad, 0x63, 0x05, 0x0b, 0x53, 0x40, 0x2d, 0x12, 0xcc, - 0xfd, 0x0b, 0x90, 0xcf, 0xe7, 0xd6, 0x11, 0xa5, 0x15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x1a, 0xda, 0xab, 0x23, 0xa3, 0x70, - 0x70, 0x64, 0x14, 0xbe, 0x1c, 0x19, 0x85, 0xc7, 0xcb, 0x39, 0x01, 0xe4, 0x92, 0x36, 0x9e, 0x01, - 0x23, 0x23, 0x55, 0xb6, 0x4f, 0x2a, 0x48, 0x55, 0xf4, 0xc6, 0xe5, 0xbf, 0xe4, 0xf6, 0xaf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x39, 0xec, 0x3d, 0x88, 0x46, 0x05, 0x00, 0x00, + // 683 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0x8e, 0x93, 0xf4, 0xeb, 0x2a, 0xbe, 0x4c, 0x29, 0x69, 0x04, 0x76, 0x64, 0x54, 0x29, 0x04, + 0xc5, 0x6e, 0xca, 0x47, 0x25, 0x6f, 0xa4, 0x2c, 0x1d, 0x8a, 0x4a, 0xba, 0xb1, 0x44, 0x17, 0xfb, + 0xb8, 0x9e, 0x6a, 0xdf, 0x19, 0xdf, 0x25, 0x6a, 0x99, 0x50, 0x25, 0x24, 0x46, 0x24, 0xfe, 0x40, + 0x67, 0x26, 0x06, 0xc4, 0xc6, 0xc0, 0xd6, 0xb1, 0x82, 0x85, 0x29, 0xa0, 0x16, 0x09, 0xe6, 0xfe, + 0x02, 0xe4, 0xf3, 0xb9, 0x75, 0x44, 0x69, 0xc5, 0xe4, 0xbb, 0xf7, 0x7d, 0x9e, 0xf7, 0xf3, 0x39, + 0x83, 0xf9, 0xe7, 0x7d, 0xe2, 0x6d, 0x72, 0x12, 0x0c, 0x50, 0xec, 0x40, 0x12, 0xfb, 0x31, 0x8b, + 0x9c, 0x41, 0xcb, 0x09, 0x11, 0xe7, 0x10, 0x23, 0x6e, 0x47, 0x31, 0x13, 0x4c, 0x9f, 0xcd, 0xc1, + 0x6c, 0x05, 0xb3, 0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 0x8b, 0x46, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/claimsmanager/keeper/claims_test.go b/x/claimsmanager/keeper/claims_test.go index 633281617..a5053d234 100644 --- a/x/claimsmanager/keeper/claims_test.go +++ b/x/claimsmanager/keeper/claims_test.go @@ -1,6 +1,8 @@ package keeper_test import ( + "cosmossdk.io/math" + "github.com/quicksilver-zone/quicksilver/utils/addressutils" "github.com/quicksilver-zone/quicksilver/x/claimsmanager/types" ) @@ -12,7 +14,7 @@ var testClaims = []types.Claim{ // ChainID: suite.chainB.ChainID, Module: types.ClaimTypeOsmosisPool, SourceChainId: "osmosis-1", - Amount: 5000000, + Amount: math.NewInt(5000000), }, // test user claim on chainB (liquid) { @@ -20,7 +22,7 @@ var testClaims = []types.Claim{ // ChainID: suite.chainB.ChainID, Module: types.ClaimTypeLiquidToken, SourceChainId: "", - Amount: 5000000, + Amount: math.NewInt(5000000), }, // random user claim on chainB (using osmosis pool) { @@ -28,7 +30,7 @@ var testClaims = []types.Claim{ // ChainID: suite.chainB.ChainID, Module: types.ClaimTypeOsmosisPool, SourceChainId: "osmosis-1", - Amount: 15000000, + Amount: math.NewInt(15000000), }, // zero value claim { @@ -36,7 +38,7 @@ var testClaims = []types.Claim{ // ChainID: suite.chainB.ChainID, Module: types.ClaimTypeLiquidToken, SourceChainId: "osmosis-1", - Amount: 0, + Amount: math.ZeroInt(), }, // test user claim on "cosmoshub-4" (liquid) { @@ -44,7 +46,7 @@ var testClaims = []types.Claim{ ChainId: "cosmoshub-4", Module: types.ClaimTypeLiquidToken, SourceChainId: "", - Amount: 10000000, + Amount: math.NewInt(10000000), }, // random user claim on "cosmoshub-4" (liquid) { @@ -52,7 +54,7 @@ var testClaims = []types.Claim{ ChainId: "cosmoshub-4", Module: types.ClaimTypeLiquidToken, SourceChainId: "", - Amount: 15000000, + Amount: math.NewInt(15000000), }, } @@ -62,7 +64,7 @@ func (suite *KeeperTestSuite) TestKeeper_NewClaim() { chainID string module types.ClaimType srcChainID string - amount uint64 + amount math.Int } tests := []struct { name string @@ -81,14 +83,14 @@ func (suite *KeeperTestSuite) TestKeeper_NewClaim() { suite.chainB.ChainID, types.ClaimTypeLiquidToken, "", - 5000000, + math.NewInt(5000000), }, types.Claim{ UserAddress: testAddress, ChainId: suite.chainB.ChainID, Module: types.ClaimTypeLiquidToken, SourceChainId: "", - Amount: 5000000, + Amount: math.NewInt(5000000), }, }, } diff --git a/x/claimsmanager/types/claimsmanager.go b/x/claimsmanager/types/claimsmanager.go index 4974cfb78..177918883 100644 --- a/x/claimsmanager/types/claimsmanager.go +++ b/x/claimsmanager/types/claimsmanager.go @@ -3,10 +3,12 @@ package types import ( "github.com/ingenuity-build/multierror" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) -func NewClaim(address, chainID string, module ClaimType, srcChainID string, amount uint64) Claim { +func NewClaim(address, chainID string, module ClaimType, srcChainID string, amount math.Int) Claim { return Claim{UserAddress: address, ChainId: chainID, Module: module, SourceChainId: srcChainID, Amount: amount} } @@ -23,7 +25,7 @@ func (c *Claim) ValidateBasic() error { errs["ChainID"] = ErrUndefinedAttribute } - if c.Amount <= 0 { + if c.Amount.IsNil() || !c.Amount.IsPositive() { errs["Amount"] = ErrNotPositive } diff --git a/x/claimsmanager/types/claimsmanager.pb.go b/x/claimsmanager/types/claimsmanager.pb.go index c35426f0b..be170bd14 100644 --- a/x/claimsmanager/types/claimsmanager.pb.go +++ b/x/claimsmanager/types/claimsmanager.pb.go @@ -6,6 +6,7 @@ package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/gogo/protobuf/proto" crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" @@ -101,11 +102,12 @@ var xxx_messageInfo_Params proto.InternalMessageInfo // Claim define the users claim for holding assets within a given zone. type Claim struct { - UserAddress string `protobuf:"bytes,1,opt,name=user_address,json=userAddress,proto3" json:"user_address,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Module ClaimType `protobuf:"varint,3,opt,name=module,proto3,enum=quicksilver.claimsmanager.v1.ClaimType" json:"module,omitempty"` - SourceChainId string `protobuf:"bytes,4,opt,name=source_chain_id,json=sourceChainId,proto3" json:"source_chain_id,omitempty"` - Amount uint64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` + UserAddress string `protobuf:"bytes,1,opt,name=user_address,json=userAddress,proto3" json:"user_address,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Module ClaimType `protobuf:"varint,3,opt,name=module,proto3,enum=quicksilver.claimsmanager.v1.ClaimType" json:"module,omitempty"` + SourceChainId string `protobuf:"bytes,4,opt,name=source_chain_id,json=sourceChainId,proto3" json:"source_chain_id,omitempty"` + XAmount uint64 `protobuf:"varint,5,opt,name=_amount,json=Amount,proto3" json:"_amount,omitempty"` // Deprecated: Do not use. + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` } func (m *Claim) Reset() { *m = Claim{} } @@ -195,41 +197,44 @@ func init() { } var fileDescriptor_086999747d797382 = []byte{ - // 533 bytes of a gzipped FileDescriptorProto + // 586 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xf6, 0x35, 0x4e, 0x68, 0xae, 0x05, 0xa2, 0x53, 0xa8, 0x9c, 0x00, 0x4e, 0x94, 0x01, 0x22, - 0xa4, 0xda, 0xb4, 0x4c, 0x14, 0x21, 0x44, 0x33, 0x21, 0x21, 0x35, 0x72, 0x8b, 0x90, 0x58, 0x22, - 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16, 0xf8, 0x9f, 0x69, 0x55, 0x79, 0xfa, + 0x5d, 0x05, 0xe5, 0x85, 0xc7, 0x70, 0x1b, 0xc0, 0x45, 0xf1, 0x8e, 0x04, 0xa8, 0x8f, 0x09, 0x0a, + 0x2a, 0x0a, 0x34, 0xc0, 0xd6, 0x02, 0x7f, 0x8b, 0xcf, 0x13, 0x1c, 0xf4, 0xe8, 0x10, 0x91, 0x8a, + 0xba, 0xc2, 0x9c, 0xa4, 0x86, 0x60, 0xde, 0xa5, 0x74, 0x54, 0x29, 0xc0, 0x1d, 0xf0, 0x70, 0xc1, + 0xb4, 0x19, 0xe2, 0x3e, 0x22, 0x42, 0x52, 0xc5, 0x15, 0xea, 0x14, 0xf7, 0x65, 0x8e, 0x92, 0xd2, + 0x56, 0x4f, 0x10, 0x21, 0x94, 0xe9, 0x94, 0x76, 0xb5, 0x8b, 0xaf, 0xa6, 0xd2, 0x7a, 0x7f, 0x35, + 0x33, 0xd5, 0xeb, 0x99, 0xa9, 0xfe, 0x9e, 0x99, 0xea, 0xe7, 0xb9, 0xa9, 0x5c, 0xcf, 0x4d, 0xe5, + 0xe7, 0xdc, 0x54, 0x3e, 0xbc, 0x5e, 0x0a, 0x6e, 0xe9, 0x87, 0x6a, 0x7e, 0xa2, 0x04, 0x2d, 0x03, + 0xf6, 0xc7, 0x7f, 0x9e, 0xa2, 0xcc, 0xf4, 0x4c, 0x97, 0x4f, 0xe2, 0xf9, 0xdf, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xbd, 0x79, 0x19, 0x8a, 0xb4, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -275,8 +280,18 @@ func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Amount != 0 { - i = encodeVarintClaimsmanager(dAtA, i, uint64(m.Amount)) + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintClaimsmanager(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if m.XAmount != 0 { + i = encodeVarintClaimsmanager(dAtA, i, uint64(m.XAmount)) i-- dAtA[i] = 0x28 } @@ -411,9 +426,11 @@ func (m *Claim) Size() (n int) { if l > 0 { n += 1 + l + sovClaimsmanager(uint64(l)) } - if m.Amount != 0 { - n += 1 + sovClaimsmanager(uint64(m.Amount)) + if m.XAmount != 0 { + n += 1 + sovClaimsmanager(uint64(m.XAmount)) } + l = m.Amount.Size() + n += 1 + l + sovClaimsmanager(uint64(l)) return n } @@ -647,9 +664,28 @@ func (m *Claim) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 5: if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field XAmount", wireType) + } + m.XAmount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaimsmanager + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.XAmount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } - m.Amount = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClaimsmanager @@ -659,11 +695,26 @@ func (m *Claim) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Amount |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthClaimsmanager + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaimsmanager + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipClaimsmanager(dAtA[iNdEx:]) diff --git a/x/claimsmanager/types/claimsmanager_test.go b/x/claimsmanager/types/claimsmanager_test.go index a9e85530d..de5eea7d5 100644 --- a/x/claimsmanager/types/claimsmanager_test.go +++ b/x/claimsmanager/types/claimsmanager_test.go @@ -5,6 +5,8 @@ import ( "github.com/stretchr/testify/require" + "cosmossdk.io/math" + "github.com/quicksilver-zone/quicksilver/utils/addressutils" "github.com/quicksilver-zone/quicksilver/x/claimsmanager/types" ) @@ -13,7 +15,7 @@ func TestClaim_ValidateBasic(t *testing.T) { type fields struct { UserAddress string ChainID string - Amount uint64 + Amount math.Int } tests := []struct { name string @@ -30,7 +32,7 @@ func TestClaim_ValidateBasic(t *testing.T) { fields{ UserAddress: "cosmos1234567890", ChainID: "testzone-1", - Amount: 10000, + Amount: math.NewInt(10000), }, true, }, @@ -39,7 +41,7 @@ func TestClaim_ValidateBasic(t *testing.T) { fields{ UserAddress: addressutils.GenerateAccAddressForTest().String(), ChainID: "", - Amount: 10000, + Amount: math.NewInt(10000), }, true, }, @@ -48,7 +50,7 @@ func TestClaim_ValidateBasic(t *testing.T) { fields{ UserAddress: addressutils.GenerateAccAddressForTest().String(), ChainID: "", - Amount: 10000, + Amount: math.NewInt(10000), }, true, }, @@ -57,7 +59,7 @@ func TestClaim_ValidateBasic(t *testing.T) { fields{ UserAddress: addressutils.GenerateAccAddressForTest().String(), ChainID: "testzone-1", - Amount: 0, + Amount: math.ZeroInt(), }, true, }, @@ -66,7 +68,7 @@ func TestClaim_ValidateBasic(t *testing.T) { fields{ UserAddress: addressutils.GenerateAccAddressForTest().String(), ChainID: "testzone-1", - Amount: 1000000, + Amount: math.NewInt(1000000), }, false, }, diff --git a/x/claimsmanager/types/genesis_test.go b/x/claimsmanager/types/genesis_test.go index db7d2902d..56477f7e7 100644 --- a/x/claimsmanager/types/genesis_test.go +++ b/x/claimsmanager/types/genesis_test.go @@ -5,6 +5,8 @@ import ( "github.com/stretchr/testify/require" + "cosmossdk.io/math" + "github.com/quicksilver-zone/quicksilver/utils/addressutils" "github.com/quicksilver-zone/quicksilver/x/claimsmanager/types" ) @@ -45,7 +47,7 @@ func TestGenesisState_Validate(t *testing.T) { { UserAddress: addressutils.GenerateAccAddressForTest().String(), ChainId: "testzone-1", - Amount: 0, + Amount: math.ZeroInt(), }, }, }, @@ -59,7 +61,7 @@ func TestGenesisState_Validate(t *testing.T) { { UserAddress: addressutils.GenerateAccAddressForTest().String(), ChainId: "testzone-1", - Amount: 1000000, + Amount: math.NewInt(1000000), }, }, }, diff --git a/x/interchainquery/types/messages.pb.go b/x/interchainquery/types/messages.pb.go index 1b170fce0..5723a80ef 100644 --- a/x/interchainquery/types/messages.pb.go +++ b/x/interchainquery/types/messages.pb.go @@ -149,12 +149,12 @@ var fileDescriptor_0640fcbc3e895a79 = []byte{ 0x82, 0x9d, 0x94, 0xce, 0xa4, 0x76, 0xf9, 0xcd, 0xd4, 0x2b, 0xbc, 0x9f, 0x7a, 0xe0, 0xe7, 0xd4, 0x2b, 0xf8, 0x35, 0xcb, 0x5d, 0xff, 0xab, 0xf3, 0xb3, 0xf5, 0x19, 0x58, 0xc5, 0x7d, 0x49, 0xec, 0x8f, 0xc0, 0xda, 0x5d, 0xf7, 0x24, 0xf7, 0xe0, 0xbf, 0x97, 0x07, 0xae, 0xcf, 0x5f, 0x7d, 0xf0, - 0x7f, 0x71, 0xf9, 0xe9, 0xb7, 0x5e, 0x7f, 0xfd, 0xf1, 0x6e, 0xe3, 0x4e, 0x1b, 0xdc, 0xf6, 0x6f, - 0x9e, 0x59, 0x71, 0x75, 0x8c, 0xc6, 0xcd, 0x1e, 0x56, 0x61, 0x13, 0x49, 0x9d, 0x43, 0xcb, 0x9d, + 0x7f, 0x71, 0xf9, 0xe9, 0xb7, 0x5e, 0x7f, 0xfd, 0xf1, 0x6e, 0xe3, 0x8e, 0x7f, 0xf3, 0xcc, 0x7e, + 0xab, 0x63, 0x34, 0x6e, 0xf6, 0xb0, 0x0a, 0x9b, 0x48, 0xea, 0x04, 0x5a, 0x6e, 0x83, 0xdb, 0x9d, 0xe7, 0x9f, 0xe6, 0x2e, 0x38, 0x99, 0xbb, 0xe0, 0xfb, 0xdc, 0x05, 0x6f, 0x17, 0x6e, 0xe1, 0x64, 0xe1, 0x16, 0xbe, 0x2d, 0xdc, 0xc2, 0x8b, 0x87, 0x84, 0xaa, 0xc1, 0xa8, 0x07, 0xfb, 0x3c, 0x46, - 0x2b, 0x7d, 0x35, 0x5e, 0x71, 0x86, 0x57, 0x05, 0x74, 0x7c, 0xb6, 0xd6, 0x24, 0xc1, 0xb2, 0x57, - 0xd2, 0xbb, 0x7b, 0xf7, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, 0xc4, 0x93, 0xfb, 0x7a, 0x03, + 0x2b, 0x7d, 0x35, 0x5e, 0x71, 0x86, 0x57, 0x05, 0x74, 0x7c, 0xb6, 0xdc, 0x24, 0xc1, 0xb2, 0x57, + 0xd2, 0xbb, 0x7b, 0xf7, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xd0, 0x97, 0x34, 0x7a, 0x03, 0x00, 0x00, } diff --git a/x/interchainstaking/keeper/callbacks_test.go b/x/interchainstaking/keeper/callbacks_test.go index 4704d6f4f..11bcb746e 100644 --- a/x/interchainstaking/keeper/callbacks_test.go +++ b/x/interchainstaking/keeper/callbacks_test.go @@ -528,7 +528,7 @@ func (suite *KeeperTestSuite) TestHandleValidatorCallbackJailedWithSlashing() { Distribution: []*icstypes.Distribution{ { Valoper: vals[0].ValoperAddress, - Amount: 1000, + Amount: sdkmath.NewInt(1000), }, }, Recipient: user1.String(), @@ -547,7 +547,7 @@ func (suite *KeeperTestSuite) TestHandleValidatorCallbackJailedWithSlashing() { Distribution: []*icstypes.Distribution{ { Valoper: vals[0].ValoperAddress, - Amount: 950, + Amount: sdkmath.NewInt(950), }, }, Recipient: user1.String(), @@ -578,11 +578,11 @@ func (suite *KeeperTestSuite) TestHandleValidatorCallbackJailedWithSlashing() { Distribution: []*icstypes.Distribution{ { Valoper: vals[0].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, { Valoper: vals[1].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, }, Recipient: user1.String(), @@ -601,11 +601,11 @@ func (suite *KeeperTestSuite) TestHandleValidatorCallbackJailedWithSlashing() { Distribution: []*icstypes.Distribution{ { Valoper: vals[0].ValoperAddress, - Amount: 475, + Amount: sdkmath.NewInt(475), }, { Valoper: vals[1].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, }, Recipient: user1.String(), @@ -636,11 +636,11 @@ func (suite *KeeperTestSuite) TestHandleValidatorCallbackJailedWithSlashing() { Distribution: []*icstypes.Distribution{ { Valoper: vals[1].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, { Valoper: vals[2].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, }, Recipient: user1.String(), @@ -659,11 +659,11 @@ func (suite *KeeperTestSuite) TestHandleValidatorCallbackJailedWithSlashing() { Distribution: []*icstypes.Distribution{ { Valoper: vals[1].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, { Valoper: vals[2].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, }, Recipient: user1.String(), diff --git a/x/interchainstaking/keeper/grpc_query.go b/x/interchainstaking/keeper/grpc_query.go index dbfbad160..727a8ccaa 100644 --- a/x/interchainstaking/keeper/grpc_query.go +++ b/x/interchainstaking/keeper/grpc_query.go @@ -189,10 +189,7 @@ func (k *Keeper) Delegations(c context.Context, req *types.QueryDelegationsReque return false }) - if sum.IsInt64() { - return &types.QueryDelegationsResponse{Delegations: delegations, Tvl: sum.Int64()}, nil - } - return &types.QueryDelegationsResponse{Delegations: delegations}, status.Error(codes.OutOfRange, "tvl out of bound Int64") + return &types.QueryDelegationsResponse{Delegations: delegations, Tvl: sum}, nil } func (k *Keeper) Receipts(c context.Context, req *types.QueryReceiptsRequest) (*types.QueryReceiptsResponse, error) { diff --git a/x/interchainstaking/keeper/grpc_query_test.go b/x/interchainstaking/keeper/grpc_query_test.go index da3b76390..0bab8f1bb 100644 --- a/x/interchainstaking/keeper/grpc_query_test.go +++ b/x/interchainstaking/keeper/grpc_query_test.go @@ -775,11 +775,11 @@ func (suite *KeeperTestSuite) TestKeeper_ZoneWithdrawalRecords() { distributions := []*types.Distribution{ { Valoper: icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[0].ValoperAddress, - Amount: 10000000, + Amount: math.NewInt(10000000), }, { Valoper: icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[1].ValoperAddress, - Amount: 20000000, + Amount: math.NewInt(20000000), }, } @@ -879,11 +879,11 @@ func (suite *KeeperTestSuite) TestKeeper_UserWithdrawalRecords() { distributions := []*types.Distribution{ { Valoper: icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[0].ValoperAddress, - Amount: 10000000, + Amount: math.NewInt(10000000), }, { Valoper: icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[1].ValoperAddress, - Amount: 20000000, + Amount: math.NewInt(20000000), }, } @@ -971,11 +971,11 @@ func (suite *KeeperTestSuite) TestKeeper_WithdrawalRecords() { distributions := []*types.Distribution{ { Valoper: icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[0].ValoperAddress, - Amount: 10000000, + Amount: math.NewInt(10000000), }, { Valoper: icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[1].ValoperAddress, - Amount: 20000000, + Amount: math.NewInt(20000000), }, } @@ -1140,7 +1140,7 @@ func (suite *KeeperTestSuite) TestKeeper_RedelegationRecords() { EpochNumber: 1, Source: icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[1].ValoperAddress, Destination: icsKeeper.GetValidators(ctx, suite.chainB.ChainID)[0].ValoperAddress, - Amount: 10000000, + Amount: math.NewInt(10000000), }) }, &types.QueryRedelegationRecordsRequest{}, diff --git a/x/interchainstaking/keeper/ibc_packet_handlers.go b/x/interchainstaking/keeper/ibc_packet_handlers.go index f7835931b..a670eab39 100644 --- a/x/interchainstaking/keeper/ibc_packet_handlers.go +++ b/x/interchainstaking/keeper/ibc_packet_handlers.go @@ -442,7 +442,7 @@ func (k *Keeper) HandleWithdrawForUser(ctx sdk.Context, zone *types.Zone, msg *b dlist := make(map[int]struct{}) for i, dist := range withdrawalRecord.Distribution { - if msg.Amount[0].Amount.Equal(sdk.NewIntFromUint64(dist.Amount)) { // check valoper here too? + if msg.Amount[0].Amount.Equal(dist.Amount) { // check valoper here too? dlist[i] = struct{}{} // matched amount if len(withdrawalRecord.Distribution) == len(dlist) { @@ -588,7 +588,7 @@ func (k *Keeper) HandleBeginRedelegate(ctx sdk.Context, msg sdk.Msg, completion EpochNumber: epochNumber, Source: redelegateMsg.ValidatorSrcAddress, Destination: redelegateMsg.ValidatorDstAddress, - Amount: redelegateMsg.Amount.Amount.Int64(), + Amount: redelegateMsg.Amount.Amount, CompletionTime: completion, } } @@ -863,7 +863,7 @@ func (k *Keeper) HandleFailedUndelegate(ctx sdk.Context, msg sdk.Msg, memo strin // - save old record // - create new record for unhandled burn amount newDistribution := make([]*types.Distribution, 0) - relatedAmount := uint64(0) + relatedAmount := sdkmath.ZeroInt() for _, dist := range wdr.Distribution { if dist.Valoper != ubr.Validator { newDistribution = append(newDistribution, dist) @@ -874,7 +874,7 @@ func (k *Keeper) HandleFailedUndelegate(ctx sdk.Context, msg sdk.Msg, memo strin amount := wdr.Amount.AmountOf(zone.BaseDenom) rr := sdk.NewDecFromInt(wdr.BurnAmount.Amount).Quo(sdk.NewDecFromInt(amount)) - relatedQAsset := sdk.NewDec(int64(relatedAmount)).Mul(rr).TruncateInt() + relatedQAsset := sdk.NewDecFromInt(relatedAmount).Mul(rr).TruncateInt() if len(newDistribution) == 0 { // if this was the final record, delete the withdrawal record @@ -882,7 +882,7 @@ func (k *Keeper) HandleFailedUndelegate(ctx sdk.Context, msg sdk.Msg, memo strin } else { // else update it wdr.Distribution = newDistribution - wdr.Amount = wdr.Amount.Sub(sdk.NewCoin(zone.BaseDenom, sdk.NewIntFromUint64(relatedAmount))) + wdr.Amount = wdr.Amount.Sub(sdk.NewCoin(zone.BaseDenom, relatedAmount)) wdr.BurnAmount = wdr.BurnAmount.SubAmount(relatedQAsset) k.SetWithdrawalRecord(ctx, wdr) } @@ -1443,9 +1443,15 @@ func (*Keeper) prepareRewardsDistributionMsgs(zone types.Zone, rewards sdkmath.I } } -func equalLsmCoin(valoper string, amount uint64, lsmAmount sdk.Coin) bool { - if strings.HasPrefix(lsmAmount.Denom, valoper) { - return lsmAmount.Amount.Equal(sdk.NewIntFromUint64(amount)) +func isNumericString(in string) bool { + _, err := strconv.Atoi(in) + return err == nil +} + +func equalLsmCoin(valoper string, amount sdkmath.Int, lsmAmount sdk.Coin) bool { + parts := strings.Split(lsmAmount.Denom, "/") + if len(parts) == 2 && strings.HasPrefix(parts[0], valoper) && isNumericString(parts[1]) { + return lsmAmount.Amount.Equal(amount) } return false } diff --git a/x/interchainstaking/keeper/ibc_packet_handlers_test.go b/x/interchainstaking/keeper/ibc_packet_handlers_test.go index 5d74ad604..010ee52e6 100644 --- a/x/interchainstaking/keeper/ibc_packet_handlers_test.go +++ b/x/interchainstaking/keeper/ibc_packet_handlers_test.go @@ -165,23 +165,16 @@ func (suite *KeeperTestSuite) TestHandleQueuedUnbondings() { { name: "valid", records: func(ctx sdk.Context, qs *app.Quicksilver, zone *types.Zone) []types.WithdrawalRecord { - vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) - return []types.WithdrawalRecord{ { - ChainId: zone.ChainId, - Delegator: addressutils.GenerateAccAddressForTest().String(), - Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 1000000}, - {Valoper: vals[1], Amount: 1000000}, - {Valoper: vals[2], Amount: 1000000}, - {Valoper: vals[3], Amount: 1000000}, - }, - Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), - Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(4000000))), - BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), - Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", - Status: types.WithdrawStatusQueued, + ChainId: zone.ChainId, + Delegator: addressutils.GenerateAccAddressForTest().String(), + Distribution: nil, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), + Amount: nil, + BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), + Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", + Status: types.WithdrawStatusQueued, }, } }, @@ -217,39 +210,75 @@ func (suite *KeeperTestSuite) TestHandleQueuedUnbondings() { expectError: false, }, { - name: "valid - two", + name: "valid - int64 overflow", records: func(ctx sdk.Context, qs *app.Quicksilver, zone *types.Zone) []types.WithdrawalRecord { + return []types.WithdrawalRecord{ + { + ChainId: zone.ChainId, + Delegator: addressutils.GenerateAccAddressForTest().String(), + Distribution: nil, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), + Amount: nil, + BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000000000).Mul(sdk.NewInt(4000000000000))), + Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", + Status: types.WithdrawStatusQueued, + }, + } + }, + delegations: func(ctx sdk.Context, qs *app.Quicksilver, zone *types.Zone) []types.Delegation { vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []types.Delegation{ + { + DelegationAddress: zone.DelegationAddress.Address, + ValidatorAddress: vals[0], + Amount: sdk.NewCoin("uatom", sdk.NewInt(1000000000000).Mul(sdk.NewInt(4000000000000))), + }, + { + DelegationAddress: zone.DelegationAddress.Address, + ValidatorAddress: vals[1], + Amount: sdk.NewCoin("uatom", sdk.NewInt(1000000000000).Mul(sdk.NewInt(4000000000000))), + }, + { + DelegationAddress: zone.DelegationAddress.Address, + ValidatorAddress: vals[2], + Amount: sdk.NewCoin("uatom", sdk.NewInt(1000000000000).Mul(sdk.NewInt(4000000000000))), + }, + { + DelegationAddress: zone.DelegationAddress.Address, + ValidatorAddress: vals[3], + Amount: sdk.NewCoin("uatom", sdk.NewInt(1000000000000).Mul(sdk.NewInt(4000000000000))), + }, + } + }, + redelegations: func(ctx sdk.Context, qs *app.Quicksilver, zone *types.Zone) []types.RedelegationRecord { + return []types.RedelegationRecord{} + }, + expectTransition: []bool{true}, + expectError: false, + }, + { + name: "valid - two", + records: func(ctx sdk.Context, qs *app.Quicksilver, zone *types.Zone) []types.WithdrawalRecord { return []types.WithdrawalRecord{ { - ChainId: zone.ChainId, - Delegator: addressutils.GenerateAccAddressForTest().String(), - Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 1000000}, - {Valoper: vals[1], Amount: 1000000}, - {Valoper: vals[2], Amount: 1000000}, - {Valoper: vals[3], Amount: 1000000}, - }, - Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), - Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(4000000))), - BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), - Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", - Status: types.WithdrawStatusQueued, + ChainId: zone.ChainId, + Delegator: addressutils.GenerateAccAddressForTest().String(), + Distribution: nil, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), + Amount: nil, + BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), + Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", + Status: types.WithdrawStatusQueued, }, { - ChainId: zone.ChainId, - Delegator: addressutils.GenerateAccAddressForTest().String(), - Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 5000000}, - {Valoper: vals[1], Amount: 2500000}, - {Valoper: vals[2], Amount: 5000000}, - {Valoper: vals[3], Amount: 2500000}, - }, - Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), - Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(15000000))), - BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(15000000)), - Txhash: "d786f7d4c94247625c2882e921a790790eb77a00d0534d5c3154d0a9c5ab68f5", - Status: types.WithdrawStatusQueued, + ChainId: zone.ChainId, + Delegator: addressutils.GenerateAccAddressForTest().String(), + Distribution: nil, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), + Amount: nil, + BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(15000000)), + Txhash: "d786f7d4c94247625c2882e921a790790eb77a00d0534d5c3154d0a9c5ab68f5", + Status: types.WithdrawStatusQueued, }, } }, @@ -287,22 +316,16 @@ func (suite *KeeperTestSuite) TestHandleQueuedUnbondings() { { name: "invalid - locked tokens", records: func(ctx sdk.Context, qs *app.Quicksilver, zone *types.Zone) []types.WithdrawalRecord { - vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) return []types.WithdrawalRecord{ { - ChainId: zone.ChainId, - Delegator: addressutils.GenerateAccAddressForTest().String(), - Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 1000000}, - {Valoper: vals[1], Amount: 1000000}, - {Valoper: vals[2], Amount: 1000000}, - {Valoper: vals[3], Amount: 1000000}, - }, - Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), - Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(4000000))), - BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), - Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", - Status: types.WithdrawStatusQueued, + ChainId: zone.ChainId, + Delegator: addressutils.GenerateAccAddressForTest().String(), + Distribution: nil, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), + Amount: nil, + BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), + Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", + Status: types.WithdrawStatusQueued, }, } }, @@ -339,7 +362,7 @@ func (suite *KeeperTestSuite) TestHandleQueuedUnbondings() { EpochNumber: 1, Source: vals[3], Destination: vals[0], - Amount: 500000, + Amount: math.NewInt(500000), CompletionTime: time.Now().Add(time.Hour), }, } @@ -350,37 +373,26 @@ func (suite *KeeperTestSuite) TestHandleQueuedUnbondings() { { name: "mixed - locked tokens but both succeed (previously failed)", records: func(ctx sdk.Context, qs *app.Quicksilver, zone *types.Zone) []types.WithdrawalRecord { - vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) return []types.WithdrawalRecord{ { - ChainId: zone.ChainId, - Delegator: addressutils.GenerateAccAddressForTest().String(), - Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 5000000}, - {Valoper: vals[1], Amount: 2500000}, - {Valoper: vals[2], Amount: 5000000}, - {Valoper: vals[3], Amount: 2500000}, - }, - Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), - Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(15000000))), - BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(15000000)), - Txhash: "d786f7d4c94247625c2882e921a790790eb77a00d0534d5c3154d0a9c5ab68f5", - Status: types.WithdrawStatusQueued, + ChainId: zone.ChainId, + Delegator: addressutils.GenerateAccAddressForTest().String(), + Distribution: nil, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), + Amount: nil, + BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(15000000)), + Txhash: "d786f7d4c94247625c2882e921a790790eb77a00d0534d5c3154d0a9c5ab68f5", + Status: types.WithdrawStatusQueued, }, { - ChainId: zone.ChainId, - Delegator: addressutils.GenerateAccAddressForTest().String(), - Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 1000000}, - {Valoper: vals[1], Amount: 1000000}, - {Valoper: vals[2], Amount: 1000000}, - {Valoper: vals[3], Amount: 1000000}, - }, - Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), - Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(4000000))), - BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), - Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", - Status: types.WithdrawStatusQueued, + ChainId: zone.ChainId, + Delegator: addressutils.GenerateAccAddressForTest().String(), + Distribution: nil, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), + Amount: nil, + BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), + Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", + Status: types.WithdrawStatusQueued, }, } }, @@ -417,7 +429,7 @@ func (suite *KeeperTestSuite) TestHandleQueuedUnbondings() { EpochNumber: 1, Source: vals[3], Destination: vals[0], - Amount: 1000001, + Amount: math.NewInt(1000001), CompletionTime: time.Now().Add(time.Hour), }, } @@ -506,19 +518,14 @@ func (suite *KeeperTestSuite) TestHandleWithdrawForUser() { records: func(zone *types.Zone) []types.WithdrawalRecord { return []types.WithdrawalRecord{ { - ChainId: zone.ChainId, - Delegator: addressutils.GenerateAccAddressForTest().String(), - Distribution: []*types.Distribution{ - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - }, - Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), - Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(4000000))), - BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), - Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", - Status: types.WithdrawStatusQueued, + ChainId: zone.ChainId, + Delegator: addressutils.GenerateAccAddressForTest().String(), + Distribution: nil, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), + Amount: nil, + BurnAmount: sdk.NewCoin("uqatom", sdk.NewInt(4000000)), + Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", + Status: types.WithdrawStatusQueued, }, } }, @@ -534,10 +541,10 @@ func (suite *KeeperTestSuite) TestHandleWithdrawForUser() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1000000)}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1000000)}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1000000)}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(4000000))), @@ -561,10 +568,10 @@ func (suite *KeeperTestSuite) TestHandleWithdrawForUser() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1000000}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1000000)}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1000000)}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1000000)}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(4000000))), @@ -576,10 +583,10 @@ func (suite *KeeperTestSuite) TestHandleWithdrawForUser() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 5000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1250000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 5000000}, - {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: 1250000}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(5000000)}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1250000)}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(5000000)}, + {Valoper: addressutils.GenerateValAddressForTest().String(), Amount: math.NewInt(1250000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(15000000))), @@ -668,8 +675,8 @@ func (suite *KeeperTestSuite) TestHandleWithdrawForUserLSM() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: v1, Amount: 1000000}, - {Valoper: v2, Amount: 1000000}, + {Valoper: v1, Amount: math.NewInt(1000000)}, + {Valoper: v2, Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(2000000))), @@ -694,8 +701,8 @@ func (suite *KeeperTestSuite) TestHandleWithdrawForUserLSM() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: v1, Amount: 1000000}, - {Valoper: v2, Amount: 1500000}, + {Valoper: v1, Amount: math.NewInt(1000000)}, + {Valoper: v2, Amount: math.NewInt(1500000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(2500000))), @@ -968,7 +975,7 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ChainId: suite.chainB.ChainID, Delegator: user, Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 312000000}, + {Valoper: vals[0], Amount: math.NewInt(312000000)}, }, Recipient: beneficiary, Amount: sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(312000000))), @@ -1035,7 +1042,7 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ChainId: suite.chainB.ChainID, Delegator: user, Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 312000000}, + {Valoper: vals[0], Amount: math.NewInt(312000000)}, }, Recipient: beneficiary, Amount: sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(312000000))), @@ -1053,7 +1060,7 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ChainId: suite.chainB.ChainID, Delegator: user2, Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 624000000}, + {Valoper: vals[0], Amount: math.NewInt(624000000)}, }, Recipient: beneficiary2, Amount: sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(624000000))), @@ -1134,8 +1141,8 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ChainId: suite.chainB.ChainID, Delegator: user, Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 156000000}, - {Valoper: vals[1], Amount: 156000000}, + {Valoper: vals[0], Amount: math.NewInt(156000000)}, + {Valoper: vals[1], Amount: math.NewInt(156000000)}, }, Recipient: beneficiary, Amount: sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(312000000))), @@ -1153,8 +1160,8 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ChainId: suite.chainB.ChainID, Delegator: user2, Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 312000000}, - {Valoper: vals[2], Amount: 312000000}, + {Valoper: vals[0], Amount: math.NewInt(312000000)}, + {Valoper: vals[2], Amount: math.NewInt(312000000)}, }, Recipient: beneficiary2, Amount: sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(624000000))), @@ -1169,21 +1176,21 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ) quicksilver.InterchainstakingKeeper.SetUnbondingRecord(ctx, types.UnbondingRecord{ ChainId: suite.chainB.ChainID, - EpochNumber: 1, + EpochNumber: 2, Validator: vals[0], RelatedTxhash: []string{hash, hash2}, Amount: sdk.NewCoin("uatom", math.NewInt(468000000)), }) quicksilver.InterchainstakingKeeper.SetUnbondingRecord(ctx, types.UnbondingRecord{ ChainId: suite.chainB.ChainID, - EpochNumber: 1, + EpochNumber: 2, Validator: vals[1], RelatedTxhash: []string{hash}, Amount: sdk.NewCoin("uatom", math.NewInt(156000000)), }) quicksilver.InterchainstakingKeeper.SetUnbondingRecord(ctx, types.UnbondingRecord{ ChainId: suite.chainB.ChainID, - EpochNumber: 1, + EpochNumber: 2, Validator: vals[2], RelatedTxhash: []string{hash2}, Amount: sdk.NewCoin("uatom", math.NewInt(312000000)), @@ -1200,7 +1207,7 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { &stakingtypes.MsgUndelegate{DelegatorAddress: z.DelegationAddress.Address, ValidatorAddress: vals[1], Amount: sdk.NewCoin("uatom", math.NewInt(156000000))}, &stakingtypes.MsgUndelegate{DelegatorAddress: z.DelegationAddress.Address, ValidatorAddress: vals[2], Amount: sdk.NewCoin("uatom", math.NewInt(312000000))}, }, - memo: types.EpochWithdrawalMemo(1), + memo: types.EpochWithdrawalMemo(2), success: false, }, } @@ -1251,8 +1258,8 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ChainId: suite.chainB.ChainID, Delegator: user, Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 156000000}, - {Valoper: vals[1], Amount: 156000000}, + {Valoper: vals[0], Amount: math.NewInt(156000000)}, + {Valoper: vals[1], Amount: math.NewInt(156000000)}, }, Recipient: beneficiary, Amount: sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(312000000))), @@ -1270,8 +1277,8 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ChainId: suite.chainB.ChainID, Delegator: user2, Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 312000000}, - {Valoper: vals[2], Amount: 312000000}, + {Valoper: vals[0], Amount: math.NewInt(312000000)}, + {Valoper: vals[2], Amount: math.NewInt(312000000)}, }, Recipient: beneficiary2, Amount: sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(624000000))), @@ -1337,7 +1344,7 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ChainId: suite.chainB.ChainID, Delegator: user, Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 156000000}, + {Valoper: vals[0], Amount: math.NewInt(156000000)}, }, Recipient: beneficiary, Amount: sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(156000000))), @@ -1353,7 +1360,7 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { ChainId: suite.chainB.ChainID, Delegator: user2, Distribution: []*types.Distribution{ - {Valoper: vals[0], Amount: 312000000}, + {Valoper: vals[0], Amount: math.NewInt(312000000)}, }, Recipient: beneficiary2, Amount: sdk.NewCoins(sdk.NewCoin("uatom", math.NewInt(312000000))), @@ -1409,17 +1416,18 @@ func (suite *KeeperTestSuite) TestHandleFailedUndelegate() { txs := test.txs(ctx, quicksilver) for _, tx := range txs { + ctx := suite.chainA.GetContext() packet, err := makePacketFromMsgs(quicksilver.AppCodec(), tx.msgs, tx.memo) suite.NoError(err) ack, err := makeAckForMsgs(ctx, quicksilver.AppCodec(), tx.msgs, tx.success) suite.NoError(err) bz, err := quicksilver.AppCodec().MarshalJSON(&ack) suite.NoError(err) - err = quicksilver.InterchainstakingKeeper.HandleAcknowledgement(ctx, packet, bz, suite.chainB.ChainID) suite.NoError(err) } + ctx = suite.chainA.GetContext() suite.ElementsMatch(quicksilver.InterchainstakingKeeper.AllZoneWithdrawalRecords(ctx, suite.chainB.ChainID), test.expected(ctx, quicksilver)) }) } @@ -1507,8 +1515,8 @@ func (suite *KeeperTestSuite) TestHandleFailedUnbondSend() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: v1, Amount: 1000000}, - {Valoper: v2, Amount: 1000000}, + {Valoper: v1, Amount: math.NewInt(1000000)}, + {Valoper: v2, Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(4000000))), @@ -1529,8 +1537,8 @@ func (suite *KeeperTestSuite) TestHandleFailedUnbondSend() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: v1, Amount: 1000000}, - {Valoper: v2, Amount: 1000000}, + {Valoper: v1, Amount: math.NewInt(1000000)}, + {Valoper: v2, Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(2000000))), @@ -1560,8 +1568,8 @@ func (suite *KeeperTestSuite) TestHandleFailedUnbondSend() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: v1, Amount: 1000000}, - {Valoper: v2, Amount: 1000000}, + {Valoper: v1, Amount: math.NewInt(1000000)}, + {Valoper: v2, Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(2000000))), @@ -1645,7 +1653,7 @@ func (suite *KeeperTestSuite) TestReceiveAckErrForBeginRedelegate() { EpochNumber: 1, Source: validators[0].ValoperAddress, Destination: validators[1].ValoperAddress, - Amount: 1000, + Amount: math.NewInt(1000), } quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) @@ -1773,7 +1781,7 @@ func (suite *KeeperTestSuite) TestRebalanceDueToIntentChange() { DelegatorAddress: zone.DelegationAddress.Address, ValidatorSrcAddress: record.Source, ValidatorDstAddress: record.Destination, - Amount: sdk.NewCoin("uatom", math.NewInt(record.Amount)), + Amount: sdk.NewCoin("uatom", record.Amount), } err := quicksilver.InterchainstakingKeeper.HandleBeginRedelegate(ctx, &msg, time.Now().Add(time.Hour*24*7), types.EpochRebalanceMemo(2)) if err != nil { @@ -1909,7 +1917,7 @@ func (suite *KeeperTestSuite) TestRebalanceDueToDelegationChange() { DelegatorAddress: zone.DelegationAddress.Address, ValidatorSrcAddress: record.Source, ValidatorDstAddress: record.Destination, - Amount: sdk.NewCoin("uatom", math.NewInt(record.Amount)), + Amount: sdk.NewCoin("uatom", record.Amount), } err := quicksilver.InterchainstakingKeeper.HandleBeginRedelegate(ctx, &msg, time.Now().Add(time.Hour*24*7), types.EpochRebalanceMemo(2)) if err != nil { @@ -2199,11 +2207,11 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2245,11 +2253,11 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2274,7 +2282,7 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2316,7 +2324,7 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2341,11 +2349,11 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 500, + Amount: math.NewInt(500), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2360,11 +2368,11 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 2000, + Amount: math.NewInt(2000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2379,11 +2387,11 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 600, + Amount: math.NewInt(600), }, { Valoper: vals[1], - Amount: 400, + Amount: math.NewInt(400), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2425,11 +2433,11 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 500, + Amount: math.NewInt(500), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2444,11 +2452,11 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 2000, + Amount: math.NewInt(2000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2463,11 +2471,11 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 600, + Amount: math.NewInt(600), }, { Valoper: vals[1], - Amount: 400, + Amount: math.NewInt(400), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2491,7 +2499,7 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2506,11 +2514,11 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { Distribution: []*types.Distribution{ { Valoper: vals[1], - Amount: 123, + Amount: math.NewInt(123), }, { Valoper: vals[2], - Amount: 456, + Amount: math.NewInt(456), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -2660,7 +2668,7 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginRedelegateNonNilCompletion() EpochNumber: 1, Source: validators[0].ValoperAddress, Destination: validators[1].ValoperAddress, - Amount: 1000, + Amount: math.NewInt(1000), } quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) @@ -2747,7 +2755,7 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginRedelegateNilCompletion() { EpochNumber: epoch, Source: validators[0].ValoperAddress, Destination: validators[1].ValoperAddress, - Amount: 1000, + Amount: sdk.NewInt(1000), } quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) @@ -2887,7 +2895,7 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginRedelegateNoExistingRecord() createdRecord, found := quicksilver.InterchainstakingKeeper.GetRedelegationRecord(ctx, zone.ChainId, validators[0].ValoperAddress, validators[1].ValoperAddress, epoch) suite.True(found) // redelegation record should have been removed. - suite.Equal(redelegate.Amount.Amount.Int64(), createdRecord.Amount) + suite.Equal(redelegate.Amount.Amount, createdRecord.Amount) suite.Equal(redelegate.ValidatorDstAddress, createdRecord.Destination) suite.Equal(redelegate.ValidatorSrcAddress, createdRecord.Source) suite.Equal(epoch, createdRecord.EpochNumber) @@ -3064,7 +3072,7 @@ func (suite *KeeperTestSuite) TestReceiveAckForTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3273,8 +3281,8 @@ func (suite *KeeperTestSuite) TestReceiveAckErrForBankSend() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: v1, Amount: 1000000}, - {Valoper: v2, Amount: 1000000}, + {Valoper: v1, Amount: math.NewInt(1000000)}, + {Valoper: v2, Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(2000000))), @@ -3339,11 +3347,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3365,11 +3373,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3395,11 +3403,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3421,11 +3429,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3451,11 +3459,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3477,11 +3485,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3508,7 +3516,7 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3530,7 +3538,7 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3556,11 +3564,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 500, + Amount: math.NewInt(500), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3577,11 +3585,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 2000, + Amount: math.NewInt(2000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3603,11 +3611,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 500, + Amount: math.NewInt(500), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3624,11 +3632,11 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 2000, + Amount: math.NewInt(2000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3706,11 +3714,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3744,8 +3752,8 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) return sdk.NewCoins( - sdk.NewCoin(vals[0]+"1", sdk.NewInt(1000)), - sdk.NewCoin(vals[1]+"1", sdk.NewInt(1000)), + sdk.NewCoin(vals[0]+"/1", sdk.NewInt(1000)), + sdk.NewCoin(vals[1]+"/2", sdk.NewInt(1000)), ) }, expectedWithdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone types.Zone) []types.WithdrawalRecord { @@ -3765,11 +3773,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3810,11 +3818,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3841,11 +3849,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3886,11 +3894,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3917,11 +3925,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3967,11 +3975,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -3998,11 +4006,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -4019,11 +4027,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -4070,11 +4078,11 @@ func (suite *KeeperTestSuite) TestHandleTokenizedShares() { Distribution: []*types.Distribution{ { Valoper: vals[0], - Amount: 1000, + Amount: math.NewInt(1000), }, { Valoper: vals[1], - Amount: 1000, + Amount: math.NewInt(1000), }, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), @@ -4401,8 +4409,8 @@ func (suite *KeeperTestSuite) TestHandleFailedBankSend() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: v1, Amount: 1000000}, - {Valoper: v2, Amount: 1000000}, + {Valoper: v1, Amount: math.NewInt(1000000)}, + {Valoper: v2, Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(4000000))), @@ -4429,8 +4437,8 @@ func (suite *KeeperTestSuite) TestHandleFailedBankSend() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: v1, Amount: 1000000}, - {Valoper: v2, Amount: 1000000}, + {Valoper: v1, Amount: math.NewInt(1000000)}, + {Valoper: v2, Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(2000000))), @@ -4457,8 +4465,8 @@ func (suite *KeeperTestSuite) TestHandleFailedBankSend() { ChainId: zone.ChainId, Delegator: addressutils.GenerateAccAddressForTest().String(), Distribution: []*types.Distribution{ - {Valoper: v1, Amount: 1000000}, - {Valoper: v2, Amount: 1000000}, + {Valoper: v1, Amount: math.NewInt(1000000)}, + {Valoper: v2, Amount: math.NewInt(1000000)}, }, Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.AccountPrefix), Amount: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(2000000))), diff --git a/x/interchainstaking/keeper/intent.go b/x/interchainstaking/keeper/intent.go index b503f2ff9..c96e5dbd3 100644 --- a/x/interchainstaking/keeper/intent.go +++ b/x/interchainstaking/keeper/intent.go @@ -103,7 +103,7 @@ func (k *Keeper) AggregateDelegatorIntents(ctx sdk.Context, zone *types.Zone) er // grab offchain asset value, and raise the users' base value by this amount. // currently ignoring base value (locally held assets) k.ClaimsManagerKeeper.IterateLastEpochUserClaims(ctx, zone.ChainId, delIntent.Delegator, func(index int64, data prtypes.Claim) (stop bool) { - balance.Amount = balance.Amount.Add(sdkmath.NewIntFromUint64(data.Amount)) + balance.Amount = balance.Amount.Add(data.Amount) // claim amounts are in zone.baseDenom - but given weights are all relative to one another this okay. k.Logger(ctx).Debug( "intents - found claim for user", @@ -202,7 +202,7 @@ func (k *Keeper) UpdateDelegatorIntent(ctx sdk.Context, delegator sdk.AccAddress // grab offchain asset value, and raise the users' base value by this amount. k.ClaimsManagerKeeper.IterateLastEpochUserClaims(ctx, zone.ChainId, delegator.String(), func(index int64, claim prtypes.Claim) (stop bool) { - claimAmt = claimAmt.Add(sdkmath.NewIntFromUint64(claim.Amount)) + claimAmt = claimAmt.Add(claim.Amount) k.Logger(ctx).Info("Update intents - found claim for user", "user", delIntent.Delegator, "claim amount", claim.Amount, "new balance", claimAmt) return false }) diff --git a/x/interchainstaking/keeper/keeper.go b/x/interchainstaking/keeper/keeper.go index fc85d9466..27dcbf682 100644 --- a/x/interchainstaking/keeper/keeper.go +++ b/x/interchainstaking/keeper/keeper.go @@ -797,7 +797,7 @@ func (k *Keeper) Rebalance(ctx sdk.Context, zone *types.Zone, epochNumber int64) EpochNumber: epochNumber, Source: rebalance.Source, Destination: rebalance.Target, - Amount: rebalance.Amount.Int64(), + Amount: rebalance.Amount, }) } } diff --git a/x/interchainstaking/keeper/msg_server_test.go b/x/interchainstaking/keeper/msg_server_test.go index 234308aaf..ff7fb0133 100644 --- a/x/interchainstaking/keeper/msg_server_test.go +++ b/x/interchainstaking/keeper/msg_server_test.go @@ -253,7 +253,7 @@ func (suite *KeeperTestSuite) TestRequestRedemption() { EpochNumber: 1, Source: zoneVals[0], Destination: zoneVals[1], - Amount: 3000000, + Amount: math.NewInt(3000000), CompletionTime: suite.chainA.GetContext().BlockTime().Add(time.Hour), }) }, diff --git a/x/interchainstaking/keeper/redelegation_record_test.go b/x/interchainstaking/keeper/redelegation_record_test.go index 1fb3662b4..225493d25 100644 --- a/x/interchainstaking/keeper/redelegation_record_test.go +++ b/x/interchainstaking/keeper/redelegation_record_test.go @@ -3,6 +3,8 @@ package keeper_test import ( "time" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/quicksilver-zone/quicksilver/utils/addressutils" @@ -26,7 +28,7 @@ func (suite *KeeperTestSuite) TestRedelegationRecordSetGetIterate() { EpochNumber: 1, Source: testValidatorOne, Destination: testValidatorTwo, - Amount: 3000, + Amount: sdkmath.NewInt(3000), CompletionTime: time.Now().Add(time.Hour).UTC(), } @@ -74,7 +76,7 @@ func (suite *KeeperTestSuite) TestGCCompletedRedelegations() { EpochNumber: 1, Source: testValidatorOne, Destination: testValidatorTwo, - Amount: 3000, + Amount: sdkmath.NewInt(3000), CompletionTime: currentTime.Add(time.Hour).UTC(), } quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) @@ -84,7 +86,7 @@ func (suite *KeeperTestSuite) TestGCCompletedRedelegations() { EpochNumber: 1, Source: testValidatorOne, Destination: testValidatorThree, - Amount: 3000, + Amount: sdkmath.NewInt(3000), CompletionTime: currentTime.Add(-time.Hour).UTC(), } quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) @@ -93,7 +95,7 @@ func (suite *KeeperTestSuite) TestGCCompletedRedelegations() { EpochNumber: 1, Source: testValidatorThree, Destination: testValidatorTwo, - Amount: 3000, + Amount: sdkmath.NewInt(3000), CompletionTime: time.Time{}, } quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) @@ -133,7 +135,7 @@ func (suite *KeeperTestSuite) TestDeleteRedelegationRecordByKey() { EpochNumber: 1, Source: testValidatorOne, Destination: testValidatorTwo, - Amount: 3000, + Amount: sdkmath.NewInt(3000), CompletionTime: currentTime.Add(time.Hour).UTC(), } quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) @@ -143,7 +145,7 @@ func (suite *KeeperTestSuite) TestDeleteRedelegationRecordByKey() { EpochNumber: 1, Source: testValidatorOne, Destination: testValidatorThree, - Amount: 3000, + Amount: sdkmath.NewInt(3000), CompletionTime: currentTime.Add(-time.Hour).UTC(), } quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) @@ -152,7 +154,7 @@ func (suite *KeeperTestSuite) TestDeleteRedelegationRecordByKey() { EpochNumber: 1, Source: testValidatorThree, Destination: testValidatorTwo, - Amount: 3000, + Amount: sdkmath.NewInt(3000), CompletionTime: time.Time{}, } quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) @@ -192,11 +194,11 @@ func (suite *KeeperTestSuite) TestGCCompletedUnbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, { Valoper: vals[1].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, }, Recipient: user1.String(), @@ -214,11 +216,11 @@ func (suite *KeeperTestSuite) TestGCCompletedUnbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, { Valoper: vals[1].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, }, Recipient: user2.String(), @@ -236,11 +238,11 @@ func (suite *KeeperTestSuite) TestGCCompletedUnbondings() { Distribution: []*types.Distribution{ { Valoper: vals[0].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, { Valoper: vals[1].ValoperAddress, - Amount: 500, + Amount: sdkmath.NewInt(500), }, }, Recipient: user2.String(), diff --git a/x/interchainstaking/keeper/redemptions.go b/x/interchainstaking/keeper/redemptions.go index 5b373a983..77fc2de0f 100644 --- a/x/interchainstaking/keeper/redemptions.go +++ b/x/interchainstaking/keeper/redemptions.go @@ -133,11 +133,11 @@ func (k *Keeper) GetUnlockedTokensForZone(ctx sdk.Context, zone *types.Zone) (ma for _, redelegation := range k.ZoneRedelegationRecords(ctx, zone.ChainId) { thisAvailable, found := availablePerValidator[redelegation.Destination] if found { - availablePerValidator[redelegation.Destination] = thisAvailable.Sub(sdk.NewInt(redelegation.Amount)) + availablePerValidator[redelegation.Destination] = thisAvailable.Sub(redelegation.Amount) if availablePerValidator[redelegation.Destination].LT(sdk.ZeroInt()) { return map[string]sdkmath.Int{}, sdk.ZeroInt(), fmt.Errorf("negative available amount [chain: %s, validator: %s, amount: %s]; unable to continue", zone.ChainId, redelegation.Destination, availablePerValidator[redelegation.Destination].String()) } - total = total.Sub(sdk.NewInt(redelegation.Amount)) + total = total.Sub(redelegation.Amount) } } @@ -322,21 +322,16 @@ WITHDRAWAL: for _, hash := range utils.Keys(amountToWithdrawPerWithdrawal) { for { // if amountToWithdrawPerWithdrawal has been satisified, then continue. - if amountToWithdrawPerWithdrawal[hash].Amount.IsZero() { + if amountToWithdrawPerWithdrawal[hash].IsZero() { continue WITHDRAWAL } - if !amountToWithdrawPerWithdrawal[hash].Amount.IsUint64() { - // should not happen - be defensive. - return nil, nil, nil, fmt.Errorf("aborting allocation. reason: amountToWithdrawPerWithdrawal[%s] is non uint64: %v", hash, amountToWithdrawPerWithdrawal[hash]) - } - // if current selected validator allocation for withdrawal can satisfy this withdrawal in totality... if tokensAllocatedForWithdrawalPerValidator[v].GTE(amountToWithdrawPerWithdrawal[hash].Amount) { // sub current withdrawal amount from allocation. tokensAllocatedForWithdrawalPerValidator[v] = tokensAllocatedForWithdrawalPerValidator[v].Sub(amountToWithdrawPerWithdrawal[hash].Amount) // create a distribution from this validator for the withdrawal - distributionsPerWithdrawal[hash] = append(distributionsPerWithdrawal[hash], &types.Distribution{Valoper: v, Amount: amountToWithdrawPerWithdrawal[hash].Amount.Uint64()}) + distributionsPerWithdrawal[hash] = append(distributionsPerWithdrawal[hash], &types.Distribution{Valoper: v, Amount: amountToWithdrawPerWithdrawal[hash].Amount}) // add the amount and hash to per validator records existing, found := coinsOutPerValidator[v] @@ -354,13 +349,8 @@ WITHDRAWAL: continue WITHDRAWAL } - if !amountToWithdrawPerWithdrawal[hash].Amount.IsUint64() { - // should not happen - be defensive. - return nil, nil, nil, fmt.Errorf("aborting allocation. reason: tokensAllocatedForWithdrawalPerValidator[%s] is non-uint64: %v", v, tokensAllocatedForWithdrawalPerValidator[v]) - } - // otherwise (current validator allocation cannot wholly satisfy current record), allocate entire allocation to this withdrawal. - distributionsPerWithdrawal[hash] = append(distributionsPerWithdrawal[hash], &types.Distribution{Valoper: v, Amount: tokensAllocatedForWithdrawalPerValidator[v].Uint64()}) + distributionsPerWithdrawal[hash] = append(distributionsPerWithdrawal[hash], &types.Distribution{Valoper: v, Amount: tokensAllocatedForWithdrawalPerValidator[v]}) amountToWithdrawPerWithdrawal[hash] = sdk.NewCoin(amountToWithdrawPerWithdrawal[hash].Denom, amountToWithdrawPerWithdrawal[hash].Amount.Sub(tokensAllocatedForWithdrawalPerValidator[v])) existing, found := coinsOutPerValidator[v] if !found { @@ -377,7 +367,7 @@ WITHDRAWAL: if len(valopers) > vidx+1 { vidx++ v = valopers[vidx] - } else if !amountToWithdrawPerWithdrawal[hash].Amount.IsZero() { + } else if !amountToWithdrawPerWithdrawal[hash].IsZero() { return nil, nil, nil, fmt.Errorf("unable to satisfy unbonding") } } @@ -396,11 +386,11 @@ WITHDRAWAL: for hash, tx := range _amountToWithdrawPerWithdrawal { sumIn = sumIn.Add(tx) dist := func(in []*types.Distribution) sdkmath.Int { - sum := uint64(0) + sum := sdkmath.ZeroInt() for _, dist := range in { - sum += dist.Amount + sum = sum.Add(dist.Amount) } - return sdk.NewIntFromUint64(sum) + return sum }(distributionsPerWithdrawal[hash]) if !tx.Amount.Equal(dist) { diff --git a/x/interchainstaking/keeper/redemptions_test.go b/x/interchainstaking/keeper/redemptions_test.go index 9f9339c83..30d32f187 100644 --- a/x/interchainstaking/keeper/redemptions_test.go +++ b/x/interchainstaking/keeper/redemptions_test.go @@ -110,11 +110,11 @@ func TestAllocateWithdrawalsFromValidatorsNonEmptyMaps(t *testing.T) { } for hash, dist := range distributions { - sum := uint64(0) - for _, amount := range dist { - sum += amount.Amount + sum := sdkmath.ZeroInt() + for _, distLine := range dist { + sum = sum.Add(distLine.Amount) } - require.Equal(t, _amountToWithdrawPerWithdrawal[hash].Amount, sdkmath.NewIntFromUint64(sum)) + require.Equal(t, _amountToWithdrawPerWithdrawal[hash].Amount, sum) } } @@ -134,9 +134,9 @@ func (suite *KeeperTestSuite) TestGetUnlockedTokensForZoneWithRedelegation() { quicksilver.InterchainstakingKeeper.SetDelegation(ctx, zone.ChainId, types.NewDelegation(zone.DelegationAddress.Address, vals[2].ValoperAddress, sdk.NewCoin(zone.BaseDenom, sdk.NewInt(100)))) quicksilver.InterchainstakingKeeper.SetDelegation(ctx, zone.ChainId, types.NewDelegation(zone.DelegationAddress.Address, vals[3].ValoperAddress, sdk.NewCoin(zone.BaseDenom, sdk.NewInt(100)))) - quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, types.RedelegationRecord{ChainId: zone.ChainId, EpochNumber: 1, Source: vals[0].ValoperAddress, Destination: vals[2].ValoperAddress, Amount: 5}) - quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, types.RedelegationRecord{ChainId: zone.ChainId, EpochNumber: 2, Source: vals[0].ValoperAddress, Destination: vals[2].ValoperAddress, Amount: 5}) - quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, types.RedelegationRecord{ChainId: zone.ChainId, EpochNumber: 2, Source: vals[1].ValoperAddress, Destination: vals[2].ValoperAddress, Amount: 5}) + quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, types.RedelegationRecord{ChainId: zone.ChainId, EpochNumber: 1, Source: vals[0].ValoperAddress, Destination: vals[2].ValoperAddress, Amount: sdkmath.NewInt(5)}) + quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, types.RedelegationRecord{ChainId: zone.ChainId, EpochNumber: 2, Source: vals[0].ValoperAddress, Destination: vals[2].ValoperAddress, Amount: sdkmath.NewInt(5)}) + quicksilver.InterchainstakingKeeper.SetRedelegationRecord(ctx, types.RedelegationRecord{ChainId: zone.ChainId, EpochNumber: 2, Source: vals[1].ValoperAddress, Destination: vals[2].ValoperAddress, Amount: sdkmath.NewInt(5)}) availPerVal, total, err := quicksilver.InterchainstakingKeeper.GetUnlockedTokensForZone(ctx, &zone) suite.NoError(err) diff --git a/x/interchainstaking/keeper/withdrawal_record.go b/x/interchainstaking/keeper/withdrawal_record.go index 0f6c47996..b784d2b4a 100644 --- a/x/interchainstaking/keeper/withdrawal_record.go +++ b/x/interchainstaking/keeper/withdrawal_record.go @@ -45,6 +45,7 @@ func (k *Keeper) GetNextWithdrawalRecordSequence(ctx sdk.Context) uint64 { } bz = k.cdc.MustMarshal(&gogotypes.UInt64Value{Value: sequence + 1}) + store.Set(types.KeyPrefixRequeuedWithdrawalRecordSeq, bz) return sequence @@ -170,6 +171,7 @@ func (k *Keeper) GetUserChainRequeuedWithdrawalRecord(ctx sdk.Context, chainID s k.IterateZoneStatusWithdrawalRecords(ctx, chainID, types.WithdrawStatusQueued, func(_ int64, record types.WithdrawalRecord) (stop bool) { if record.Requeued && record.Delegator == address { + fmt.Println("FOUND MATCHING RECORD") toReturn = record return true } @@ -270,7 +272,7 @@ func (k *Keeper) UpdateWithdrawalRecordsForSlash(ctx sdk.Context, zone *types.Zo if d.Valoper != valoper { continue } - distAmount := sdk.NewDec(int64(d.Amount)) + distAmount := sdk.NewDecFromInt(d.Amount) if distAmount.IsNegative() { err = fmt.Errorf("distAmount cannot be negative; suspected overflow") return true @@ -282,7 +284,7 @@ func (k *Keeper) UpdateWithdrawalRecordsForSlash(ctx sdk.Context, zone *types.Zo } thisSubAmount := distAmount.TruncateInt().Sub(newAmount) recordSubAmount = recordSubAmount.Add(thisSubAmount) - d.Amount = newAmount.Uint64() + d.Amount = newAmount k.Logger(ctx).Info("Updated withdrawal record due to slashing", "valoper", valoper, "old_amount", d.Amount, "new_amount", newAmount.String(), "sub_amount", thisSubAmount.String()) } record.Distribution = distr diff --git a/x/interchainstaking/keeper/withdrawal_record_test.go b/x/interchainstaking/keeper/withdrawal_record_test.go index 9101d7266..8008bfc1e 100644 --- a/x/interchainstaking/keeper/withdrawal_record_test.go +++ b/x/interchainstaking/keeper/withdrawal_record_test.go @@ -28,10 +28,10 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1v4gek4mld0k5yhpe0fsln4takg558cdpyexv2rxr3dh45f2fqrgsw52m97", Distribution: []*types.Distribution{ - {Amount: 10000, Valoper: validators[0]}, - {Amount: 10000, Valoper: validators[1]}, - {Amount: 10000, Valoper: validators[2]}, - {Amount: 10000, Valoper: validators[3]}, + {Amount: math.NewInt(10000), Valoper: validators[0]}, + {Amount: math.NewInt(10000), Valoper: validators[1]}, + {Amount: math.NewInt(10000), Valoper: validators[2]}, + {Amount: math.NewInt(10000), Valoper: validators[3]}, }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(40000))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(32356)), @@ -49,10 +49,10 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1v4gek4mld0k5yhpe0fsln4takg558cdpyexv2rxr3dh45f2fqrgsw52m97", Distribution: []*types.Distribution{ - {Amount: 10000, Valoper: validators[0]}, - {Amount: 9500, Valoper: validators[1]}, - {Amount: 10000, Valoper: validators[2]}, - {Amount: 10000, Valoper: validators[3]}, + {Amount: math.NewInt(10000), Valoper: validators[0]}, + {Amount: math.NewInt(9500), Valoper: validators[1]}, + {Amount: math.NewInt(10000), Valoper: validators[2]}, + {Amount: math.NewInt(10000), Valoper: validators[3]}, }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(39500))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(32356)), @@ -77,10 +77,10 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1v4gek4mld0k5yhpe0fsln4takg558cdpyexv2rxr3dh45f2fqrgsw52m97", Distribution: []*types.Distribution{ - {Amount: 10000, Valoper: validators[0]}, - {Amount: 10000, Valoper: validators[1]}, - {Amount: 10000, Valoper: validators[2]}, - {Amount: 10000, Valoper: validators[3]}, + {Amount: math.NewInt(10000), Valoper: validators[0]}, + {Amount: math.NewInt(10000), Valoper: validators[1]}, + {Amount: math.NewInt(10000), Valoper: validators[2]}, + {Amount: math.NewInt(10000), Valoper: validators[3]}, }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(40000))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(32356)), @@ -93,10 +93,10 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1nvkpj5n5mhy2ntvgn2cklntwx9ujvfvcacz5et", Distribution: []*types.Distribution{ - {Amount: 13000, Valoper: validators[0]}, - {Amount: 14000, Valoper: validators[1]}, - {Amount: 10000, Valoper: validators[2]}, - {Amount: 11000, Valoper: validators[3]}, + {Amount: math.NewInt(13000), Valoper: validators[0]}, + {Amount: math.NewInt(14000), Valoper: validators[1]}, + {Amount: math.NewInt(10000), Valoper: validators[2]}, + {Amount: math.NewInt(11000), Valoper: validators[3]}, }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(48000))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(36503)), @@ -114,10 +114,10 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1v4gek4mld0k5yhpe0fsln4takg558cdpyexv2rxr3dh45f2fqrgsw52m97", Distribution: []*types.Distribution{ - {Amount: 10000, Valoper: validators[0]}, - {Amount: 9500, Valoper: validators[1]}, - {Amount: 10000, Valoper: validators[2]}, - {Amount: 10000, Valoper: validators[3]}, + {Amount: math.NewInt(10000), Valoper: validators[0]}, + {Amount: math.NewInt(9500), Valoper: validators[1]}, + {Amount: math.NewInt(10000), Valoper: validators[2]}, + {Amount: math.NewInt(10000), Valoper: validators[3]}, }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(39500))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(32356)), @@ -129,10 +129,10 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1nvkpj5n5mhy2ntvgn2cklntwx9ujvfvcacz5et", Distribution: []*types.Distribution{ - {Amount: 13000, Valoper: validators[0]}, - {Amount: 13300, Valoper: validators[1]}, - {Amount: 10000, Valoper: validators[2]}, - {Amount: 11000, Valoper: validators[3]}, + {Amount: math.NewInt(13000), Valoper: validators[0]}, + {Amount: math.NewInt(13300), Valoper: validators[1]}, + {Amount: math.NewInt(10000), Valoper: validators[2]}, + {Amount: math.NewInt(11000), Valoper: validators[3]}, }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(47300))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(36503)), @@ -156,7 +156,7 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1v4gek4mld0k5yhpe0fsln4takg558cdpyexv2rxr3dh45f2fqrgsw52m97", Distribution: []*types.Distribution{ - {Amount: 9223372036854775807 + 1, Valoper: validators[1]}, // max int64 +1 - check for overflow + {Amount: math.NewInt(9223372036854775807).Add(math.OneInt()), Valoper: validators[1]}, // max int64 +1 - check for overflow }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(40000))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(32356)), @@ -174,7 +174,7 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1v4gek4mld0k5yhpe0fsln4takg558cdpyexv2rxr3dh45f2fqrgsw52m97", Distribution: []*types.Distribution{ - {Amount: 9223372036854775807 + 1, Valoper: validators[1]}, + {Amount: math.NewInt(9223372036854775807).Add(math.OneInt()), Valoper: validators[1]}, }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(40000))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(32356)), @@ -199,7 +199,7 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1nna7k5lywn99cd63elcfqm6p8c5c4qcug4aef5", Distribution: []*types.Distribution{ - {Amount: 100000000, Valoper: validators[1]}, // slashed amount exceeds total amount + {Amount: math.NewInt(100000000), Valoper: validators[1]}, // slashed amount exceeds total amount }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(10))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(10)), @@ -217,7 +217,7 @@ func (suite *KeeperTestSuite) TestUpdateWithdrawalRecordsForSlash() { Delegator: zone.DelegationAddress.Address, Recipient: "cosmos1nna7k5lywn99cd63elcfqm6p8c5c4qcug4aef5", Distribution: []*types.Distribution{ - {Amount: 100000000, Valoper: validators[1]}, // slashed amount exceeds total amount + {Amount: math.NewInt(100000000), Valoper: validators[1]}, // slashed amount exceeds total amount }, Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, math.NewInt(10))), BurnAmount: sdk.NewCoin(zone.LocalDenom, math.NewInt(10)), diff --git a/x/interchainstaking/keeper/zones.go b/x/interchainstaking/keeper/zones.go index 31b254674..b17514801 100644 --- a/x/interchainstaking/keeper/zones.go +++ b/x/interchainstaking/keeper/zones.go @@ -5,6 +5,8 @@ import ( "fmt" "math" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/bech32" @@ -436,11 +438,12 @@ OUTER: func (k *Keeper) CollectStatsForZone(ctx sdk.Context, zone *types.Zone) (*types.Statistics, error) { out := &types.Statistics{} out.ChainId = zone.ChainId - out.Delegated = k.GetDelegatedAmount(ctx, zone).Amount.Int64() + out.Deposited = sdkmath.ZeroInt() + out.Delegated = k.GetDelegatedAmount(ctx, zone).Amount userMap := map[string]bool{} k.IterateZoneReceipts(ctx, zone.ChainId, func(_ int64, receipt types.Receipt) bool { for _, coin := range receipt.Amount { - out.Deposited += coin.Amount.Int64() + out.Deposited = out.Deposited.Add(coin.Amount) if _, found := userMap[receipt.Sender]; !found { userMap[receipt.Sender] = true out.Depositors++ @@ -449,7 +452,7 @@ func (k *Keeper) CollectStatsForZone(ctx sdk.Context, zone *types.Zone) (*types. } return false }) - out.Supply = k.BankKeeper.GetSupply(ctx, zone.LocalDenom).Amount.Int64() + out.Supply = k.BankKeeper.GetSupply(ctx, zone.LocalDenom).Amount distance, err := k.DistanceToTarget(ctx, zone) if err != nil { return nil, err diff --git a/x/interchainstaking/keeper/zones_test.go b/x/interchainstaking/keeper/zones_test.go index 031285ba1..1b74fafe7 100644 --- a/x/interchainstaking/keeper/zones_test.go +++ b/x/interchainstaking/keeper/zones_test.go @@ -14,6 +14,8 @@ import ( dbm "github.com/tendermint/tm-db" "golang.org/x/exp/maps" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -242,7 +244,7 @@ func (suite *KeeperTestSuite) TestRemoveZoneAndAssociatedRecords() { EpochNumber: 1, Source: vals[1].ValoperAddress, Destination: vals[0].ValoperAddress, - Amount: 10000000, + Amount: math.NewInt(10000000), }) // create delegation delegation := types.Delegation{ @@ -281,11 +283,11 @@ func (suite *KeeperTestSuite) TestRemoveZoneAndAssociatedRecords() { Distribution: []*types.Distribution{ { Valoper: vals[1].ValoperAddress, - Amount: 1000000, + Amount: math.NewInt(1000000), }, { Valoper: vals[2].ValoperAddress, - Amount: 1000000, + Amount: math.NewInt(1000000), }, }, Recipient: addressutils.GenerateAccAddressForTest().String(), diff --git a/x/interchainstaking/types/interchainstaking.pb.go b/x/interchainstaking/types/interchainstaking.pb.go index 7786f5a9f..9468b07f5 100644 --- a/x/interchainstaking/types/interchainstaking.pb.go +++ b/x/interchainstaking/types/interchainstaking.pb.go @@ -446,8 +446,9 @@ func (m *ICAAccount) GetBalanceWaitgroup() uint32 { } type Distribution struct { - Valoper string `protobuf:"bytes,1,opt,name=valoper,proto3" json:"valoper,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + Valoper string `protobuf:"bytes,1,opt,name=valoper,proto3" json:"valoper,omitempty"` + XAmount uint64 `protobuf:"varint,2,opt,name=_amount,json=Amount,proto3" json:"_amount,omitempty"` // Deprecated: Do not use. + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` } func (m *Distribution) Reset() { *m = Distribution{} } @@ -490,9 +491,10 @@ func (m *Distribution) GetValoper() string { return "" } -func (m *Distribution) GetAmount() uint64 { +// Deprecated: Do not use. +func (m *Distribution) GetXAmount() uint64 { if m != nil { - return m.Amount + return m.XAmount } return 0 } @@ -692,12 +694,13 @@ func (m *UnbondingRecord) GetRelatedTxhash() []string { } type RedelegationRecord struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - EpochNumber int64 `protobuf:"varint,2,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` - Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` - Destination string `protobuf:"bytes,4,opt,name=destination,proto3" json:"destination,omitempty"` - Amount int64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` - CompletionTime time.Time `protobuf:"bytes,6,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + EpochNumber int64 `protobuf:"varint,2,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` + Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` + Destination string `protobuf:"bytes,4,opt,name=destination,proto3" json:"destination,omitempty"` + XAmount int64 `protobuf:"varint,5,opt,name=_amount,json=Amount,proto3" json:"_amount,omitempty"` // Deprecated: Do not use. + CompletionTime time.Time `protobuf:"bytes,6,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` } func (m *RedelegationRecord) Reset() { *m = RedelegationRecord{} } @@ -761,9 +764,10 @@ func (m *RedelegationRecord) GetDestination() string { return "" } -func (m *RedelegationRecord) GetAmount() int64 { +// Deprecated: Do not use. +func (m *RedelegationRecord) GetXAmount() int64 { if m != nil { - return m.Amount + return m.XAmount } return 0 } @@ -775,59 +779,6 @@ func (m *RedelegationRecord) GetCompletionTime() time.Time { return time.Time{} } -type TransferRecord struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"amount"` -} - -func (m *TransferRecord) Reset() { *m = TransferRecord{} } -func (m *TransferRecord) String() string { return proto.CompactTextString(m) } -func (*TransferRecord) ProtoMessage() {} -func (*TransferRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_0d755cfd37ef9fee, []int{8} -} -func (m *TransferRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TransferRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TransferRecord.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TransferRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransferRecord.Merge(m, src) -} -func (m *TransferRecord) XXX_Size() int { - return m.Size() -} -func (m *TransferRecord) XXX_DiscardUnknown() { - xxx_messageInfo_TransferRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_TransferRecord proto.InternalMessageInfo - -func (m *TransferRecord) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *TransferRecord) GetRecipient() string { - if m != nil { - return m.Recipient - } - return "" -} - type Validator struct { ValoperAddress string `protobuf:"bytes,1,opt,name=valoper_address,json=valoperAddress,proto3" json:"valoper_address,omitempty"` CommissionRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=commission_rate,json=commissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"commission_rate"` @@ -848,7 +799,7 @@ func (m *Validator) Reset() { *m = Validator{} } func (m *Validator) String() string { return proto.CompactTextString(m) } func (*Validator) ProtoMessage() {} func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_0d755cfd37ef9fee, []int{9} + return fileDescriptor_0d755cfd37ef9fee, []int{8} } func (m *Validator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -921,7 +872,7 @@ func (m *DelegatorIntent) Reset() { *m = DelegatorIntent{} } func (m *DelegatorIntent) String() string { return proto.CompactTextString(m) } func (*DelegatorIntent) ProtoMessage() {} func (*DelegatorIntent) Descriptor() ([]byte, []int) { - return fileDescriptor_0d755cfd37ef9fee, []int{10} + return fileDescriptor_0d755cfd37ef9fee, []int{9} } func (m *DelegatorIntent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -973,7 +924,7 @@ func (m *ValidatorIntent) Reset() { *m = ValidatorIntent{} } func (m *ValidatorIntent) String() string { return proto.CompactTextString(m) } func (*ValidatorIntent) ProtoMessage() {} func (*ValidatorIntent) Descriptor() ([]byte, []int) { - return fileDescriptor_0d755cfd37ef9fee, []int{11} + return fileDescriptor_0d755cfd37ef9fee, []int{10} } func (m *ValidatorIntent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1021,7 +972,7 @@ func (m *Delegation) Reset() { *m = Delegation{} } func (m *Delegation) String() string { return proto.CompactTextString(m) } func (*Delegation) ProtoMessage() {} func (*Delegation) Descriptor() ([]byte, []int) { - return fileDescriptor_0d755cfd37ef9fee, []int{12} + return fileDescriptor_0d755cfd37ef9fee, []int{11} } func (m *Delegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1087,7 +1038,7 @@ func (m *PortConnectionTuple) Reset() { *m = PortConnectionTuple{} } func (m *PortConnectionTuple) String() string { return proto.CompactTextString(m) } func (*PortConnectionTuple) ProtoMessage() {} func (*PortConnectionTuple) Descriptor() ([]byte, []int) { - return fileDescriptor_0d755cfd37ef9fee, []int{13} + return fileDescriptor_0d755cfd37ef9fee, []int{12} } func (m *PortConnectionTuple) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1143,7 +1094,7 @@ func (m *Receipt) Reset() { *m = Receipt{} } func (m *Receipt) String() string { return proto.CompactTextString(m) } func (*Receipt) ProtoMessage() {} func (*Receipt) Descriptor() ([]byte, []int) { - return fileDescriptor_0d755cfd37ef9fee, []int{14} + return fileDescriptor_0d755cfd37ef9fee, []int{13} } func (m *Receipt) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1223,7 +1174,6 @@ func init() { proto.RegisterType((*WithdrawalRecord)(nil), "quicksilver.interchainstaking.v1.WithdrawalRecord") proto.RegisterType((*UnbondingRecord)(nil), "quicksilver.interchainstaking.v1.UnbondingRecord") proto.RegisterType((*RedelegationRecord)(nil), "quicksilver.interchainstaking.v1.RedelegationRecord") - proto.RegisterType((*TransferRecord)(nil), "quicksilver.interchainstaking.v1.TransferRecord") proto.RegisterType((*Validator)(nil), "quicksilver.interchainstaking.v1.Validator") proto.RegisterType((*DelegatorIntent)(nil), "quicksilver.interchainstaking.v1.DelegatorIntent") proto.RegisterType((*ValidatorIntent)(nil), "quicksilver.interchainstaking.v1.ValidatorIntent") @@ -1237,136 +1187,136 @@ func init() { } var fileDescriptor_0d755cfd37ef9fee = []byte{ - // 2062 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0x5b, 0x6f, 0x1b, 0xc7, - 0x15, 0x36, 0x29, 0x89, 0x12, 0x0f, 0x29, 0x51, 0x1a, 0xc9, 0xce, 0xda, 0xb1, 0x45, 0x86, 0x4d, - 0x52, 0x16, 0xb6, 0xc8, 0xc8, 0x01, 0x5a, 0x37, 0x28, 0x8a, 0xea, 0xe2, 0x26, 0x42, 0x63, 0x55, - 0x58, 0x29, 0x0d, 0x1a, 0xa3, 0x58, 0x0c, 0x77, 0x47, 0xe4, 0xc4, 0xbb, 0x3b, 0xeb, 0x9d, 0xa1, - 0x2e, 0x7e, 0xec, 0x2f, 0xc8, 0x4f, 0x68, 0x9f, 0x0a, 0x18, 0x7d, 0x74, 0xdf, 0xfa, 0x03, 0xf2, - 0x18, 0xf8, 0xa9, 0x28, 0x0a, 0xb9, 0xb0, 0xdf, 0x04, 0xf4, 0xa5, 0xbf, 0x20, 0x98, 0xcb, 0x5e, - 0x28, 0x29, 0xa6, 0xe4, 0x28, 0x79, 0x12, 0xe7, 0x5c, 0xbe, 0x33, 0x3b, 0x73, 0xe6, 0x9c, 0x6f, - 0x46, 0x70, 0xef, 0xf1, 0x80, 0xba, 0x8f, 0x38, 0xf5, 0xf7, 0x48, 0xdc, 0xa1, 0xa1, 0x20, 0xb1, - 0xdb, 0xc7, 0x34, 0xe4, 0x02, 0x3f, 0xa2, 0x61, 0xaf, 0xb3, 0xb7, 0x7c, 0x5a, 0xd8, 0x8e, 0x62, - 0x26, 0x18, 0x6a, 0xe4, 0x3c, 0xdb, 0xa7, 0x8d, 0xf6, 0x96, 0x6f, 0x2c, 0xba, 0x8c, 0x07, 0x8c, - 0x77, 0xba, 0x98, 0x93, 0xce, 0xde, 0x72, 0x97, 0x08, 0xbc, 0xdc, 0x71, 0x19, 0x0d, 0x35, 0xc2, - 0x8d, 0xeb, 0x5a, 0xef, 0xa8, 0x51, 0x47, 0x0f, 0x8c, 0x6a, 0xa1, 0xc7, 0x7a, 0x4c, 0xcb, 0xe5, - 0x2f, 0x23, 0xad, 0xf7, 0x18, 0xeb, 0xf9, 0xa4, 0xa3, 0x46, 0xdd, 0xc1, 0x6e, 0x47, 0xd0, 0x80, - 0x70, 0x81, 0x83, 0x48, 0x1b, 0x34, 0x9f, 0xd6, 0x60, 0xfc, 0x0b, 0x16, 0x12, 0xf4, 0x13, 0x98, - 0x76, 0x59, 0x18, 0x12, 0x57, 0x50, 0x16, 0x3a, 0xd4, 0xb3, 0x0a, 0x8d, 0x42, 0xab, 0x6c, 0x57, - 0x33, 0xe1, 0x86, 0x87, 0xae, 0xc3, 0x94, 0x9a, 0xb2, 0xd4, 0x17, 0x95, 0x7e, 0x52, 0x8d, 0x37, - 0x3c, 0xf4, 0x19, 0xd4, 0x3c, 0x12, 0x31, 0x4e, 0x85, 0x83, 0x3d, 0x2f, 0x26, 0x9c, 0x5b, 0x63, - 0x8d, 0x42, 0xab, 0x72, 0xf7, 0x4e, 0x7b, 0xd4, 0x67, 0xb7, 0x37, 0xd6, 0x56, 0x56, 0x5c, 0x97, - 0x0d, 0x42, 0x61, 0xcf, 0x18, 0x90, 0x15, 0x8d, 0x81, 0x1e, 0x02, 0xda, 0xa7, 0xa2, 0xef, 0xc5, - 0x78, 0x1f, 0xfb, 0x29, 0xf2, 0xf8, 0x1b, 0x20, 0xcf, 0x65, 0x38, 0x09, 0xf8, 0x9f, 0x60, 0x3e, - 0x22, 0xf1, 0x2e, 0x8b, 0x03, 0x1c, 0xba, 0x24, 0x45, 0x9f, 0x78, 0x03, 0x74, 0x94, 0x03, 0xca, - 0xcd, 0xdd, 0x23, 0x3e, 0xe9, 0x61, 0xb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x88, 0xc5, 0x53, 0x88, 0x32, 0x99, - 0xd2, 0xf2, 0x66, 0x2a, 0xd9, 0x6b, 0x92, 0x29, 0x35, 0x95, 0x37, 0x84, 0x98, 0xf8, 0x58, 0x10, - 0xcf, 0x31, 0x6b, 0x3e, 0xde, 0x18, 0x93, 0x37, 0x04, 0x23, 0xdd, 0xd1, 0x4b, 0xff, 0x38, 0x97, - 0x73, 0x3f, 0x70, 0x26, 0x24, 0x47, 0xfb, 0x6f, 0x45, 0x40, 0x92, 0x90, 0x27, 0x77, 0x9a, 0x4b, - 0x59, 0xa6, 0x0f, 0xa0, 0xc4, 0xd9, 0x20, 0x76, 0xc9, 0xc8, 0x35, 0x32, 0x76, 0xe8, 0x23, 0xa8, - 0x78, 0x84, 0x0b, 0x1a, 0x6a, 0x2a, 0x38, 0xea, 0x9c, 0xe6, 0x8d, 0x73, 0x55, 0x6b, 0x42, 0x4d, - 0x25, 0x39, 0x5c, 0x67, 0x24, 0x6c, 0xe9, 0xcd, 0x13, 0xb6, 0xf9, 0xbf, 0x02, 0xcc, 0xec, 0xc4, - 0x38, 0xe4, 0xbb, 0x24, 0x36, 0xab, 0x24, 0xbf, 0x53, 0x93, 0x91, 0xc2, 0xc8, 0xef, 0xd4, 0xf4, - 0x64, 0xa8, 0x1a, 0x15, 0xcf, 0x5f, 0x8d, 0xb2, 0xcc, 0x18, 0xfb, 0xb1, 0x32, 0xe3, 0xa8, 0x04, - 0xe5, 0xf4, 0xce, 0x80, 0x56, 0xa0, 0x66, 0xba, 0x84, 0x73, 0xde, 0x06, 0x3b, 0x63, 0x1c, 0x56, - 0xd2, 0x3e, 0x2b, 0xf7, 0x23, 0xa0, 0x9c, 0xa7, 0x77, 0xca, 0xcb, 0x20, 0x1c, 0x33, 0x19, 0xa8, - 0xba, 0x4f, 0xf6, 0x24, 0xad, 0x34, 0x1d, 0xc5, 0xe1, 0x7d, 0x1c, 0x13, 0x7e, 0x29, 0xa4, 0xa3, - 0x96, 0xa2, 0x6e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xca, - 0x86, 0x95, 0x10, 0xef, 0x9c, 0x64, 0xc6, 0x60, 0xa4, 0x6e, 0xab, 0x0f, 0xbf, 0x7e, 0xb9, 0x58, - 0xf8, 0xe6, 0xe5, 0x62, 0xe1, 0xbf, 0x2f, 0x17, 0x0b, 0x5f, 0xbd, 0x5a, 0xbc, 0xf2, 0xcd, 0xab, - 0xc5, 0x2b, 0xff, 0x7a, 0xb5, 0x78, 0xe5, 0x8b, 0x95, 0xdc, 0x47, 0xe5, 0xaa, 0xc7, 0xd2, 0x13, - 0x16, 0x92, 0xbc, 0xa0, 0x73, 0x70, 0xc6, 0x3f, 0x5b, 0xd4, 0x37, 0x77, 0x4b, 0x6a, 0x16, 0x1f, - 0x7e, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x36, 0x6d, 0xcd, 0xc0, 0x9a, 0x19, 0x00, 0x00, + // 2057 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0x4b, 0x6f, 0x5b, 0xc7, + 0xf5, 0x37, 0x29, 0x89, 0x14, 0x0f, 0x29, 0x51, 0x1a, 0xc9, 0xce, 0xf5, 0x4b, 0x64, 0xf8, 0x4f, + 0xf2, 0x67, 0x61, 0x8b, 0x8c, 0x1c, 0xa0, 0x75, 0x83, 0xa2, 0x80, 0x28, 0xb9, 0x89, 0xd0, 0x58, + 0x15, 0xae, 0x94, 0x06, 0x8d, 0x51, 0x5c, 0x0c, 0xef, 0x1d, 0x93, 0x13, 0xdf, 0x7b, 0x87, 0xba, + 0x33, 0xd4, 0xc3, 0xcb, 0x7c, 0x82, 0xec, 0xbb, 0x69, 0xb7, 0x46, 0x97, 0xee, 0xae, 0x1f, 0x20, + 0xcb, 0xc0, 0xab, 0xa2, 0x28, 0xe4, 0xc2, 0xde, 0x69, 0xd9, 0x4f, 0x50, 0xcc, 0xe3, 0x3e, 0xf4, + 0x88, 0x29, 0xd9, 0x4c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14, 0x1d, 0x1c, 0xc8, 0x95, 0x54, 0xb9, 0x30, + 0xd9, 0xc9, 0x5b, 0x39, 0xbb, 0xb0, 0xaa, 0x24, 0x68, 0x07, 0x0a, 0x46, 0x77, 0xf9, 0x3d, 0xdc, + 0x08, 0x45, 0x66, 0x0f, 0x37, 0x42, 0x61, 0x1b, 0xac, 0xc6, 0xf3, 0x29, 0x98, 0xfb, 0x2a, 0xf9, + 0x40, 0x9b, 0xb8, 0x2c, 0x3a, 0x49, 0x6e, 0x73, 0x27, 0xc9, 0xed, 0xcf, 0xa1, 0x64, 0x18, 0x18, + 0x8b, 0x4c, 0xc2, 0xfe, 0xf8, 0x1e, 0xa7, 0xa6, 0xc8, 0x86, 0x8a, 0x97, 0x59, 0x04, 0x6b, 0x42, + 0x6d, 0x75, 0x6b, 0x74, 0x09, 0xc8, 0x2e, 0x9d, 0x7d, 0x02, 0x43, 0xce, 0x25, 0x22, 0x2e, 0x1d, + 0x50, 0x49, 0x33, 0x26, 0x47, 0xcd, 0x25, 0x31, 0x45, 0x6e, 0xb2, 0x92, 0x53, 0xe3, 0x4f, 0x38, + 0x03, 0x8d, 0x9e, 0x42, 0xb9, 0x2b, 0x2b, 0xa6, 0x89, 0xa4, 0xb9, 0xee, 0x1b, 0x22, 0xfd, 0xda, + 0x6c, 0xe7, 0xff, 0x5f, 0x30, 0xd2, 0x8b, 0xe7, 0xcb, 0x65, 0x03, 0x26, 0x87, 0x36, 0xc8, 0x68, + 0x26, 0x55, 0xae, 0x41, 0x41, 0x1c, 0x28, 0x0e, 0xa2, 0x99, 0xb0, 0x19, 0x49, 0x39, 0x17, 0x58, + 0x0c, 0xb9, 0x62, 0xbf, 0x53, 0xb6, 0x19, 0xa1, 0x87, 0x50, 0x75, 0x59, 0x30, 0xf0, 0x89, 0x62, + 0x16, 0xf2, 0x62, 0xa4, 0xe8, 0x6f, 0xf9, 0xde, 0x8d, 0x96, 0xbe, 0x35, 0xb5, 0xe2, 0x5b, 0x53, + 0x6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 0x81, 0x78, 0x53, 0xcb, 0x97, 0xfd, 0x5c, 0x5f, 0xe8, 0xf3, 0x23, + 0xfb, 0xb9, 0xbe, 0xe2, 0xa7, 0xe4, 0x72, 0xe2, 0x04, 0xb9, 0x4c, 0x59, 0xf5, 0xe4, 0x4f, 0xc7, + 0xaa, 0xd7, 0x00, 0x1e, 0xd3, 0x88, 0x0b, 0x87, 0x13, 0x12, 0x1a, 0x2a, 0x35, 0xaa, 0x4c, 0xe6, + 0x54, 0x99, 0x2c, 0x29, 0xbf, 0x6d, 0x42, 0x42, 0xd4, 0x81, 0x92, 0xe9, 0xfd, 0xc4, 0xbb, 0x20, + 0x65, 0x30, 0x18, 0x89, 0x5b, 0xe7, 0xd1, 0xf7, 0xaf, 0x96, 0x72, 0x3f, 0xbc, 0x5a, 0xca, 0xfd, + 0xfb, 0xd5, 0x52, 0xee, 0xbb, 0xd7, 0x4b, 0x57, 0x7e, 0x78, 0xbd, 0x74, 0xe5, 0x1f, 0xaf, 0x97, + 0xae, 0x7c, 0xbd, 0x9a, 0xf9, 0xa8, 0x4c, 0xf5, 0x58, 0x7e, 0xca, 0x42, 0x92, 0x15, 0xb4, 0x0f, + 0xce, 0xf9, 0x9f, 0x89, 0xfa, 0xe6, 0x6e, 0x41, 0xcd, 0xe2, 0x93, 0xff, 0x06, 0x00, 0x00, 0xff, + 0xff, 0xbf, 0xec, 0x6a, 0x13, 0x61, 0x19, 0x00, 0x00, } func (m *Zone) Marshal() (dAtA []byte, err error) { @@ -1848,8 +1798,18 @@ func (m *Distribution) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Amount != 0 { - i = encodeVarintInterchainstaking(dAtA, i, uint64(m.Amount)) + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintInterchainstaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.XAmount != 0 { + i = encodeVarintInterchainstaking(dAtA, i, uint64(m.XAmount)) i-- dAtA[i] = 0x10 } @@ -2071,6 +2031,16 @@ func (m *RedelegationRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintInterchainstaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) if err9 != nil { return 0, err9 @@ -2079,8 +2049,8 @@ func (m *RedelegationRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintInterchainstaking(dAtA, i, uint64(n9)) i-- dAtA[i] = 0x32 - if m.Amount != 0 { - i = encodeVarintInterchainstaking(dAtA, i, uint64(m.Amount)) + if m.XAmount != 0 { + i = encodeVarintInterchainstaking(dAtA, i, uint64(m.XAmount)) i-- dAtA[i] = 0x28 } @@ -2113,53 +2083,6 @@ func (m *RedelegationRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *TransferRecord) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TransferRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TransferRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Amount.Size() - i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintInterchainstaking(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Recipient) > 0 { - i -= len(m.Recipient) - copy(dAtA[i:], m.Recipient) - i = encodeVarintInterchainstaking(dAtA, i, uint64(len(m.Recipient))) - i-- - dAtA[i] = 0x12 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintInterchainstaking(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *Validator) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2200,12 +2123,12 @@ func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x52 - n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.JailedSince, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.JailedSince):]) - if err11 != nil { - return 0, err11 + n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.JailedSince, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.JailedSince):]) + if err10 != nil { + return 0, err10 } - i -= n11 - i = encodeVarintInterchainstaking(dAtA, i, uint64(n11)) + i -= n10 + i = encodeVarintInterchainstaking(dAtA, i, uint64(n10)) i-- dAtA[i] = 0x4a if m.Tombstoned { @@ -2484,22 +2407,22 @@ func (m *Receipt) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.Completed != nil { - n13, err13 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Completed, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Completed):]) - if err13 != nil { - return 0, err13 + n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Completed, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Completed):]) + if err12 != nil { + return 0, err12 } - i -= n13 - i = encodeVarintInterchainstaking(dAtA, i, uint64(n13)) + i -= n12 + i = encodeVarintInterchainstaking(dAtA, i, uint64(n12)) i-- dAtA[i] = 0x32 } if m.FirstSeen != nil { - n14, err14 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.FirstSeen, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.FirstSeen):]) - if err14 != nil { - return 0, err14 + n13, err13 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.FirstSeen, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.FirstSeen):]) + if err13 != nil { + return 0, err13 } - i -= n14 - i = encodeVarintInterchainstaking(dAtA, i, uint64(n14)) + i -= n13 + i = encodeVarintInterchainstaking(dAtA, i, uint64(n13)) i-- dAtA[i] = 0x2a } @@ -2734,9 +2657,11 @@ func (m *Distribution) Size() (n int) { if l > 0 { n += 1 + l + sovInterchainstaking(uint64(l)) } - if m.Amount != 0 { - n += 1 + sovInterchainstaking(uint64(m.Amount)) + if m.XAmount != 0 { + n += 1 + sovInterchainstaking(uint64(m.XAmount)) } + l = m.Amount.Size() + n += 1 + l + sovInterchainstaking(uint64(l)) return n } @@ -2842,28 +2767,11 @@ func (m *RedelegationRecord) Size() (n int) { if l > 0 { n += 1 + l + sovInterchainstaking(uint64(l)) } - if m.Amount != 0 { - n += 1 + sovInterchainstaking(uint64(m.Amount)) + if m.XAmount != 0 { + n += 1 + sovInterchainstaking(uint64(m.XAmount)) } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime) n += 1 + l + sovInterchainstaking(uint64(l)) - return n -} - -func (m *TransferRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovInterchainstaking(uint64(l)) - } - l = len(m.Recipient) - if l > 0 { - n += 1 + l + sovInterchainstaking(uint64(l)) - } l = m.Amount.Size() n += 1 + l + sovInterchainstaking(uint64(l)) return n @@ -4398,9 +4306,28 @@ func (m *Distribution) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field XAmount", wireType) + } + m.XAmount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInterchainstaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.XAmount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } - m.Amount = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowInterchainstaking @@ -4410,11 +4337,26 @@ func (m *Distribution) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Amount |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInterchainstaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInterchainstaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipInterchainstaking(dAtA[iNdEx:]) @@ -5170,9 +5112,9 @@ func (m *RedelegationRecord) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field XAmount", wireType) } - m.Amount = 0 + m.XAmount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowInterchainstaking @@ -5182,7 +5124,7 @@ func (m *RedelegationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Amount |= int64(b&0x7F) << shift + m.XAmount |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -5220,91 +5162,9 @@ func (m *RedelegationRecord) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipInterchainstaking(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthInterchainstaking - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TransferRecord) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowInterchainstaking - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TransferRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TransferRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowInterchainstaking - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthInterchainstaking - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthInterchainstaking - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5332,37 +5192,6 @@ func (m *TransferRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Recipient = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowInterchainstaking - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthInterchainstaking - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthInterchainstaking - } - if postIndex > l { - return io.ErrUnexpectedEOF - } if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/interchainstaking/types/messages.pb.go b/x/interchainstaking/types/messages.pb.go index d53cf6b26..189d51d48 100644 --- a/x/interchainstaking/types/messages.pb.go +++ b/x/interchainstaking/types/messages.pb.go @@ -286,7 +286,7 @@ func init() { } var fileDescriptor_ee484030fa140a82 = []byte{ - // 760 bytes of a gzipped FileDescriptorProto + // 761 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4f, 0x4f, 0x1b, 0x47, 0x18, 0xc6, 0x3d, 0xd0, 0x16, 0x18, 0x68, 0xa1, 0x0b, 0x52, 0xf1, 0x0a, 0xad, 0xe9, 0x9e, 0x50, 0x5b, 0x76, 0xb1, 0x69, 0x69, 0x6b, 0x0a, 0x12, 0x76, 0x25, 0x44, 0x55, 0x1f, 0xba, 0xdc, 0xda, @@ -319,22 +319,22 @@ var fileDescriptor_ee484030fa140a82 = []byte{ 0xf6, 0xb4, 0xa0, 0x1a, 0x9d, 0x2d, 0x77, 0xd5, 0xa9, 0x3c, 0xfe, 0xee, 0x4a, 0xee, 0x4e, 0x7f, 0x4a, 0x4f, 0x26, 0xf0, 0x68, 0x8d, 0xdb, 0xd2, 0x73, 0x84, 0xbf, 0xbd, 0x3e, 0xee, 0x6b, 0xda, 0x4d, 0x77, 0x59, 0x1b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65, 0x23, 0x46, 0xf9, 0x55, 0x2d, 0x65, + 0x43, 0x89, 0x2c, 0xea, 0x66, 0xe2, 0x11, 0x61, 0x9c, 0x20, 0x3c, 0xb3, 0xcd, 0x42, 0x03, 0x98, + 0x0f, 0xb4, 0xc3, 0xf1, 0x4b, 0xd6, 0x44, 0x7d, 0x32, 0x79, 0x63, 0x28, 0x59, 0x97, 0x64, 0x33, + 0x26, 0xf9, 0x4d, 0x5d, 0xcd, 0x78, 0x35, 0x22, 0x8f, 0x5e, 0x94, 0x67, 0x08, 0x7f, 0xbd, 0xcd, + 0xc2, 0x5d, 0x10, 0x7f, 0x73, 0xaf, 0x4a, 0x7c, 0x2e, 0x95, 0xb2, 0x06, 0xba, 0xd4, 0xc8, 0xe5, + 0xdb, 0x6b, 0xee, 0x8a, 0xa0, 0xf2, 0xdf, 0xc9, 0x99, 0x82, 0x4e, 0xcf, 0x14, 0xf4, 0xf6, 0x4c, + 0x41, 0x0f, 0xcf, 0x95, 0xdc, 0xe9, 0xb9, 0x92, 0x7b, 0x73, 0xae, 0xe4, 0xfe, 0xdd, 0xb2, 0x1d, + 0xd1, 0x6c, 0x35, 0x34, 0x93, 0x79, 0xbd, 0xde, 0xcb, 0xf7, 0x18, 0x85, 0xbe, 0x8f, 0x1d, 0x0c, + 0xf8, 0x90, 0x38, 0xf4, 0x81, 0x37, 0xbe, 0x8a, 0xff, 0x00, 0xac, 0x7e, 0x0c, 0x00, 0x00, 0xff, + 0xff, 0x6f, 0xce, 0x36, 0x50, 0xf6, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchainstaking/types/query.pb.go b/x/interchainstaking/types/query.pb.go index 927f22e05..f8ddbb4cd 100644 --- a/x/interchainstaking/types/query.pb.go +++ b/x/interchainstaking/types/query.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" @@ -33,13 +34,13 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Statistics struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Deposited int64 `protobuf:"varint,2,opt,name=deposited,proto3" json:"deposited,omitempty"` - Deposits int64 `protobuf:"varint,3,opt,name=deposits,proto3" json:"deposits,omitempty"` - Depositors int64 `protobuf:"varint,4,opt,name=depositors,proto3" json:"depositors,omitempty"` - Delegated int64 `protobuf:"varint,5,opt,name=delegated,proto3" json:"delegated,omitempty"` - Supply int64 `protobuf:"varint,6,opt,name=supply,proto3" json:"supply,omitempty"` - DistanceToTarget string `protobuf:"bytes,7,opt,name=distance_to_target,json=distanceToTarget,proto3" json:"distance_to_target,omitempty"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Deposited github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=deposited,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"deposited"` + Deposits int64 `protobuf:"varint,3,opt,name=deposits,proto3" json:"deposits,omitempty"` + Depositors int64 `protobuf:"varint,4,opt,name=depositors,proto3" json:"depositors,omitempty"` + Delegated github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=delegated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"delegated"` + Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` + DistanceToTarget string `protobuf:"bytes,7,opt,name=distance_to_target,json=distanceToTarget,proto3" json:"distance_to_target,omitempty"` // Current number of tokens in the unbonding state. UnbondingAmount types.Coin `protobuf:"bytes,8,opt,name=unbonding_amount,json=unbondingAmount,proto3" json:"unbonding_amount"` // Current number of tokens in the queued state. @@ -92,13 +93,6 @@ func (m *Statistics) GetChainId() string { return "" } -func (m *Statistics) GetDeposited() int64 { - if m != nil { - return m.Deposited - } - return 0 -} - func (m *Statistics) GetDeposits() int64 { if m != nil { return m.Deposits @@ -113,20 +107,6 @@ func (m *Statistics) GetDepositors() int64 { return 0 } -func (m *Statistics) GetDelegated() int64 { - if m != nil { - return m.Delegated - } - return 0 -} - -func (m *Statistics) GetSupply() int64 { - if m != nil { - return m.Supply - } - return 0 -} - func (m *Statistics) GetDistanceToTarget() string { if m != nil { return m.DistanceToTarget @@ -862,9 +842,9 @@ func (m *QueryDelegationsRequest) GetPagination() *query.PageRequest { } type QueryDelegationsResponse struct { - Delegations []Delegation `protobuf:"bytes,1,rep,name=delegations,proto3" json:"delegations"` - Tvl int64 `protobuf:"varint,2,opt,name=tvl,proto3" json:"tvl,omitempty"` - Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` + Delegations []Delegation `protobuf:"bytes,1,rep,name=delegations,proto3" json:"delegations"` + Tvl github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=tvl,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tvl"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } func (m *QueryDelegationsResponse) Reset() { *m = QueryDelegationsResponse{} } @@ -907,13 +887,6 @@ func (m *QueryDelegationsResponse) GetDelegations() []Delegation { return nil } -func (m *QueryDelegationsResponse) GetTvl() int64 { - if m != nil { - return m.Tvl - } - return 0 -} - func (m *QueryDelegationsResponse) GetPagination() *query.PageResponse { if m != nil { return m.Pagination @@ -1733,123 +1706,126 @@ func init() { } var fileDescriptor_c8e4d79429548821 = []byte{ - // 1844 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4d,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 0xf8, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x90, 0x5c, 0x63, - 0x4d, 0x22, 0x00, 0x00, + // 1890 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4f, 0x6c, 0x1c, 0x57, + 0x19, 0xcf, 0x5b, 0xc7, 0x7f, 0xf2, 0x6d, 0xe2, 0xac, 0x5f, 0x6c, 0xb2, 0x5e, 0xca, 0xda, 0x1d, + 0xa4, 0xc6, 0x05, 0x7b, 0x47, 0xb6, 0x2b, 0x48, 0xdd, 0x38, 0x8d, 0xd7, 0x6b, 0x07, 0xb7, 0x0d, + 0x90, 0xb1, 0x4b, 0x54, 0x07, 0x69, 0x19, 0xef, 0x3c, 0xad, 0x47, 0x5e, 0xcf, 0xac, 0x67, 0x66, + 0x5d, 0x1b, 0x2b, 0x12, 0x20, 0x71, 0xe0, 0x82, 0x40, 0x20, 0xa0, 0x5c, 0xb9, 0x20, 0xa4, 0x9e, + 0xe8, 0x85, 0x1b, 0x1c, 0x90, 0x2a, 0x04, 0x52, 0xd5, 0x72, 0x40, 0x48, 0x58, 0x90, 0xb4, 0x07, + 0x0e, 0x1c, 0xc8, 0x1d, 0x09, 0xcd, 0x9b, 0xef, 0xcd, 0xce, 0xce, 0xce, 0x7a, 0x67, 0xc7, 0x5b, + 0xb5, 0xa7, 0xec, 0xbc, 0xf7, 0xbe, 0xdf, 0xf7, 0xfd, 0x7e, 0xef, 0x7b, 0x7f, 0xbe, 0xe7, 0xc0, + 0xec, 0x41, 0x43, 0xaf, 0xec, 0xd9, 0x7a, 0xed, 0x90, 0x59, 0xb2, 0x6e, 0x38, 0xcc, 0xaa, 0xec, + 0xaa, 0xba, 0x61, 0x3b, 0xea, 0x9e, 0x6e, 0x54, 0xe5, 0xc3, 0x79, 0xf9, 0xa0, 0xc1, 0xac, 0xe3, + 0x42, 0xdd, 0x32, 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 0x63, 0x5f, 0x56, 0xa3, 0x4b, 0x47, 0xa9, + 0xc4, 0x09, 0xde, 0xa6, 0xb7, 0xba, 0x13, 0xdc, 0xe7, 0x08, 0x22, 0x63, 0x5d, 0xae, 0x22, 0x79, + 0x8b, 0x0f, 0xdf, 0x7d, 0x9c, 0x27, 0xef, 0x3d, 0xce, 0x93, 0x7f, 0x3e, 0xce, 0x93, 0x1f, 0x3d, + 0xc9, 0x5f, 0x78, 0xef, 0x49, 0xfe, 0xc2, 0xdf, 0x9e, 0xe4, 0x2f, 0x6c, 0xaf, 0x04, 0x1e, 0xd4, + 0x03, 0x1e, 0xe6, 0xf8, 0x25, 0x3e, 0xe8, 0xf2, 0x28, 0xc2, 0x29, 0x7f, 0x6f, 0xdf, 0x19, 0xe2, + 0xff, 0x3d, 0x64, 0xf1, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x43, 0xfc, 0x08, 0x14, 0x45, 0x23, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2526,16 +2502,26 @@ func (m *Statistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a } - if m.Supply != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Supply)) - i-- - dAtA[i] = 0x30 + { + size := m.Supply.Size() + i -= size + if _, err := m.Supply.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Delegated != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Delegated)) - i-- - dAtA[i] = 0x28 + i-- + dAtA[i] = 0x32 + { + size := m.Delegated.Size() + i -= size + if _, err := m.Delegated.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a if m.Depositors != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Depositors)) i-- @@ -2546,11 +2532,16 @@ func (m *Statistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } - if m.Deposited != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Deposited)) - i-- - dAtA[i] = 0x10 + { + size := m.Deposited.Size() + i -= size + if _, err := m.Deposited.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 if len(m.ChainId) > 0 { i -= len(m.ChainId) copy(dAtA[i:], m.ChainId) @@ -3147,11 +3138,16 @@ func (m *QueryDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error i-- dAtA[i] = 0x1a } - if m.Tvl != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Tvl)) - i-- - dAtA[i] = 0x10 + { + size := m.Tvl.Size() + i -= size + if _, err := m.Tvl.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 if len(m.Delegations) > 0 { for iNdEx := len(m.Delegations) - 1; iNdEx >= 0; iNdEx-- { { @@ -3847,21 +3843,18 @@ func (m *Statistics) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - if m.Deposited != 0 { - n += 1 + sovQuery(uint64(m.Deposited)) - } + l = m.Deposited.Size() + n += 1 + l + sovQuery(uint64(l)) if m.Deposits != 0 { n += 1 + sovQuery(uint64(m.Deposits)) } if m.Depositors != 0 { n += 1 + sovQuery(uint64(m.Depositors)) } - if m.Delegated != 0 { - n += 1 + sovQuery(uint64(m.Delegated)) - } - if m.Supply != 0 { - n += 1 + sovQuery(uint64(m.Supply)) - } + l = m.Delegated.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.Supply.Size() + n += 1 + l + sovQuery(uint64(l)) l = len(m.DistanceToTarget) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -4118,9 +4111,8 @@ func (m *QueryDelegationsResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } - if m.Tvl != 0 { - n += 1 + sovQuery(uint64(m.Tvl)) - } + l = m.Tvl.Size() + n += 1 + l + sovQuery(uint64(l)) if m.Pagination != nil { l = m.Pagination.Size() n += 1 + l + sovQuery(uint64(l)) @@ -4465,10 +4457,10 @@ func (m *Statistics) Unmarshal(dAtA []byte) error { m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Deposited", wireType) } - m.Deposited = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4478,11 +4470,26 @@ func (m *Statistics) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Deposited |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Deposited.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) @@ -4522,10 +4529,10 @@ func (m *Statistics) Unmarshal(dAtA []byte) error { } } case 5: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Delegated", wireType) } - m.Delegated = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4535,16 +4542,31 @@ func (m *Statistics) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Delegated |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Delegated.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 6: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) } - m.Supply = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4554,11 +4576,26 @@ func (m *Statistics) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Supply |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DistanceToTarget", wireType) @@ -6276,10 +6313,10 @@ func (m *QueryDelegationsResponse) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Tvl", wireType) } - m.Tvl = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6289,11 +6326,26 @@ func (m *QueryDelegationsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Tvl |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Tvl.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) diff --git a/x/participationrewards/keeper/keeper_test.go b/x/participationrewards/keeper/keeper_test.go index 4d234413f..5afe7dfb8 100644 --- a/x/participationrewards/keeper/keeper_test.go +++ b/x/participationrewards/keeper/keeper_test.go @@ -629,7 +629,7 @@ func (suite *KeeperTestSuite) addClaim(address, chainID string, claimType cmtype ChainId: chainID, Module: claimType, SourceChainId: sourceChainID, - Amount: amount, + Amount: math.NewIntFromUint64(amount), } suite.GetQuicksilverApp(suite.chainA).ClaimsManagerKeeper.SetClaim(suite.chainA.GetContext(), &claim) } diff --git a/x/participationrewards/keeper/msg_server_test.go b/x/participationrewards/keeper/msg_server_test.go index 3ba5b72ff..b57d63717 100644 --- a/x/participationrewards/keeper/msg_server_test.go +++ b/x/participationrewards/keeper/msg_server_test.go @@ -516,7 +516,65 @@ func (suite *KeeperTestSuite) Test_msgServer_SubmitLocalClaim() { ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, - Amount: 100, + Amount: math.NewInt(100), + }}, + }, + { + "local_callback_value_valid_denom_overflow", + func(ctx sdk.Context, appA *app.Quicksilver) { + suite.NoError(appA.BankKeeper.MintCoins(ctx, "mint", sdk.NewCoins(sdk.NewCoin("uqatom", sdk.NewInt(1000000000000000000).Mul(sdk.NewInt(1000)))))) + suite.NoError(appA.BankKeeper.SendCoinsFromModuleToAccount(ctx, "mint", address, sdk.NewCoins(sdk.NewCoin("uqatom", sdk.NewInt(1000000000000000000).Mul(sdk.NewInt(1000)))))) + + // add uqatom to the list of allowed denoms for this zone + rawPd := types.LiquidAllowedDenomProtocolData{ + ChainID: suite.chainA.ChainID, + IbcDenom: "uqatom", + QAssetDenom: "uqatom", + RegisteredZoneChainID: suite.chainB.ChainID, + } + + blob, err := json.Marshal(rawPd) + suite.NoError(err) + pd := types.NewProtocolData(types.ProtocolDataType_name[int32(types.ProtocolDataTypeLiquidToken)], blob) + + appA.ParticipationRewardsKeeper.SetProtocolData(ctx, rawPd.GenerateKey(), pd) + }, + func(ctx sdk.Context, appA *app.Quicksilver) *types.MsgSubmitClaim { + key := banktypes.CreatePrefixedAccountStoreKey(address, []byte("uqatom")) + + query := abci.RequestQuery{ + Data: key, + Path: "/store/bank/key", + Height: ctx.BlockHeight() - 2, + Prove: true, + } + + resp := appA.BaseApp.Query(query) + + return &types.MsgSubmitClaim{ + UserAddress: address.String(), + Zone: suite.chainB.ChainID, + SrcZone: suite.chainA.ChainID, + ClaimType: cmtypes.ClaimTypeLiquidToken, + Proofs: []*cmtypes.Proof{ + { + Key: resp.Key, + Data: resp.Value, + ProofOps: resp.ProofOps, + Height: resp.Height, + ProofType: "bank", + }, + }, + } + }, + &types.MsgSubmitClaimResponse{}, + "", + []cmtypes.Claim{{ + UserAddress: address.String(), + ChainId: suite.chainB.ChainID, + Module: cmtypes.ClaimTypeLiquidToken, + SourceChainId: suite.chainA.ChainID, + Amount: sdk.NewInt(1000000000000000000).Mul(sdk.NewInt(1000)), }}, }, } diff --git a/x/participationrewards/keeper/rewards_holdings.go b/x/participationrewards/keeper/rewards_holdings.go index 28e61cdcb..bcf42dafb 100644 --- a/x/participationrewards/keeper/rewards_holdings.go +++ b/x/participationrewards/keeper/rewards_holdings.go @@ -70,23 +70,22 @@ func (k Keeper) CalcUserHoldingsAllocations(ctx sdk.Context, zone *icstypes.Zone userAmountsMap := make(map[string]math.Int) k.ClaimsManagerKeeper.IterateClaims(ctx, zone.ChainId, func(_ int64, claim cmtypes.Claim) (stop bool) { - amount := math.NewIntFromUint64(claim.Amount) k.Logger(ctx).Info( "claim", "type", cmtypes.ClaimType_name[int32(claim.Module)], "user", claim.UserAddress, "zone", claim.ChainId, - "amount", amount, + "amount", claim.Amount, ) if _, exists := userAmountsMap[claim.UserAddress]; !exists { userAmountsMap[claim.UserAddress] = math.ZeroInt() } - userAmountsMap[claim.UserAddress] = userAmountsMap[claim.UserAddress].Add(amount) + userAmountsMap[claim.UserAddress] = userAmountsMap[claim.UserAddress].Add(claim.Amount) // total zone assets held remotely - zoneAmount = zoneAmount.Add(amount) + zoneAmount = zoneAmount.Add(claim.Amount) return false }) diff --git a/x/participationrewards/keeper/rewards_holdings_test.go b/x/participationrewards/keeper/rewards_holdings_test.go index cf67dc416..c7390666f 100644 --- a/x/participationrewards/keeper/rewards_holdings_test.go +++ b/x/participationrewards/keeper/rewards_holdings_test.go @@ -45,8 +45,8 @@ func (suite *KeeperTestSuite) TestCalcUserHoldingsAllocations() { zone, _ := appA.InterchainstakingKeeper.GetZone(ctx, suite.chainB.ChainID) zone.HoldingsAllocation = 64000 appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: "otherchain-1", Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: "otherchain-1", Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 1000}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: "otherchain-1", Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: "otherchain-1", Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(1000)}) }, []types.UserAllocation{}, []types.UserAllocation{}, @@ -62,8 +62,8 @@ func (suite *KeeperTestSuite) TestCalcUserHoldingsAllocations() { suite.NoError(appA.BankKeeper.MintCoins(ctx, "mint", sdk.NewCoins(sdk.NewCoin(zone.LocalDenom, sdk.NewIntFromUint64(5000))))) appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 2500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 2500}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(2500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(2500)}) }, []types.UserAllocation{ { @@ -88,8 +88,8 @@ func (suite *KeeperTestSuite) TestCalcUserHoldingsAllocations() { suite.NoError(appA.BankKeeper.MintCoins(ctx, "mint", sdk.NewCoins(sdk.NewCoin(zone.LocalDenom, sdk.NewIntFromUint64(2500))))) appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 1000}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(1000)}) }, []types.UserAllocation{ { @@ -114,8 +114,8 @@ func (suite *KeeperTestSuite) TestCalcUserHoldingsAllocations() { suite.NoError(appA.BankKeeper.MintCoins(ctx, "mint", sdk.NewCoins(sdk.NewCoin(zone.LocalDenom, sdk.NewIntFromUint64(1500))))) appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 1000}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(1000)}) }, []types.UserAllocation{ { @@ -142,8 +142,8 @@ func (suite *KeeperTestSuite) TestCalcUserHoldingsAllocations() { suite.NoError(appA.BankKeeper.MintCoins(ctx, "mint", sdk.NewCoins(sdk.NewCoin("testcoin", sdk.NewIntFromUint64(900))))) suite.NoError(appA.BankKeeper.SendCoinsFromModuleToAccount(ctx, "mint", icsAddress, sdk.NewCoins(sdk.NewCoin("testcoin", sdk.NewIntFromUint64(900))))) appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 1000}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(1000)}) }, []types.UserAllocation{ { @@ -184,8 +184,8 @@ func (suite *KeeperTestSuite) TestCalcUserHoldingsAllocations() { suite.NoError(appA.BankKeeper.SendCoinsFromModuleToAccount(ctx, "mint", icsAddress, sdk.NewCoins(sdk.NewCoin("testcoin3", sdk.NewIntFromUint64(150))))) appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 1000}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(1000)}) }, []types.UserAllocation{ { @@ -241,8 +241,8 @@ func (suite *KeeperTestSuite) TestCalcUserHoldingsAllocations() { suite.NoError(appA.BankKeeper.MintCoins(ctx, "mint", sdk.NewCoins(sdk.NewCoin("testcoin2", sdk.NewIntFromUint64(18002))))) suite.NoError(appA.BankKeeper.SendCoinsFromModuleToAccount(ctx, "mint", icsAddress, sdk.NewCoins(sdk.NewCoin("testcoin2", sdk.NewIntFromUint64(18002))))) appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 1000}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(1000)}) }, []types.UserAllocation{ { @@ -340,8 +340,8 @@ func (suite *KeeperTestSuite) TestAllocateHoldingsRewards() { zone, _ := appA.InterchainstakingKeeper.GetZone(ctx, suite.chainB.ChainID) zone.HoldingsAllocation = 64000 appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: "otherchain-1", Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: "otherchain-1", Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 1000}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: "otherchain-1", Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: "otherchain-1", Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(1000)}) }, []string{"0", "0"}, }, @@ -353,8 +353,8 @@ func (suite *KeeperTestSuite) TestAllocateHoldingsRewards() { suite.NoError(appA.BankKeeper.MintCoins(ctx, "mint", sdk.NewCoins(sdk.NewCoin(zone.LocalDenom, sdk.NewIntFromUint64(5000))))) appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 2500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 2500}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(2500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(2500)}) }, []string{"2500", "2500"}, }, @@ -366,8 +366,8 @@ func (suite *KeeperTestSuite) TestAllocateHoldingsRewards() { suite.NoError(appA.BankKeeper.MintCoins(ctx, "mint", sdk.NewCoins(sdk.NewCoin(zone.LocalDenom, sdk.NewIntFromUint64(2500))))) appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 1000}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(1000)}) }, []string{"1000", "2000"}, }, @@ -379,8 +379,8 @@ func (suite *KeeperTestSuite) TestAllocateHoldingsRewards() { suite.NoError(appA.BankKeeper.MintCoins(ctx, "mint", sdk.NewCoins(sdk.NewCoin(zone.LocalDenom, sdk.NewIntFromUint64(1500))))) appA.InterchainstakingKeeper.SetZone(ctx, &zone) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 500}) - appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: 1000}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(500)}) + appA.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user2.String(), ChainId: suite.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: suite.chainA.ChainID, Amount: math.NewInt(1000)}) }, []string{"1666", "3333"}, }, diff --git a/x/participationrewards/keeper/submodule.go b/x/participationrewards/keeper/submodule.go index 1fb0140fb..77989e894 100644 --- a/x/participationrewards/keeper/submodule.go +++ b/x/participationrewards/keeper/submodule.go @@ -1,6 +1,8 @@ package keeper import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/quicksilver-zone/quicksilver/x/participationrewards/types" @@ -10,5 +12,5 @@ import ( // regards to participation rewards claims. type Submodule interface { Hooks(ctx sdk.Context, keeper *Keeper) - ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (uint64, error) + ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (math.Int, error) } diff --git a/x/participationrewards/keeper/submodule_liquid.go b/x/participationrewards/keeper/submodule_liquid.go index 6e49c6530..a0d345f0d 100644 --- a/x/participationrewards/keeper/submodule_liquid.go +++ b/x/participationrewards/keeper/submodule_liquid.go @@ -4,6 +4,8 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/bech32" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" @@ -19,21 +21,21 @@ var _ Submodule = &LiquidTokensModule{} func (*LiquidTokensModule) Hooks(_ sdk.Context, _ *Keeper) { } -func (*LiquidTokensModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (uint64, error) { +func (*LiquidTokensModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (math.Int, error) { // message // check denom is valid vs allowed zone, ok := k.icsKeeper.GetZone(ctx, msg.Zone) if !ok { - return 0, fmt.Errorf("unable to find registered zone for chain id: %s", msg.Zone) + return sdk.ZeroInt(), fmt.Errorf("unable to find registered zone for chain id: %s", msg.Zone) } _, addr, err := bech32.DecodeAndConvert(msg.UserAddress) if err != nil { - return 0, err + return sdk.ZeroInt(), err } - amount := uint64(0) + amount := sdk.ZeroInt() for _, proof := range msg.Proofs { // determine denoms from key if proof.Data == nil { @@ -44,7 +46,7 @@ func (*LiquidTokensModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types. // or if the denom found is not valid. denom, err := utils.DenomFromRequestKey(proof.Key, addr) if err != nil { - return 0, err + return sdk.ZeroInt(), err } data, found := k.GetProtocolData(ctx, types.ProtocolDataTypeLiquidToken, fmt.Sprintf("%s_%s", msg.SrcZone, denom)) @@ -55,14 +57,14 @@ func (*LiquidTokensModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types. denomData := types.LiquidAllowedDenomProtocolData{} err = json.Unmarshal(data.Data, &denomData) if err != nil { - return 0, err + return sdk.ZeroInt(), err } if denomData.QAssetDenom == zone.LocalDenom && denomData.IbcDenom == denom { coin, err := bankkeeper.UnmarshalBalanceCompat(k.cdc, proof.Data, denomData.IbcDenom) if err != nil { - return 0, err + return sdk.ZeroInt(), err } - amount += coin.Amount.Uint64() + amount = amount.Add(coin.Amount) } } return amount, nil diff --git a/x/participationrewards/keeper/submodule_osmosis.go b/x/participationrewards/keeper/submodule_osmosis.go index 09991e802..8ff356654 100644 --- a/x/participationrewards/keeper/submodule_osmosis.go +++ b/x/participationrewards/keeper/submodule_osmosis.go @@ -8,6 +8,8 @@ import ( "strings" "time" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/bech32" "github.com/cosmos/cosmos-sdk/x/bank/keeper" @@ -71,49 +73,49 @@ func (m *OsmosisModule) Hooks(ctx sdk.Context, k *Keeper) { }) } -func (*OsmosisModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (uint64, error) { - var amount uint64 +func (*OsmosisModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (math.Int, error) { + amount := sdk.ZeroInt() var lock osmolockup.PeriodLock for _, proof := range msg.Proofs { if proof.ProofType == types.ProofTypeBank { addr, poolDenom, err := banktypes.AddressAndDenomFromBalancesStore(proof.Key[1:]) if err != nil { - return 0, err + return sdk.ZeroInt(), err } coin, err := keeper.UnmarshalBalanceCompat(k.cdc, proof.Data, poolDenom) if err != nil { - return 0, err + return sdk.ZeroInt(), err } poolID, err := strconv.Atoi(poolDenom[strings.LastIndex(poolDenom, "/")+1:]) if err != nil { - return 0, err + return sdk.ZeroInt(), err } lock = osmolockup.NewPeriodLock(uint64(poolID), addr, time.Hour, time.Time{}, sdk.NewCoins(coin)) } else { lock = osmolockup.PeriodLock{} err := k.cdc.Unmarshal(proof.Data, &lock) if err != nil { - return 0, err + return sdk.ZeroInt(), err } _, lockupOwner, err := bech32.DecodeAndConvert(lock.Owner) if err != nil { - return 0, err + return sdk.ZeroInt(), err } if sdk.AccAddress(lockupOwner).String() != msg.UserAddress { - return 0, errors.New("not a valid proof for submitting user") + return sdk.ZeroInt(), errors.New("not a valid proof for submitting user") } } sdkAmount, err := osmosistypes.DetermineApplicableTokensInPool(ctx, k, lock, msg.Zone) if err != nil { - return 0, err + return sdk.ZeroInt(), err } if sdkAmount.IsNil() || sdkAmount.IsNegative() { - return 0, errors.New("unexpected amount") + return sdk.ZeroInt(), errors.New("unexpected amount") } - amount += sdkAmount.Uint64() + amount = amount.Add(sdkAmount) } return amount, nil } diff --git a/x/participationrewards/keeper/submodule_umee.go b/x/participationrewards/keeper/submodule_umee.go index 486b7c955..42d7fad4f 100644 --- a/x/participationrewards/keeper/submodule_umee.go +++ b/x/participationrewards/keeper/submodule_umee.go @@ -4,6 +4,8 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/bech32" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -177,15 +179,15 @@ func getDenomFromProof(proof *cmtypes.Proof, addr []byte) (string, error) { return denom, err } -func (UmeeModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (uint64, error) { +func (UmeeModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (math.Int, error) { zone, ok := k.icsKeeper.GetZone(ctx, msg.Zone) if !ok { - return 0, fmt.Errorf("unable to find registered zone for chain id: %s", msg.Zone) + return sdk.ZeroInt(), fmt.Errorf("unable to find registered zone for chain id: %s", msg.Zone) } _, addr, err := bech32.DecodeAndConvert(msg.UserAddress) - amount := uint64(0) + amount := sdk.ZeroInt() for _, proof := range msg.Proofs { // determine denoms from keys if proof.Data == nil { @@ -194,7 +196,7 @@ func (UmeeModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmit udenom, err := getDenomFromProof(proof, addr) if err != nil { - return 0, err + return sdk.ZeroInt(), err } denom := leveragetypes.ToTokenDenom(udenom) @@ -207,18 +209,18 @@ func (UmeeModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmit denomData := types.LiquidAllowedDenomProtocolData{} err = json.Unmarshal(data.Data, &denomData) if err != nil { - return 0, err + return sdk.ZeroInt(), err } if denomData.QAssetDenom == zone.LocalDenom && denomData.IbcDenom == denom { uToken, err := bankkeeper.UnmarshalBalanceCompat(k.cdc, proof.Data, udenom) if err != nil { - return 0, err + return sdk.ZeroInt(), err } token, err := umee.ExchangeUToken(ctx, uToken, k) if err != nil { - return 0, err + return sdk.ZeroInt(), err } - amount += token.Amount.Uint64() + amount = amount.Add(token.Amount) } } diff --git a/x/participationrewards/types/messages.pb.go b/x/participationrewards/types/messages.pb.go index 5596f44f0..2d7a43fa4 100644 --- a/x/participationrewards/types/messages.pb.go +++ b/x/participationrewards/types/messages.pb.go @@ -122,38 +122,38 @@ func init() { var fileDescriptor_b87e3ea017f90b50 = []byte{ // 513 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xb1, 0x6f, 0xd3, 0x4e, - 0x14, 0xc7, 0xe3, 0xa4, 0xbf, 0xaa, 0xbf, 0x2b, 0xea, 0x70, 0x2a, 0xc8, 0x58, 0xc8, 0x8d, 0xd2, - 0x81, 0x08, 0x29, 0x36, 0x71, 0x16, 0xd4, 0x80, 0x04, 0xa5, 0xd0, 0xa9, 0x52, 0xe5, 0x32, 0x31, - 0x10, 0x5d, 0x9c, 0xe3, 0x38, 0x61, 0xfb, 0x1d, 0x77, 0x17, 0xd3, 0x32, 0x32, 0x31, 0x21, 0x24, - 0xfe, 0x81, 0xae, 0xec, 0x2c, 0xfc, 0x07, 0x8c, 0x15, 0x2c, 0x8c, 0x28, 0x01, 0x89, 0x3f, 0x03, - 0xf9, 0xec, 0x56, 0xb6, 0x14, 0xa1, 0x08, 0xb6, 0xbb, 0xe7, 0xfb, 0xbc, 0xf7, 0xfd, 0xbe, 0xf7, - 0x8c, 0x82, 0x17, 0x53, 0x1e, 0x3d, 0x57, 0x3c, 0xce, 0xa8, 0xf4, 0x05, 0x91, 0x9a, 0x47, 0x5c, - 0x10, 0xcd, 0x21, 0x95, 0xf4, 0x25, 0x91, 0x13, 0xe5, 0x67, 0x7d, 0x3f, 0xa1, 0x4a, 0x11, 0x46, - 0x95, 0x27, 0x24, 0x68, 0xc0, 0xdb, 0x15, 0xc6, 0x5b, 0xc4, 0x78, 0x59, 0xdf, 0xb9, 0x1a, 0x81, - 0x4a, 0x40, 0x8d, 0x0c, 0xe2, 0x17, 0x97, 0x82, 0x77, 0x36, 0x19, 0x30, 0x28, 0xe2, 0xf9, 0xa9, - 0x8c, 0x5e, 0x63, 0x00, 0x2c, 0xa6, 0x3e, 0x11, 0xdc, 0x27, 0x69, 0x0a, 0xda, 0x64, 0x3c, 0x67, - 0x6e, 0x56, 0x75, 0x46, 0x31, 0xe1, 0x89, 0x4a, 0x48, 0x4a, 0x18, 0x95, 0xb9, 0xc0, 0x5a, 0xa0, - 0x24, 0x06, 0xcb, 0x38, 0x13, 0x12, 0x04, 0x28, 0x12, 0x97, 0x65, 0x3a, 0x6f, 0x9b, 0x68, 0xe3, - 0x40, 0xb1, 0xa3, 0xe9, 0x38, 0xe1, 0xfa, 0x7e, 0x9e, 0x15, 0xdf, 0x46, 0x97, 0xa6, 0x8a, 0xca, - 0x11, 0x99, 0x4c, 0x24, 0x55, 0xca, 0xb6, 0xda, 0x56, 0xf7, 0xff, 0x5d, 0xfb, 0xcb, 0xc7, 0xde, - 0x66, 0xe9, 0xea, 0x5e, 0xf1, 0xe5, 0x48, 0x4b, 0x9e, 0xb2, 0xb0, 0xf6, 0x1a, 0x63, 0xb4, 0xf2, - 0x0a, 0x52, 0x6a, 0x37, 0x73, 0x2a, 0x34, 0x67, 0xec, 0xa0, 0x35, 0x25, 0xa3, 0x91, 0x89, 0xb7, - 0x4c, 0xfc, 0xe2, 0x8e, 0xf7, 0x11, 0x32, 0x66, 0x46, 0xfa, 0x44, 0x50, 0x7b, 0xa5, 0x6d, 0x75, - 0x37, 0x82, 0xeb, 0x5e, 0xb5, 0xe1, 0x75, 0xaf, 0x59, 0xdf, 0x33, 0x32, 0x1f, 0x9d, 0x08, 0x1a, - 0x56, 0x50, 0x3c, 0x44, 0xab, 0x42, 0x02, 0x3c, 0x55, 0xf6, 0x7f, 0xed, 0x56, 0x77, 0x3d, 0xd8, - 0xfe, 0x73, 0x92, 0xc3, 0xf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00, 0xff, 0xff, 0xe2, 0xd7, 0x14, 0x51, 0x4e, 0x04, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xc7, 0x33, 0x49, 0x2d, 0x75, 0x2a, 0x3d, 0x0c, 0x55, 0xd6, 0x20, 0xdb, 0x90, 0x1e, 0x0c, + 0x85, 0xec, 0x9a, 0xe4, 0x22, 0x89, 0x82, 0xd6, 0x6a, 0x4f, 0x85, 0xb2, 0xf5, 0xe4, 0xc1, 0x30, + 0xd9, 0x8c, 0xe3, 0xe0, 0xee, 0xbe, 0x71, 0x66, 0xb2, 0xb6, 0x1e, 0x3d, 0x79, 0x12, 0xc1, 0x2f, + 0xd0, 0xab, 0x77, 0x2f, 0x7e, 0x03, 0x8f, 0x45, 0x2f, 0x1e, 0x25, 0x51, 0xf0, 0x63, 0xc8, 0x4e, + 0xb6, 0x65, 0x17, 0x82, 0x04, 0xbd, 0xcd, 0xbc, 0x9d, 0xdf, 0x7b, 0xff, 0xff, 0x7b, 0x6f, 0x71, + 0xf7, 0xe5, 0x44, 0x84, 0x2f, 0xb4, 0x88, 0x52, 0xa6, 0x7c, 0x49, 0x95, 0x11, 0xa1, 0x90, 0xd4, + 0x08, 0x48, 0x14, 0x7b, 0x45, 0xd5, 0x58, 0xfb, 0x69, 0xc7, 0x8f, 0x99, 0xd6, 0x94, 0x33, 0xed, + 0x49, 0x05, 0x06, 0xc8, 0x76, 0x81, 0xf1, 0x16, 0x31, 0x5e, 0xda, 0xa9, 0x5f, 0x0f, 0x41, 0xc7, + 0xa0, 0x87, 0x16, 0xf1, 0xe7, 0x97, 0x39, 0x5f, 0xdf, 0xe4, 0xc0, 0x61, 0x1e, 0xcf, 0x4e, 0x79, + 0xf4, 0x06, 0x07, 0xe0, 0x11, 0xf3, 0xa9, 0x14, 0x3e, 0x4d, 0x12, 0x30, 0x36, 0xe3, 0x39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, 0x23, 0xbc, 0x5e, 0xec, 0x57, 0xcf, 0x5b, 0x62, 0x3d, 0xbc, 0x72, 0xd2, + 0xfa, 0xe0, 0x1f, 0xa0, 0x73, 0x25, 0xcd, 0xdb, 0x6f, 0xbe, 0xfd, 0xfc, 0x50, 0xed, 0x36, 0xdb, + 0x7e, 0x71, 0xe4, 0xe6, 0xd8, 0x0e, 0x78, 0xd1, 0xe0, 0xad, 0xfb, 0x3e, 0xda, 0x21, 0xbf, 0x10, + 0xbe, 0xba, 0x0f, 0x69, 0xc0, 0x62, 0x48, 0xd9, 0x61, 0xb6, 0x01, 0x21, 0x44, 0x7b, 0xd4, 0x50, + 0x72, 0x77, 0x59, 0x41, 0x0b, 0xf1, 0xfa, 0xc3, 0xff, 0xc2, 0x2f, 0x9c, 0x3d, 0xb2, 0xce, 0xee, + 0x35, 0x07, 0xcb, 0x3a, 0x53, 0x36, 0xd7, 0xfc, 0xa7, 0x0b, 0x21, 0x1a, 0x53, 0x43, 0xfb, 0x68, + 0x67, 0xf7, 0xe9, 0x97, 0xa9, 0x8b, 0xce, 0xa6, 0x2e, 0xfa, 0x31, 0x75, 0xd1, 0xfb, 0x99, 0x5b, + 0x39, 0x9b, 0xb9, 0x95, 0xef, 0x33, 0xb7, 0xf2, 0x64, 0x8f, 0x0b, 0xf3, 0x7c, 0x32, 0xf2, 0x42, + 0x88, 0x8b, 0x35, 0xda, 0xd9, 0x32, 0x96, 0x8a, 0x1e, 0x2f, 0x2e, 0x98, 0xed, 0x9a, 0x1e, 0xad, + 0xda, 0x82, 0xbd, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x88, 0xb9, 0xa5, 0xbf, 0x4e, 0x04, 0x00, 0x00, } From 02282acbc71f2a24433f38ccb18eb78854a21381 Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Fri, 22 Mar 2024 00:19:02 -0700 Subject: [PATCH 3/4] x/interchainstaking/keeper: comment about isNumericString choices (#1322) Adds a comment for future selves, about the choice of strconv.ParseInt inside isNumericString and showing that its limits won't be exceeded. Updates PR #1319 --- x/interchainstaking/keeper/ibc_packet_handlers.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/x/interchainstaking/keeper/ibc_packet_handlers.go b/x/interchainstaking/keeper/ibc_packet_handlers.go index a670eab39..e34d1ab35 100644 --- a/x/interchainstaking/keeper/ibc_packet_handlers.go +++ b/x/interchainstaking/keeper/ibc_packet_handlers.go @@ -1444,7 +1444,14 @@ func (*Keeper) prepareRewardsDistributionMsgs(zone types.Zone, rewards sdkmath.I } func isNumericString(in string) bool { - _, err := strconv.Atoi(in) + // It is okay to use strconv.ParseInt to test if a value is numeric + // because the total supply of QCK is: + // 400_000_000 (400 million) qck aka 400_000_000_000_000 uqck + // and to parse numeric values, say in the smallest unit of uqck + // MaxInt64: (1<<63)-1 = 9_223_372_036_854_775_807 uqck aka + // 9_223_372_036_854.775 (9.223 Trillion) qck + // so the function is appropriate as its range won't be exceeded. + _, err := strconv.ParseInt(in, 10, 64) return err == nil } From 02bd08df8cb6a9e2d3bda0923b14bcfb10732c14 Mon Sep 17 00:00:00 2001 From: Joe Bowman Date: Fri, 22 Mar 2024 07:28:37 +0000 Subject: [PATCH 4/4] add v1.5.3 and v1.5.3-rc3 upgrade hhandlers (#1321) * add v1.5.3 and v1.5.3-rc3 upgrade hhandlers * lint * fix setting redelegation records --- app/upgrades/types.go | 2 + app/upgrades/upgrades.go | 2 + app/upgrades/v1_5.go | 112 +++++++++++++++++++++++++++++++++++++++ app/upgrades_test.go | 67 +++++++++++++++++++++++ 4 files changed, 183 insertions(+) diff --git a/app/upgrades/types.go b/app/upgrades/types.go index cb9755fbb..fc81f9eb7 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -24,6 +24,7 @@ const ( V010407rc2UpgradeName = "v1.4.7-rc2" V010500rc0UpgradeName = "v1.5.0-rc0" V010500rc1UpgradeName = "v1.5.0-rc1" + V010503rc0UpgradeName = "v1.5.3-rc0" // mainnet upgrades V010217UpgradeName = "v1.2.17" @@ -32,6 +33,7 @@ const ( V010407UpgradeName = "v1.4.7" V010500UpgradeName = "v1.5.0" V010501UpgradeName = "v1.5.1" + V010503UpgradeName = "v1.5.3" V010600UpgradeName = "v1.6.0" ) diff --git a/app/upgrades/upgrades.go b/app/upgrades/upgrades.go index 04b29eb7f..c89109a9d 100644 --- a/app/upgrades/upgrades.go +++ b/app/upgrades/upgrades.go @@ -18,6 +18,7 @@ func Upgrades() []Upgrade { {UpgradeName: V010407rc2UpgradeName, CreateUpgradeHandler: V010407rc2UpgradeHandler}, {UpgradeName: V010500rc0UpgradeName, CreateUpgradeHandler: NoOpHandler}, {UpgradeName: V010500rc1UpgradeName, CreateUpgradeHandler: V010500rc1UpgradeHandler}, + {UpgradeName: V010503rc0UpgradeName, CreateUpgradeHandler: V010503rc0UpgradeHandler}, // v1.2: this needs to be present to support upgrade on mainnet {UpgradeName: V010217UpgradeName, CreateUpgradeHandler: NoOpHandler}, @@ -26,6 +27,7 @@ func Upgrades() []Upgrade { {UpgradeName: V010407UpgradeName, CreateUpgradeHandler: V010407UpgradeHandler}, {UpgradeName: V010500UpgradeName, CreateUpgradeHandler: V010500UpgradeHandler}, {UpgradeName: V010501UpgradeName, CreateUpgradeHandler: V010501UpgradeHandler}, + {UpgradeName: V010503UpgradeName, CreateUpgradeHandler: V010503UpgradeHandler}, {UpgradeName: V010600UpgradeName, CreateUpgradeHandler: V010600UpgradeHandler}, } } diff --git a/app/upgrades/v1_5.go b/app/upgrades/v1_5.go index 10efbd320..bb1d890bb 100644 --- a/app/upgrades/v1_5.go +++ b/app/upgrades/v1_5.go @@ -13,6 +13,7 @@ import ( "github.com/quicksilver-zone/quicksilver/app/keepers" "github.com/quicksilver-zone/quicksilver/utils" + cmtypes "github.com/quicksilver-zone/quicksilver/x/claimsmanager/types" icstypes "github.com/quicksilver-zone/quicksilver/x/interchainstaking/types" prkeeper "github.com/quicksilver-zone/quicksilver/x/participationrewards/keeper" prtypes "github.com/quicksilver-zone/quicksilver/x/participationrewards/types" @@ -51,8 +52,119 @@ func V010500rc1UpgradeHandler( } } +func V010503rc0UpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + appKeepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // update all withdrawal records' distributors to use new Amount field. + appKeepers.InterchainstakingKeeper.IterateWithdrawalRecords(ctx, func(index int64, record icstypes.WithdrawalRecord) (stop bool) { + if record.Distribution == nil { + // skip records that are queued. + return false + } + + newDist := make([]*icstypes.Distribution, 0, len(record.Distribution)) + for _, d := range record.Distribution { + d.Amount = math.NewIntFromUint64(d.XAmount) + d.XAmount = 0 + newDist = append(newDist, d) + } + record.Distribution = newDist + appKeepers.InterchainstakingKeeper.SetWithdrawalRecord(ctx, record) + + return false + }) + + // for all claims, update to use new Amount field + appKeepers.ClaimsManagerKeeper.IterateAllClaims(ctx, func(index int64, key []byte, data cmtypes.Claim) (stop bool) { + data.Amount = math.NewIntFromUint64(data.XAmount) + appKeepers.ClaimsManagerKeeper.SetClaim(ctx, &data) + return false + }) + + appKeepers.ClaimsManagerKeeper.IterateAllLastEpochClaims(ctx, func(index int64, key []byte, data cmtypes.Claim) (stop bool) { + data.Amount = math.NewIntFromUint64(data.XAmount) + appKeepers.ClaimsManagerKeeper.SetClaim(ctx, &data) + return false + }) + + // for all redelegation records, migrate + appKeepers.InterchainstakingKeeper.IterateRedelegationRecords(ctx, func(index int64, key []byte, record icstypes.RedelegationRecord) (stop bool) { + record.Amount = math.NewInt(record.XAmount) + appKeepers.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) + return false + }) + + appKeepers.InterchainstakingKeeper.SetConnectionForPort(ctx, "connection-4", "icacontroller-osmo-test-5.performance") + + return mm.RunMigrations(ctx, configurator, fromVM) + } +} + // =========== PRODUCTION UPGRADE HANDLER =========== +func V010503UpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + appKeepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // fix paid up juno records wher ack was never received. + appKeepers.InterchainstakingKeeper.IterateZoneStatusWithdrawalRecords(ctx, "juno-1", 4, func(index int64, record icstypes.WithdrawalRecord) (stop bool) { + // burn burnAmount! + if err := appKeepers.BankKeeper.BurnCoins(ctx, icstypes.EscrowModuleAccount, sdk.NewCoins(record.BurnAmount)); err != nil { + // if we can't burn the coins, fail. + panic(err) + } + appKeepers.InterchainstakingKeeper.DeleteWithdrawalRecord(ctx, record.ChainId, record.Txhash, record.Status) + return false + }) + + // update all withdrawal records' distributors to use new Amount field. + appKeepers.InterchainstakingKeeper.IterateWithdrawalRecords(ctx, func(index int64, record icstypes.WithdrawalRecord) (stop bool) { + if record.Distribution == nil { + // skip records that are queued. + return false + } + + newDist := make([]*icstypes.Distribution, 0, len(record.Distribution)) + for _, d := range record.Distribution { + d.Amount = math.NewIntFromUint64(d.XAmount) + d.XAmount = 0 + newDist = append(newDist, d) + } + record.Distribution = newDist + appKeepers.InterchainstakingKeeper.SetWithdrawalRecord(ctx, record) + + return false + }) + + // for all claims, update to use new Amount field + appKeepers.ClaimsManagerKeeper.IterateAllClaims(ctx, func(index int64, key []byte, data cmtypes.Claim) (stop bool) { + data.Amount = math.NewIntFromUint64(data.XAmount) + appKeepers.ClaimsManagerKeeper.SetClaim(ctx, &data) + return false + }) + + appKeepers.ClaimsManagerKeeper.IterateAllLastEpochClaims(ctx, func(index int64, key []byte, data cmtypes.Claim) (stop bool) { + data.Amount = math.NewIntFromUint64(data.XAmount) + appKeepers.ClaimsManagerKeeper.SetLastEpochClaim(ctx, &data) + return false + }) + + // for all redelegation records, migrate + appKeepers.InterchainstakingKeeper.IterateRedelegationRecords(ctx, func(index int64, key []byte, record icstypes.RedelegationRecord) (stop bool) { + record.Amount = math.NewInt(record.XAmount) + appKeepers.InterchainstakingKeeper.SetRedelegationRecord(ctx, record) + return false + }) + + return mm.RunMigrations(ctx, configurator, fromVM) + } +} + func V010501UpgradeHandler( mm *module.Manager, configurator module.Configurator, diff --git a/app/upgrades_test.go b/app/upgrades_test.go index 2609ae59b..f7d0dd5f4 100644 --- a/app/upgrades_test.go +++ b/app/upgrades_test.go @@ -21,6 +21,7 @@ import ( "github.com/quicksilver-zone/quicksilver/app/upgrades" "github.com/quicksilver-zone/quicksilver/utils/addressutils" + cmtypes "github.com/quicksilver-zone/quicksilver/x/claimsmanager/types" icstypes "github.com/quicksilver-zone/quicksilver/x/interchainstaking/types" prtypes "github.com/quicksilver-zone/quicksilver/x/participationrewards/types" ) @@ -744,3 +745,69 @@ func (s *AppTestSuite) TestV010501UpgradeHandler() { s.Equal("cosmoshub-4", lpd.RegisteredZoneChainID) s.Equal("uqatom", lpd.QAssetDenom) } + +func (s *AppTestSuite) TestV010503UpgradeHandler() { + s.InitV150TestZones() + app := s.GetQuicksilverApp(s.chainA) + ctx := s.chainA.GetContext() + + user1 := addressutils.GenerateAddressForTestWithPrefix("quick") + recipient1 := addressutils.GenerateAddressForTestWithPrefix("cosmos") + val1 := addressutils.GenerateAddressForTestWithPrefix("cosmovaloper") + val2 := addressutils.GenerateAddressForTestWithPrefix("cosmovaloper") + + wdr1 := icstypes.WithdrawalRecord{ + ChainId: s.chainB.ChainID, + BurnAmount: sdk.NewInt64Coin("uqatom", 300), + Distribution: []*icstypes.Distribution{ + {Valoper: val1, XAmount: 110}, + {Valoper: val2, XAmount: 220}, + }, + Amount: sdk.NewCoins(sdk.NewInt64Coin("uatom", 330)), + Txhash: fmt.Sprintf("%064d", 1), + Status: icstypes.WithdrawStatusUnbond, + Delegator: user1, + Recipient: recipient1, + EpochNumber: 2, + CompletionTime: ctx.BlockTime().Add(3 * 24 * time.Hour), + Acknowledged: true, + } + + wdr2 := icstypes.WithdrawalRecord{ + ChainId: s.chainB.ChainID, + BurnAmount: sdk.NewInt64Coin("uqatom", 300), + Distribution: nil, + Txhash: fmt.Sprintf("%064d", 1), + Status: icstypes.WithdrawStatusQueued, + Delegator: user1, + Recipient: recipient1, + EpochNumber: 2, + } + + app.InterchainstakingKeeper.SetWithdrawalRecord(ctx, wdr1) + app.InterchainstakingKeeper.SetWithdrawalRecord(ctx, wdr2) + + app.ClaimsManagerKeeper.SetClaim(ctx, &cmtypes.Claim{UserAddress: user1, ChainId: s.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: "osmosis-1", XAmount: 3000}) + app.ClaimsManagerKeeper.SetLastEpochClaim(ctx, &cmtypes.Claim{UserAddress: user1, ChainId: s.chainB.ChainID, Module: cmtypes.ClaimTypeLiquidToken, SourceChainId: "osmosis-1", XAmount: 2900}) + + handler := upgrades.V010503UpgradeHandler(app.mm, + app.configurator, &app.AppKeepers) + + _, err := handler(ctx, types.Plan{}, app.mm.GetVersionMap()) + s.NoError(err) + + wdr2actual, found := app.InterchainstakingKeeper.GetWithdrawalRecord(ctx, wdr2.ChainId, wdr2.Txhash, wdr2.Status) + s.True(found) + s.Equal(wdr2actual, wdr2) + + wdr1actual, found := app.InterchainstakingKeeper.GetWithdrawalRecord(ctx, wdr1.ChainId, wdr1.Txhash, wdr1.Status) + s.True(found) + s.Contains(wdr1actual.Distribution, &icstypes.Distribution{Valoper: val1, Amount: sdk.NewInt(110)}) + s.Contains(wdr1actual.Distribution, &icstypes.Distribution{Valoper: val2, Amount: sdk.NewInt(220)}) + + claims := app.ClaimsManagerKeeper.AllZoneUserClaims(ctx, s.chainB.ChainID, user1) + s.Equal(claims[0].Amount, math.NewInt(3000)) + + leclaims := app.ClaimsManagerKeeper.AllZoneLastEpochUserClaims(ctx, s.chainB.ChainID, user1) + s.Equal(leclaims[0].Amount, math.NewInt(2900)) +}