From f1d95f623f1bb17d1c20e9c5be206f89440f2914 Mon Sep 17 00:00:00 2001 From: mbreithecker Date: Wed, 12 Jun 2024 09:39:59 +0200 Subject: [PATCH 1/3] chore: align event naming --- proto/kyve/bundles/v1beta1/events.proto | 45 +- proto/kyve/delegation/v1beta1/events.proto | 10 +- proto/kyve/funders/v1beta1/events.proto | 20 +- proto/kyve/stakers/v1beta1/events.proto | 10 +- x/bundles/keeper/logic_bundles.go | 12 +- x/bundles/spec/06_events.md | 24 +- x/bundles/types/events.pb.go | 466 +++++++++--------- x/delegation/keeper/logic_delegation.go | 2 +- x/delegation/spec/05_events.md | 2 +- x/delegation/types/events.pb.go | 125 ++--- x/funders/keeper/logic_funders.go | 2 +- x/funders/keeper/msg_server_defund_pool.go | 2 +- x/funders/keeper/msg_server_fund_pool.go | 4 +- x/funders/spec/05_events.md | 18 +- x/funders/types/events.pb.go | 203 +++----- .../msg_server_claim_commission_rewards.go | 4 +- x/stakers/spec/05_events.md | 6 +- x/stakers/types/events.pb.go | 131 +++-- 18 files changed, 464 insertions(+), 622 deletions(-) diff --git a/proto/kyve/bundles/v1beta1/events.proto b/proto/kyve/bundles/v1beta1/events.proto index 4c3b203a..57d61c47 100644 --- a/proto/kyve/bundles/v1beta1/events.proto +++ b/proto/kyve/bundles/v1beta1/events.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package kyve.bundles.v1beta1; -import "amino/amino.proto"; -import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "kyve/bundles/v1beta1/bundles.proto"; import "kyve/bundles/v1beta1/params.proto"; @@ -90,38 +88,18 @@ message EventBundleFinalized { // status of the finalized bundle BundleStatus status = 7; // amount which funders provided to the total bundle reward - repeated cosmos.base.v1beta1.Coin funders_payout = 8 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string funders_payout = 8; // amount which the inflation pool provided to the total reward (in ukyve) uint64 inflation_payout = 9; // rewards transferred to treasury - repeated cosmos.base.v1beta1.Coin reward_treasury = 10 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // reward_uploader_commission are the commission rewards of the uploader. - // if the uploader has no delegations the delegation rewards are included here - repeated cosmos.base.v1beta1.Coin reward_uploader_commission = 11 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string reward_treasury = 10; + // reward_uploader are the total rewards (commission + storage cost) + // the uploader received + string reward_uploader = 11; // rewardDelegation rewards distributed among all delegators - repeated cosmos.base.v1beta1.Coin reward_delegation = 12 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string reward_delegation = 12; // rewardTotal the total bundle reward - repeated cosmos.base.v1beta1.Coin reward_total = 13 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string reward_total = 13; // finalized_at the block height where the bundle got finalized uint64 finalized_at = 14; // uploader the address of the uploader of this bundle @@ -129,11 +107,10 @@ message EventBundleFinalized { // next_uploader the address of the next uploader after this bundle string next_uploader = 16; // reward_uploader_storage_cost are the storage cost rewards for the uploader - repeated cosmos.base.v1beta1.Coin reward_uploader_storage_cost = 17 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string reward_uploader_storage_cost = 17; + // reward_uploader_commission are the commission rewards of the uploader. + // if the uploader has no delegations the delegation rewards are included here + string reward_uploader_commission = 18; } // EventClaimedUploaderRole is an event emitted when an uploader claims the uploader role diff --git a/proto/kyve/delegation/v1beta1/events.proto b/proto/kyve/delegation/v1beta1/events.proto index 5177398b..009db0ab 100644 --- a/proto/kyve/delegation/v1beta1/events.proto +++ b/proto/kyve/delegation/v1beta1/events.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package kyve.delegation.v1beta1; -import "amino/amino.proto"; -import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "kyve/delegation/v1beta1/delegation.proto"; import "kyve/delegation/v1beta1/params.proto"; @@ -79,12 +77,8 @@ message EventWithdrawRewards { string address = 1; // staker is the account address of the protocol node the users withdraws from. string staker = 2; - // amount ... - repeated cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + // amounts ... + string amounts = 3; } // EventSlash is an event emitted when a protocol node is slashed. diff --git a/proto/kyve/funders/v1beta1/events.proto b/proto/kyve/funders/v1beta1/events.proto index b467a0b6..8ab1bae8 100644 --- a/proto/kyve/funders/v1beta1/events.proto +++ b/proto/kyve/funders/v1beta1/events.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package kyve.funders.v1beta1; -import "amino/amino.proto"; -import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "kyve/funders/v1beta1/params.proto"; @@ -62,17 +60,9 @@ message EventFundPool { // address is the account address of the pool funder. string address = 2; // amounts is a list of coins the funder has funded - repeated cosmos.base.v1beta1.Coin amounts = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string amounts = 3; // amounts_per_bundle is a list of coins the funder wants to distribute per finalized bundle - repeated cosmos.base.v1beta1.Coin amounts_per_bundle = 4 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string amounts_per_bundle = 4; } // EventDefundPool is an event emitted when a pool is defunded. @@ -83,11 +73,7 @@ message EventDefundPool { // address is the account address of the pool funder. string address = 2; // amounts is a list of coins that the funder wants to defund - repeated cosmos.base.v1beta1.Coin amounts = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string amounts = 3; } // EventPoolOutOfFunds is an event emitted when a pool has run out of funds diff --git a/proto/kyve/stakers/v1beta1/events.proto b/proto/kyve/stakers/v1beta1/events.proto index 8b362363..7da2bbd8 100644 --- a/proto/kyve/stakers/v1beta1/events.proto +++ b/proto/kyve/stakers/v1beta1/events.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package kyve.stakers.v1beta1; -import "amino/amino.proto"; -import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "kyve/stakers/v1beta1/params.proto"; @@ -68,12 +66,8 @@ message EventUpdateCommission { message EventClaimCommissionRewards { // staker is the account address of the protocol node. string staker = 1; - // amount is the amount of the commission rewards claimed - repeated cosmos.base.v1beta1.Coin amount = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + // amounts is the amount of the commission rewards claimed + string amounts = 2; } // EventJoinPool ... diff --git a/x/bundles/keeper/logic_bundles.go b/x/bundles/keeper/logic_bundles.go index 11a4e06e..a2852a8c 100644 --- a/x/bundles/keeper/logic_bundles.go +++ b/x/bundles/keeper/logic_bundles.go @@ -419,13 +419,13 @@ func (k Keeper) finalizeCurrentBundleProposal(ctx sdk.Context, poolId uint64, vo Abstain: voteDistribution.Abstain, Total: voteDistribution.Total, Status: voteDistribution.Status, - FundersPayout: fundersPayout, + FundersPayout: fundersPayout.String(), InflationPayout: inflationPayout, - RewardTreasury: bundleReward.Treasury, - RewardUploaderCommission: bundleReward.UploaderCommission, - RewardUploaderStorageCost: bundleReward.UploaderStorageCost, - RewardDelegation: bundleReward.Delegation, - RewardTotal: bundleReward.Total, + RewardTreasury: bundleReward.Treasury.String(), + RewardUploaderCommission: bundleReward.UploaderCommission.String(), + RewardUploaderStorageCost: bundleReward.UploaderStorageCost.String(), + RewardDelegation: bundleReward.Delegation.String(), + RewardTotal: bundleReward.Total.String(), FinalizedAt: uint64(ctx.BlockTime().Unix()), Uploader: bundleProposal.Uploader, NextUploader: nextUploader, diff --git a/x/bundles/spec/06_events.md b/x/bundles/spec/06_events.md index fbf6b526..4b88eace 100644 --- a/x/bundles/spec/06_events.md +++ b/x/bundles/spec/06_events.md @@ -94,24 +94,30 @@ message EventBundleFinalized { uint64 total = 6; // status of the finalized bundle BundleStatus status = 7; - // amount which funders provided to the total bundle reward (in ukyve) - uint64 funders_payout = 8; + // amount which funders provided to the total bundle reward + string funders_payout = 8; // amount which the inflation pool provided to the total reward (in ukyve) uint64 inflation_payout = 9; - // rewards transferred to treasury (in ukyve) - uint64 reward_treasury = 10; - // rewardUploader rewards directly transferred to uploader (in ukyve) - uint64 reward_uploader = 11; - // rewardDelegation rewards distributed among all delegators (in ukyve) - uint64 reward_delegation = 12; + // rewards transferred to treasury + string reward_treasury = 10; + // reward_uploader are the total rewards (commission + storage cost) + // the uploader received + string reward_uploader = 11; + // rewardDelegation rewards distributed among all delegators + string reward_delegation = 12; // rewardTotal the total bundle reward - uint64 reward_total = 13; + string reward_total = 13; // finalized_at the block height where the bundle got finalized uint64 finalized_at = 14; // uploader the address of the uploader of this bundle string uploader = 15; // next_uploader the address of the next uploader after this bundle string next_uploader = 16; + // reward_uploader_storage_cost are the storage cost rewards for the uploader + string reward_uploader_storage_cost = 17; + // reward_uploader_commission are the commission rewards of the uploader. + // if the uploader has no delegations the delegation rewards are included here + string reward_uploader_commission = 18; } ``` diff --git a/x/bundles/types/events.pb.go b/x/bundles/types/events.pb.go index 9d4c693e..1838758b 100644 --- a/x/bundles/types/events.pb.go +++ b/x/bundles/types/events.pb.go @@ -5,9 +5,6 @@ package types import ( fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -351,18 +348,18 @@ type EventBundleFinalized struct { // status of the finalized bundle Status BundleStatus `protobuf:"varint,7,opt,name=status,proto3,enum=kyve.bundles.v1beta1.BundleStatus" json:"status,omitempty"` // amount which funders provided to the total bundle reward - FundersPayout github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=funders_payout,json=fundersPayout,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funders_payout"` + FundersPayout string `protobuf:"bytes,8,opt,name=funders_payout,json=fundersPayout,proto3" json:"funders_payout,omitempty"` // amount which the inflation pool provided to the total reward (in ukyve) InflationPayout uint64 `protobuf:"varint,9,opt,name=inflation_payout,json=inflationPayout,proto3" json:"inflation_payout,omitempty"` // rewards transferred to treasury - RewardTreasury github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,10,rep,name=reward_treasury,json=rewardTreasury,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"reward_treasury"` - // reward_uploader_commission are the commission rewards of the uploader. - // if the uploader has no delegations the delegation rewards are included here - RewardUploaderCommission github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,11,rep,name=reward_uploader_commission,json=rewardUploaderCommission,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"reward_uploader_commission"` + RewardTreasury string `protobuf:"bytes,10,opt,name=reward_treasury,json=rewardTreasury,proto3" json:"reward_treasury,omitempty"` + // reward_uploader are the total rewards (commission + storage cost) + // the uploader received + RewardUploader string `protobuf:"bytes,11,opt,name=reward_uploader,json=rewardUploader,proto3" json:"reward_uploader,omitempty"` // rewardDelegation rewards distributed among all delegators - RewardDelegation github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,12,rep,name=reward_delegation,json=rewardDelegation,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"reward_delegation"` + RewardDelegation string `protobuf:"bytes,12,opt,name=reward_delegation,json=rewardDelegation,proto3" json:"reward_delegation,omitempty"` // rewardTotal the total bundle reward - RewardTotal github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,13,rep,name=reward_total,json=rewardTotal,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"reward_total"` + RewardTotal string `protobuf:"bytes,13,opt,name=reward_total,json=rewardTotal,proto3" json:"reward_total,omitempty"` // finalized_at the block height where the bundle got finalized FinalizedAt uint64 `protobuf:"varint,14,opt,name=finalized_at,json=finalizedAt,proto3" json:"finalized_at,omitempty"` // uploader the address of the uploader of this bundle @@ -370,7 +367,10 @@ type EventBundleFinalized struct { // next_uploader the address of the next uploader after this bundle NextUploader string `protobuf:"bytes,16,opt,name=next_uploader,json=nextUploader,proto3" json:"next_uploader,omitempty"` // reward_uploader_storage_cost are the storage cost rewards for the uploader - RewardUploaderStorageCost github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,17,rep,name=reward_uploader_storage_cost,json=rewardUploaderStorageCost,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"reward_uploader_storage_cost"` + RewardUploaderStorageCost string `protobuf:"bytes,17,opt,name=reward_uploader_storage_cost,json=rewardUploaderStorageCost,proto3" json:"reward_uploader_storage_cost,omitempty"` + // reward_uploader_commission are the commission rewards of the uploader. + // if the uploader has no delegations the delegation rewards are included here + RewardUploaderCommission string `protobuf:"bytes,18,opt,name=reward_uploader_commission,json=rewardUploaderCommission,proto3" json:"reward_uploader_commission,omitempty"` } func (m *EventBundleFinalized) Reset() { *m = EventBundleFinalized{} } @@ -455,11 +455,11 @@ func (m *EventBundleFinalized) GetStatus() BundleStatus { return BUNDLE_STATUS_UNSPECIFIED } -func (m *EventBundleFinalized) GetFundersPayout() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventBundleFinalized) GetFundersPayout() string { if m != nil { return m.FundersPayout } - return nil + return "" } func (m *EventBundleFinalized) GetInflationPayout() uint64 { @@ -469,32 +469,32 @@ func (m *EventBundleFinalized) GetInflationPayout() uint64 { return 0 } -func (m *EventBundleFinalized) GetRewardTreasury() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventBundleFinalized) GetRewardTreasury() string { if m != nil { return m.RewardTreasury } - return nil + return "" } -func (m *EventBundleFinalized) GetRewardUploaderCommission() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventBundleFinalized) GetRewardUploader() string { if m != nil { - return m.RewardUploaderCommission + return m.RewardUploader } - return nil + return "" } -func (m *EventBundleFinalized) GetRewardDelegation() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventBundleFinalized) GetRewardDelegation() string { if m != nil { return m.RewardDelegation } - return nil + return "" } -func (m *EventBundleFinalized) GetRewardTotal() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventBundleFinalized) GetRewardTotal() string { if m != nil { return m.RewardTotal } - return nil + return "" } func (m *EventBundleFinalized) GetFinalizedAt() uint64 { @@ -518,11 +518,18 @@ func (m *EventBundleFinalized) GetNextUploader() string { return "" } -func (m *EventBundleFinalized) GetRewardUploaderStorageCost() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventBundleFinalized) GetRewardUploaderStorageCost() string { if m != nil { return m.RewardUploaderStorageCost } - return nil + return "" +} + +func (m *EventBundleFinalized) GetRewardUploaderCommission() string { + if m != nil { + return m.RewardUploaderCommission + } + return "" } // EventClaimedUploaderRole is an event emitted when an uploader claims the uploader role @@ -800,72 +807,66 @@ func init() { func init() { proto.RegisterFile("kyve/bundles/v1beta1/events.proto", fileDescriptor_a02f505e55d81e92) } var fileDescriptor_a02f505e55d81e92 = []byte{ - // 1034 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x26, 0x4e, 0x62, 0x8f, 0xff, 0xc4, 0xde, 0x06, 0xd8, 0x84, 0xd6, 0x71, 0x8c, 0x90, - 0xcc, 0x3f, 0xaf, 0x6a, 0xc4, 0x85, 0x5b, 0x62, 0x5a, 0x61, 0x55, 0x42, 0xd6, 0xa6, 0xad, 0x04, - 0x17, 0x6b, 0xec, 0x19, 0xdb, 0x23, 0xef, 0xce, 0xac, 0x66, 0x66, 0xed, 0x38, 0x12, 0x5f, 0x01, - 0x81, 0x10, 0xdf, 0x01, 0x71, 0x42, 0xe2, 0x2b, 0x70, 0xe8, 0xb1, 0x47, 0x4e, 0x80, 0x92, 0x03, - 0x1f, 0x81, 0x2b, 0x9a, 0x3f, 0xbb, 0x4d, 0x83, 0x0b, 0x6d, 0x25, 0x5f, 0x12, 0xbf, 0xdf, 0x7b, - 0xf3, 0x7e, 0xbf, 0x99, 0xf7, 0xe6, 0xcd, 0x82, 0xe3, 0xd9, 0x72, 0x8e, 0xfd, 0x61, 0x42, 0x51, - 0x88, 0x85, 0x3f, 0xbf, 0x3b, 0xc4, 0x12, 0xde, 0xf5, 0xf1, 0x1c, 0x53, 0x29, 0xda, 0x31, 0x67, - 0x92, 0xb9, 0xfb, 0x2a, 0xa4, 0x6d, 0x43, 0xda, 0x36, 0xe4, 0xb0, 0x06, 0x23, 0x42, 0x99, 0xaf, - 0xff, 0x9a, 0xc0, 0xc3, 0xfa, 0x88, 0x89, 0x88, 0x09, 0x7f, 0x08, 0x05, 0xce, 0x52, 0x8d, 0x18, - 0xa1, 0xd6, 0xbf, 0x3f, 0x61, 0x13, 0xa6, 0x7f, 0xfa, 0xea, 0x97, 0x45, 0x9b, 0x2b, 0x15, 0xa4, - 0x74, 0x26, 0x66, 0xb5, 0xca, 0x18, 0x72, 0x18, 0xa5, 0x21, 0x77, 0x56, 0x86, 0xc8, 0x73, 0xe3, - 0x6e, 0xfe, 0xe2, 0x80, 0xda, 0x3d, 0xb5, 0xab, 0x47, 0x31, 0x82, 0x12, 0xf7, 0xf5, 0x52, 0x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38, 0xc7, 0x54, 0x0e, 0x62, 0x95, 0x4a, 0xd8, - 0x31, 0x5c, 0xb6, 0xa8, 0xce, 0x2f, 0x9a, 0x5d, 0x50, 0x7d, 0x46, 0x27, 0x02, 0x2c, 0xb0, 0x7c, - 0x65, 0xae, 0xd3, 0xfb, 0x4f, 0x2e, 0xeb, 0xce, 0xd3, 0xcb, 0xba, 0xf3, 0xe7, 0x65, 0xdd, 0xf9, - 0xf6, 0xaa, 0xbe, 0xf1, 0xf4, 0xaa, 0xbe, 0xf1, 0xdb, 0x55, 0x7d, 0xe3, 0xab, 0x0f, 0xaf, 0x75, - 0xc5, 0x83, 0x2f, 0x1f, 0xdf, 0xfb, 0x02, 0xcb, 0x05, 0xe3, 0x33, 0x7f, 0x34, 0x85, 0x84, 0xfa, - 0xe7, 0xd9, 0x37, 0x99, 0xee, 0x8f, 0xe1, 0x8e, 0xfe, 0x1e, 0xfb, 0xf8, 0x9f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x78, 0x95, 0x78, 0xb1, 0x79, 0x0a, 0x00, 0x00, + // 942 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x5f, 0x6f, 0x1b, 0x45, + 0x10, 0xcf, 0xa5, 0x8e, 0x93, 0x5b, 0xff, 0x89, 0x7d, 0x0d, 0x70, 0x0d, 0xad, 0x9b, 0x18, 0x21, + 0x82, 0x8a, 0x6c, 0x35, 0xbc, 0x21, 0x24, 0x94, 0x84, 0x56, 0x58, 0x95, 0x90, 0x75, 0x69, 0x2b, + 0xc1, 0xcb, 0x69, 0xed, 0x5d, 0xdb, 0x2b, 0xdf, 0xdd, 0x9e, 0x76, 0xf7, 0xec, 0x38, 0x9f, 0x02, + 0x09, 0xf1, 0x45, 0xe0, 0x2b, 0xf0, 0xd0, 0xc7, 0x3e, 0xf2, 0x84, 0x50, 0xf2, 0x45, 0xd0, 0xce, + 0xee, 0x5d, 0x1c, 0xe3, 0x42, 0xc3, 0xdb, 0xcd, 0x6f, 0x7e, 0x33, 0xf3, 0xdb, 0x99, 0xd9, 0x3d, + 0x74, 0x38, 0x5d, 0xcc, 0x68, 0x77, 0x90, 0x25, 0x24, 0xa2, 0xb2, 0x3b, 0x7b, 0x3a, 0xa0, 0x0a, + 0x3f, 0xed, 0xd2, 0x19, 0x4d, 0x94, 0xec, 0xa4, 0x82, 0x2b, 0xee, 0xed, 0x69, 0x4a, 0xc7, 0x52, + 0x3a, 0x96, 0xb2, 0xbf, 0x37, 0xe6, 0x63, 0x0e, 0x84, 0xae, 0xfe, 0x32, 0xdc, 0xfd, 0xf6, 0xda, + 0x74, 0x79, 0xac, 0xe1, 0xac, 0x2f, 0x99, 0x62, 0x81, 0xe3, 0x9c, 0xf2, 0x68, 0x2d, 0x45, 0x5d, + 0x18, 0x77, 0xfb, 0x37, 0x07, 0x35, 0x9f, 0x69, 0x89, 0xaf, 0x52, 0x82, 0x15, 0xed, 0x43, 0xa8, + 0x77, 0x82, 0x10, 0x8f, 0x48, 0x68, 0x12, 0xf9, 0xce, 0x81, 0x73, 0x54, 0x39, 0x7e, 0xd8, 0x59, + 0x27, 0xbe, 0x63, 0x22, 0x4e, 0x4b, 0x6f, 0xfe, 0x7c, 0xbc, 0x11, 0xb8, 0x3c, 0x22, 0x37, 0x29, + 0x12, 0x3a, 0xcf, 0x53, 0x6c, 0xbe, 0x7f, 0x8a, 0x84, 0xce, 0x6d, 0x0a, 0x1f, 0x6d, 0xa7, 0x78, + 0x11, 0x71, 0x4c, 0xfc, 0x7b, 0x07, 0xce, 0x91, 0x1b, 0xe4, 0x66, 0xfb, 0x17, 0x07, 0xed, 0x82, + 0xea, 0x53, 0x48, 0xf5, 0x9a, 0x2b, 0xea, 0x7d, 0x84, 0xb6, 0x53, 0xce, 0xa3, 0x90, 0x11, 0x10, + 0x5c, 0x0a, 0xca, 0xda, 0xec, 0x11, 0xef, 0x43, 0x54, 0x96, 0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0x55, 0x55, 0xa5, 0x7f, 0xaa, + 0x8a, 0xed, 0xc3, 0xdb, 0xe7, 0x2c, 0x51, 0xbd, 0x64, 0xa8, 0x37, 0xee, 0xdf, 0x2e, 0xec, 0xbb, + 0x7e, 0x0a, 0xfa, 0x85, 0xc8, 0x84, 0xa0, 0x89, 0x0a, 0x53, 0x9d, 0x4a, 0xda, 0x1b, 0x5c, 0xb3, + 0x28, 0xe4, 0x97, 0xed, 0x33, 0xd4, 0xb8, 0x29, 0x27, 0x03, 0x2a, 0xa9, 0xba, 0x73, 0xad, 0xd3, + 0xe7, 0x6f, 0xae, 0x5a, 0xce, 0xdb, 0xab, 0x96, 0xf3, 0xd7, 0x55, 0xcb, 0xf9, 0xe9, 0xba, 0xb5, + 0xf1, 0xf6, 0xba, 0xb5, 0xf1, 0xc7, 0x75, 0x6b, 0xe3, 0xc7, 0x2f, 0xc6, 0x4c, 0x4d, 0xb2, 0x41, + 0x67, 0xc8, 0xe3, 0xee, 0x8b, 0x1f, 0x5e, 0x3f, 0xfb, 0x9e, 0xaa, 0x39, 0x17, 0xd3, 0xee, 0x70, + 0x82, 0x59, 0xd2, 0xbd, 0x28, 0x7e, 0xe7, 0x6a, 0x91, 0x52, 0x39, 0x28, 0xc3, 0xaf, 0xfc, 0xcb, + 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xbf, 0xd8, 0x77, 0xc7, 0x81, 0x08, 0x00, 0x00, } func (m *EventUpdateParams) Marshal() (dAtA []byte, err error) { @@ -1090,21 +1091,23 @@ func (m *EventBundleFinalized) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.RewardUploaderCommission) > 0 { + i -= len(m.RewardUploaderCommission) + copy(dAtA[i:], m.RewardUploaderCommission) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardUploaderCommission))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } if len(m.RewardUploaderStorageCost) > 0 { - for iNdEx := len(m.RewardUploaderStorageCost) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RewardUploaderStorageCost[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } + i -= len(m.RewardUploaderStorageCost) + copy(dAtA[i:], m.RewardUploaderStorageCost) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardUploaderStorageCost))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a } if len(m.NextUploader) > 0 { i -= len(m.NextUploader) @@ -1128,60 +1131,32 @@ func (m *EventBundleFinalized) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x70 } if len(m.RewardTotal) > 0 { - for iNdEx := len(m.RewardTotal) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RewardTotal[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } + i -= len(m.RewardTotal) + copy(dAtA[i:], m.RewardTotal) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardTotal))) + i-- + dAtA[i] = 0x6a } if len(m.RewardDelegation) > 0 { - for iNdEx := len(m.RewardDelegation) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RewardDelegation[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } + i -= len(m.RewardDelegation) + copy(dAtA[i:], m.RewardDelegation) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardDelegation))) + i-- + dAtA[i] = 0x62 } - if len(m.RewardUploaderCommission) > 0 { - for iNdEx := len(m.RewardUploaderCommission) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RewardUploaderCommission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } + if len(m.RewardUploader) > 0 { + i -= len(m.RewardUploader) + copy(dAtA[i:], m.RewardUploader) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardUploader))) + i-- + dAtA[i] = 0x5a } if len(m.RewardTreasury) > 0 { - for iNdEx := len(m.RewardTreasury) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RewardTreasury[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } + i -= len(m.RewardTreasury) + copy(dAtA[i:], m.RewardTreasury) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardTreasury))) + i-- + dAtA[i] = 0x52 } if m.InflationPayout != 0 { i = encodeVarintEvents(dAtA, i, uint64(m.InflationPayout)) @@ -1189,18 +1164,11 @@ func (m *EventBundleFinalized) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x48 } if len(m.FundersPayout) > 0 { - for iNdEx := len(m.FundersPayout) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.FundersPayout[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } + i -= len(m.FundersPayout) + copy(dAtA[i:], m.FundersPayout) + i = encodeVarintEvents(dAtA, i, uint64(len(m.FundersPayout))) + i-- + dAtA[i] = 0x42 } if m.Status != 0 { i = encodeVarintEvents(dAtA, i, uint64(m.Status)) @@ -1537,38 +1505,28 @@ func (m *EventBundleFinalized) Size() (n int) { if m.Status != 0 { n += 1 + sovEvents(uint64(m.Status)) } - if len(m.FundersPayout) > 0 { - for _, e := range m.FundersPayout { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.FundersPayout) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } if m.InflationPayout != 0 { n += 1 + sovEvents(uint64(m.InflationPayout)) } - if len(m.RewardTreasury) > 0 { - for _, e := range m.RewardTreasury { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.RewardTreasury) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } - if len(m.RewardUploaderCommission) > 0 { - for _, e := range m.RewardUploaderCommission { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.RewardUploader) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } - if len(m.RewardDelegation) > 0 { - for _, e := range m.RewardDelegation { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.RewardDelegation) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } - if len(m.RewardTotal) > 0 { - for _, e := range m.RewardTotal { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.RewardTotal) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } if m.FinalizedAt != 0 { n += 1 + sovEvents(uint64(m.FinalizedAt)) @@ -1581,11 +1539,13 @@ func (m *EventBundleFinalized) Size() (n int) { if l > 0 { n += 2 + l + sovEvents(uint64(l)) } - if len(m.RewardUploaderStorageCost) > 0 { - for _, e := range m.RewardUploaderStorageCost { - l = e.Size() - n += 2 + l + sovEvents(uint64(l)) - } + l = len(m.RewardUploaderStorageCost) + if l > 0 { + n += 2 + l + sovEvents(uint64(l)) + } + l = len(m.RewardUploaderCommission) + if l > 0 { + n += 2 + l + sovEvents(uint64(l)) } return n } @@ -2533,7 +2493,7 @@ func (m *EventBundleFinalized) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FundersPayout", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -2543,25 +2503,23 @@ func (m *EventBundleFinalized) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.FundersPayout = append(m.FundersPayout, types.Coin{}) - if err := m.FundersPayout[len(m.FundersPayout)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.FundersPayout = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 0 { @@ -2586,7 +2544,7 @@ func (m *EventBundleFinalized) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RewardTreasury", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -2596,31 +2554,29 @@ func (m *EventBundleFinalized) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardTreasury = append(m.RewardTreasury, types.Coin{}) - if err := m.RewardTreasury[len(m.RewardTreasury)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RewardTreasury = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardUploaderCommission", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardUploader", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -2630,31 +2586,29 @@ func (m *EventBundleFinalized) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardUploaderCommission = append(m.RewardUploaderCommission, types.Coin{}) - if err := m.RewardUploaderCommission[len(m.RewardUploaderCommission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RewardUploader = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RewardDelegation", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -2664,31 +2618,29 @@ func (m *EventBundleFinalized) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardDelegation = append(m.RewardDelegation, types.Coin{}) - if err := m.RewardDelegation[len(m.RewardDelegation)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RewardDelegation = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RewardTotal", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -2698,25 +2650,23 @@ func (m *EventBundleFinalized) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardTotal = append(m.RewardTotal, types.Coin{}) - if err := m.RewardTotal[len(m.RewardTotal)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RewardTotal = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 14: if wireType != 0 { @@ -2805,7 +2755,7 @@ func (m *EventBundleFinalized) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RewardUploaderStorageCost", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -2815,25 +2765,55 @@ func (m *EventBundleFinalized) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardUploaderStorageCost = append(m.RewardUploaderStorageCost, types.Coin{}) - if err := m.RewardUploaderStorageCost[len(m.RewardUploaderStorageCost)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.RewardUploaderStorageCost = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardUploaderCommission", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.RewardUploaderCommission = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/delegation/keeper/logic_delegation.go b/x/delegation/keeper/logic_delegation.go index 5b99fda4..4a30d33e 100644 --- a/x/delegation/keeper/logic_delegation.go +++ b/x/delegation/keeper/logic_delegation.go @@ -73,7 +73,7 @@ func (k Keeper) performWithdrawal(ctx sdk.Context, stakerAddress, delegatorAddre _ = ctx.EventManager().EmitTypedEvent(&types.EventWithdrawRewards{ Address: delegatorAddress, Staker: stakerAddress, - Amount: reward, + Amounts: reward.String(), }) return reward, nil diff --git a/x/delegation/spec/05_events.md b/x/delegation/spec/05_events.md index ac819ad1..cb9b96b1 100644 --- a/x/delegation/spec/05_events.md +++ b/x/delegation/spec/05_events.md @@ -72,4 +72,4 @@ message EventStartUndelegation { |------------------------|---------------|--------------------| | `EventWithdrawRewards` | address | {delegatorAddress} | | `EventWithdrawRewards` | staker | {stakerAddress} | -| `EventWithdrawRewards` | amount | {amount} | +| `EventWithdrawRewards` | amounts | {amounts} | diff --git a/x/delegation/types/events.pb.go b/x/delegation/types/events.pb.go index 0d74c7fe..7758d15d 100644 --- a/x/delegation/types/events.pb.go +++ b/x/delegation/types/events.pb.go @@ -5,9 +5,6 @@ package types import ( fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -377,8 +374,8 @@ type EventWithdrawRewards struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // staker is the account address of the protocol node the users withdraws from. Staker string `protobuf:"bytes,2,opt,name=staker,proto3" json:"staker,omitempty"` - // amount ... - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + // amounts ... + Amounts string `protobuf:"bytes,3,opt,name=amounts,proto3" json:"amounts,omitempty"` } func (m *EventWithdrawRewards) Reset() { *m = EventWithdrawRewards{} } @@ -428,11 +425,11 @@ func (m *EventWithdrawRewards) GetStaker() string { return "" } -func (m *EventWithdrawRewards) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventWithdrawRewards) GetAmounts() string { if m != nil { - return m.Amount + return m.Amounts } - return nil + return "" } // EventSlash is an event emitted when a protocol node is slashed. @@ -524,43 +521,38 @@ func init() { } var fileDescriptor_d01988a9108a2e89 = []byte{ - // 571 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xc1, 0x6b, 0x13, 0x4f, - 0x14, 0xce, 0xfc, 0x1a, 0xd2, 0xdf, 0x4e, 0x50, 0x69, 0x28, 0x6d, 0xda, 0xc2, 0xa6, 0x04, 0x0f, - 0x41, 0x70, 0x87, 0x46, 0xbc, 0x0a, 0xc6, 0xf4, 0x50, 0x04, 0x91, 0x8d, 0x55, 0xaa, 0x87, 0x65, - 0x92, 0x19, 0x93, 0x25, 0xbb, 0xfb, 0x96, 0x9d, 0x49, 0xd6, 0x1c, 0xfd, 0x0f, 0x3c, 0x7a, 0xf6, - 0x24, 0x9e, 0xc4, 0x9b, 0xff, 0x41, 0x8f, 0x3d, 0x7a, 0x52, 0x49, 0x0e, 0xfe, 0x1b, 0x32, 0x33, - 0xbb, 0xc9, 0x56, 0x08, 0x58, 0xe9, 0x25, 0x99, 0x37, 0xef, 0xdb, 0xef, 0xfb, 0xde, 0xcc, 0x7b, - 0x83, 0x6f, 0x8f, 0x67, 0x53, 0x4e, 0x18, 0x0f, 0xf8, 0x90, 0x4a, 0x1f, 0x22, 0x32, 0x3d, 0xea, - 0x73, 0x49, 0x8f, 0x08, 0x9f, 0xf2, 0x48, 0x0a, 0x27, 0x4e, 0x40, 0x42, 0x6d, 0x57, 0xa1, 0x9c, - 0x15, 0xca, 0xc9, 0x50, 0xfb, 0x5b, 0x34, 0xf4, 0x23, 0x20, 0xfa, 0xd7, 0x60, 0xf7, 0xed, 0x01, - 0x88, 0x10, 0x04, 0xe9, 0x53, 0xc1, 0x97, 0x6c, 0x03, 0xf0, 0xa3, 0x2c, 0xbf, 0x3d, 0x84, 0x21, - 0xe8, 0x25, 0x51, 0xab, 0x6c, 0xb7, 0xb5, 0xce, 0x47, 0x41, 0xd4, 0x20, 0xd7, 0x3a, 0x8e, 0x69, - 0x42, 0xc3, 0xcc, 0x71, 0xf3, 0x2b, 0xc2, 0x5b, 0xc7, 0xaa, 0x84, 0xd3, 0x98, 0x51, 0xc9, 0x9f, - 0xea, 0x5c, 0xad, 0x8b, 0x31, 0x04, 0xcc, 0x33, 0xc8, 0x3a, 0x3a, 0x44, 0xad, 0x6a, 0xbb, 0xe1, - 0xac, 0x29, 0xce, 0x31, 0x1f, 0x75, 0xca, 0xe7, 0xdf, 0x1b, 0x25, 0xd7, 0x82, 0x80, 0xad, 0x58, - 0x22, 0x9e, 0xe6, 0x2c, 0xff, 0x5d, 0x89, 0x25, 0xe2, 0x69, 0xc6, 0x52, 0xc7, 0x9b, 0x31, 0x9d, - 0x05, 0x40, 0x59, 0x7d, 0xe3, 0x10, 0xb5, 0x2c, 0x37, 0x0f, 0x9b, 0x67, 0xf8, 0x86, 0xb6, 0xde, - 0x35, 0x64, 0x5c, 0x41, 0x29, 0x63, 0x09, 0x17, 0xc6, 0xb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4, 0x07, - 0xe2, 0xe3, 0xaf, 0xcf, 0x77, 0xd0, 0xd2, 0xf4, 0x7b, 0x84, 0xb1, 0x69, 0x9d, 0x80, 0x8a, 0x51, - 0x6d, 0x17, 0x6f, 0xc6, 0x00, 0x81, 0xe7, 0x33, 0x6d, 0xb5, 0xec, 0x56, 0x54, 0x78, 0xc2, 0xae, - 0xdc, 0x2d, 0x0f, 0x31, 0x16, 0x8a, 0xd1, 0x53, 0xca, 0xfa, 0xa0, 0x6e, 0xb6, 0x9b, 0x6b, 0xa7, - 0x49, 0x8b, 0x3f, 0x9b, 0xc5, 0xdc, 0xb5, 0x44, 0xbe, 0xec, 0x9c, 0x9c, 0xcf, 0x6d, 0x74, 0x31, - 0xb7, 0xd1, 0xcf, 0xb9, 0x8d, 0xde, 0x2d, 0xec, 0xd2, 0xc5, 0xc2, 0x2e, 0x7d, 0x5b, 0xd8, 0xa5, - 0x97, 0xa4, 0x50, 0xeb, 0xe3, 0xb3, 0xe7, 0xc7, 0x4f, 0xb8, 0x4c, 0x21, 0x19, 0x93, 0xc1, 0x88, - 0xfa, 0x11, 0x79, 0x53, 0x7c, 0x46, 0x74, 0xe1, 0xfd, 0x8a, 0x7e, 0x3e, 0xee, 0xfd, 0x0e, 0x00, - 0x00, 0xff, 0xff, 0x28, 0x77, 0xcc, 0xf2, 0x18, 0x05, 0x00, 0x00, + // 496 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x41, 0x6f, 0xd3, 0x3e, + 0x18, 0xc6, 0xeb, 0xff, 0x3f, 0xea, 0xc8, 0x3b, 0x01, 0x22, 0x9a, 0xb6, 0xb2, 0x49, 0xe9, 0x14, + 0x71, 0xe8, 0x29, 0xd1, 0xc6, 0x1d, 0x89, 0xa9, 0x3b, 0x4c, 0x48, 0x08, 0xa5, 0x0c, 0x34, 0x38, + 0x44, 0xee, 0xfc, 0xd2, 0x46, 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, 0x89, 0xb1, 0x2b, 0x9b, 0xe5, 0xc9, 0xd9, 0xd5, 0xc2, 0x27, 0xd7, 0x0b, 0x9f, 0xfc, + 0x5c, 0xf8, 0xe4, 0xf3, 0xd2, 0x6f, 0x5d, 0x2f, 0xfd, 0xd6, 0xf7, 0xa5, 0xdf, 0x7a, 0x17, 0x8d, + 0x52, 0x35, 0x9e, 0x0e, 0xc3, 0x4b, 0x9e, 0x47, 0x2f, 0x2e, 0xde, 0x9c, 0xbe, 0x44, 0x55, 0x71, + 0x31, 0x89, 0x2e, 0xc7, 0x34, 0x2d, 0xa2, 0x8f, 0xeb, 0xaf, 0x5e, 0xdb, 0xcb, 0x61, 0xdb, 0xbc, + 0xf6, 0xa7, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xe5, 0x56, 0xd8, 0x94, 0x04, 0x00, 0x00, } func (m *EventUpdateParams) Marshal() (dAtA []byte, err error) { @@ -813,19 +805,12 @@ func (m *EventWithdrawRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } + if len(m.Amounts) > 0 { + i -= len(m.Amounts) + copy(dAtA[i:], m.Amounts) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Amounts))) + i-- + dAtA[i] = 0x1a } if len(m.Staker) > 0 { i -= len(m.Staker) @@ -1018,11 +1003,9 @@ func (m *EventWithdrawRewards) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.Amounts) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } return n } @@ -1881,9 +1864,9 @@ func (m *EventWithdrawRewards) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amounts", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -1893,25 +1876,23 @@ func (m *EventWithdrawRewards) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Amounts = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/funders/keeper/logic_funders.go b/x/funders/keeper/logic_funders.go index 81278854..7b1f245a 100644 --- a/x/funders/keeper/logic_funders.go +++ b/x/funders/keeper/logic_funders.go @@ -231,7 +231,7 @@ func (k Keeper) ensureFreeSlot(ctx sdk.Context, newFunding *types.Funding, fundi _ = ctx.EventManager().EmitTypedEvent(&types.EventDefundPool{ PoolId: fundingState.PoolId, Address: lowestFunding.FunderAddress, - Amounts: lowestFunding.Amounts, + Amounts: lowestFunding.Amounts.String(), }) return nil diff --git a/x/funders/keeper/msg_server_defund_pool.go b/x/funders/keeper/msg_server_defund_pool.go index 0b4da9c5..98a6c006 100644 --- a/x/funders/keeper/msg_server_defund_pool.go +++ b/x/funders/keeper/msg_server_defund_pool.go @@ -61,7 +61,7 @@ func (k msgServer) DefundPool(goCtx context.Context, msg *types.MsgDefundPool) ( _ = ctx.EventManager().EmitTypedEvent(&types.EventDefundPool{ PoolId: msg.PoolId, Address: msg.Creator, - Amounts: defundAmounts, + Amounts: defundAmounts.String(), }) return &types.MsgDefundPoolResponse{}, nil diff --git a/x/funders/keeper/msg_server_fund_pool.go b/x/funders/keeper/msg_server_fund_pool.go index ef9d9b89..7fcf087f 100644 --- a/x/funders/keeper/msg_server_fund_pool.go +++ b/x/funders/keeper/msg_server_fund_pool.go @@ -88,8 +88,8 @@ func (k msgServer) FundPool(goCtx context.Context, msg *types.MsgFundPool) (*typ _ = ctx.EventManager().EmitTypedEvent(&types.EventFundPool{ PoolId: msg.PoolId, Address: msg.Creator, - Amounts: msg.Amounts, - AmountsPerBundle: msg.AmountsPerBundle, + Amounts: msg.Amounts.String(), + AmountsPerBundle: msg.AmountsPerBundle.String(), }) return &types.MsgFundPoolResponse{}, nil diff --git a/x/funders/spec/05_events.md b/x/funders/spec/05_events.md index eaca4764..df31f5a6 100644 --- a/x/funders/spec/05_events.md +++ b/x/funders/spec/05_events.md @@ -73,17 +73,9 @@ message EventFundPool { // address is the account address of the pool funder. string address = 2; // amounts is a list of coins the funder has funded - repeated cosmos.base.v1beta1.Coin amounts = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string amounts = 3; // amounts_per_bundle is a list of coins the funder wants to distribute per finalized bundle - repeated cosmos.base.v1beta1.Coin amounts_per_bundle = 4 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string amounts_per_bundle = 4; } ``` @@ -104,11 +96,7 @@ message EventDefundPool { // address is the account address of the pool funder. string address = 2; // amounts is a list of coins that the funder wants to defund - repeated cosmos.base.v1beta1.Coin amounts = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string amounts = 3; } ``` diff --git a/x/funders/types/events.pb.go b/x/funders/types/events.pb.go index 7a69f235..e3da11ad 100644 --- a/x/funders/types/events.pb.go +++ b/x/funders/types/events.pb.go @@ -5,9 +5,6 @@ package types import ( fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -283,9 +280,9 @@ type EventFundPool struct { // address is the account address of the pool funder. Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // amounts is a list of coins the funder has funded - Amounts github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amounts,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amounts"` + Amounts string `protobuf:"bytes,3,opt,name=amounts,proto3" json:"amounts,omitempty"` // amounts_per_bundle is a list of coins the funder wants to distribute per finalized bundle - AmountsPerBundle github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=amounts_per_bundle,json=amountsPerBundle,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amounts_per_bundle"` + AmountsPerBundle string `protobuf:"bytes,4,opt,name=amounts_per_bundle,json=amountsPerBundle,proto3" json:"amounts_per_bundle,omitempty"` } func (m *EventFundPool) Reset() { *m = EventFundPool{} } @@ -335,18 +332,18 @@ func (m *EventFundPool) GetAddress() string { return "" } -func (m *EventFundPool) GetAmounts() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventFundPool) GetAmounts() string { if m != nil { return m.Amounts } - return nil + return "" } -func (m *EventFundPool) GetAmountsPerBundle() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventFundPool) GetAmountsPerBundle() string { if m != nil { return m.AmountsPerBundle } - return nil + return "" } // EventDefundPool is an event emitted when a pool is defunded. @@ -357,7 +354,7 @@ type EventDefundPool struct { // address is the account address of the pool funder. Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // amounts is a list of coins that the funder wants to defund - Amounts github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amounts,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amounts"` + Amounts string `protobuf:"bytes,3,opt,name=amounts,proto3" json:"amounts,omitempty"` } func (m *EventDefundPool) Reset() { *m = EventDefundPool{} } @@ -407,11 +404,11 @@ func (m *EventDefundPool) GetAddress() string { return "" } -func (m *EventDefundPool) GetAmounts() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventDefundPool) GetAmounts() string { if m != nil { return m.Amounts } - return nil + return "" } // EventPoolOutOfFunds is an event emitted when a pool has run out of funds @@ -473,41 +470,36 @@ func init() { func init() { proto.RegisterFile("kyve/funders/v1beta1/events.proto", fileDescriptor_1cf957abd56bbcb0) } var fileDescriptor_1cf957abd56bbcb0 = []byte{ - // 539 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x94, 0xcf, 0x8a, 0xd3, 0x40, - 0x1c, 0xc7, 0x9b, 0xb6, 0xb6, 0x76, 0x8a, 0xe8, 0xc6, 0x05, 0x63, 0x91, 0x6c, 0xed, 0xa9, 0x88, - 0x26, 0xec, 0x8a, 0x0f, 0x60, 0xd7, 0x5d, 0x10, 0xc1, 0x2d, 0x01, 0x05, 0xbd, 0x94, 0x49, 0x66, - 0xda, 0x1d, 0x9b, 0xcc, 0x2f, 0x64, 0x26, 0xad, 0xbd, 0xf8, 0x0c, 0x3e, 0x86, 0x78, 0x90, 0x05, - 0x4f, 0xbe, 0xc1, 0x1e, 0xf7, 0xe8, 0x49, 0xa5, 0x3d, 0xf8, 0x1a, 0x32, 0x93, 0x49, 0xb7, 0xc2, - 0x0a, 0x5e, 0xf6, 0xb0, 0x97, 0x64, 0xbe, 0xf3, 0xfb, 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0x35, 0x5a, 0xd6, 0xf3, 0xd0, 0x6d, 0x4d, 0xac, 0x58, 0x8f, - 0x72, 0x79, 0x34, 0x56, 0xdf, 0x5a, 0xfc, 0x93, 0x7a, 0x70, 0x78, 0xba, 0x74, 0xad, 0xb3, 0xa5, - 0x6b, 0xfd, 0x5a, 0xba, 0xd6, 0xc7, 0x95, 0x5b, 0x39, 0x5b, 0xb9, 0x95, 0xef, 0x2b, 0xb7, 0xf2, - 0xf6, 0xe1, 0x06, 0xc1, 0x8b, 0x37, 0xaf, 0x0f, 0x5e, 0x52, 0x39, 0x87, 0x6c, 0xea, 0x47, 0xc7, - 0x98, 0x71, 0xff, 0xfd, 0xfa, 0x62, 0xd2, 0x2c, 0x61, 0x43, 0x5f, 0x48, 0x8f, 0xff, 0x04, 0x00, - 0x00, 0xff, 0xff, 0x99, 0xde, 0xd9, 0x0f, 0x37, 0x05, 0x00, 0x00, + // 456 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x93, 0xc1, 0x6e, 0xd3, 0x30, + 0x18, 0xc7, 0x9b, 0x51, 0x3a, 0xea, 0x09, 0x01, 0x61, 0x12, 0x51, 0x85, 0x42, 0xe9, 0x69, 0x87, + 0x29, 0xd1, 0xe0, 0x09, 0x28, 0x6c, 0x12, 0x42, 0x62, 0x55, 0x24, 0x90, 0xe0, 0x40, 0xe5, 0xc4, + 0x5f, 0x3b, 0xab, 0xa9, 0xbf, 0xc8, 0xf9, 0xd2, 0xd2, 0x57, 0xe0, 0xc4, 0xbb, 0x70, 0xe2, 0x0d, + 0x76, 0xdc, 0x91, 0x13, 0x42, 0xed, 0x8b, 0x20, 0x3b, 0xce, 0x36, 0x89, 0x22, 0x71, 0xe1, 0xb0, + 0x9b, 0xff, 0xfe, 0xff, 0xfd, 0xf7, 0xef, 0x4b, 0x64, 0xf6, 0x74, 0xb6, 0x5a, 0x40, 0x3c, 0xa9, + 0x94, 0x00, 0x5d, 0xc6, 0x8b, 0xa3, 0x14, 0x88, 0x1f, 0xc5, 0xb0, 0x00, 0x45, 0x65, 0x54, 0x68, + 0x24, 0xf4, 0xf7, 0x4d, 0x24, 0x72, 0x91, 0xc8, 0x45, 0x7a, 0xfb, 0x53, 0x9c, 0xa2, 0x0d, 0xc4, + 0x66, 0x55, 0x67, 0x7b, 0xdb, 0xeb, 0x0a, 0xae, 0xf9, 0xdc, 0xd5, 0x0d, 0xbe, 0x79, 0xec, 0xc1, + 0xb1, 0xe9, 0x7f, 0x57, 0x08, 0x4e, 0x30, 0xb2, 0x9e, 0xff, 0x82, 0x31, 0xcc, 0xc5, 0xb8, 0x4e, + 0x06, 0x5e, 0xdf, 0x3b, 0xd8, 0x7b, 0xf6, 0x38, 0xda, 0x76, 0x73, 0x54, 0x9f, 0x18, 0xb6, 0xcf, + 0x7f, 0x3e, 0x69, 0x25, 0x5d, 0xcc, 0xc5, 0x55, 0x85, 0x82, 0x65, 0x53, 0xb1, 0xf3, 0xef, 0x15, + 0x0a, 0x96, 0xae, 0x22, 0x60, 0xbb, 0x05, 0x5f, 0xe5, 0xc8, 0x45, 0x70, 0xab, 0xef, 0x1d, 0x74, + 0x93, 0x46, 0x0e, 0xbe, 0x37, 0xd4, 0x2f, 0x35, 0x70, 0x82, 0x13, 0x5b, 0x68, 0xf2, 0x5c, 0x08, + 0x0d, 0x65, 0x8d, 0xdc, 0x4d, 0x1a, 0x69, 0x9c, 0x39, 0x2a, 0x39, 0x03, 0x6d, 0x49, 0xba, 0x49, + 0x23, 0xfd, 0x1e, 0xbb, 0x23, 0x05, 0x28, 0x92, 0xb4, 0x72, 0x97, 0x5c, 0x6a, 0x73, 0x6a, 0x09, + 0x69, 0x29, 0x09, 0x82, 0x76, 0x7d, 0xca, 0x49, 0xe3, 0x64, 0xa8, 0x88, 0x67, 0x14, 0xdc, 0xae, + 0x1d, 0x27, 0xfd, 0x3e, 0xdb, 0x13, 0x50, 0x66, 0x5a, 0x16, 0x24, 0x51, 0x05, 0x1d, 0xeb, 0x5e, + 0xdf, 0xba, 0x62, 0xaf, 0xbf, 0xf8, 0x8d, 0x62, 0xff, 0xe2, 0xb1, 0xbb, 0x96, 0xdd, 0x50, 0x8f, + 0x10, 0x73, 0xff, 0x11, 0xdb, 0x2d, 0x10, 0xf3, 0xb1, 0x14, 0x96, 0xbb, 0x9d, 0x74, 0x8c, 0x7c, + 0x2d, 0xae, 0x0f, 0xb4, 0xf3, 0xc7, 0x40, 0x7c, 0x8e, 0x95, 0xa2, 0xb2, 0xf9, 0xad, 0x4e, 0xfa, + 0x87, 0xcc, 0x77, 0xcb, 0x71, 0x01, 0x7a, 0x9c, 0x56, 0x4a, 0xe4, 0x0d, 0xff, 0x7d, 0xe7, 0x8c, + 0x40, 0x0f, 0xed, 0xfe, 0xe0, 0x13, 0xbb, 0x67, 0x59, 0x5e, 0xc1, 0xe4, 0x7f, 0xd0, 0x0c, 0x22, + 0xf6, 0xd0, 0xf6, 0x9b, 0xe6, 0xd3, 0x8a, 0x4e, 0x27, 0x66, 0xe8, 0xf2, 0xaf, 0x77, 0x0c, 0x4f, + 0xce, 0xd7, 0xa1, 0x77, 0xb1, 0x0e, 0xbd, 0x5f, 0xeb, 0xd0, 0xfb, 0xba, 0x09, 0x5b, 0x17, 0x9b, + 0xb0, 0xf5, 0x63, 0x13, 0xb6, 0x3e, 0x1e, 0x4e, 0x25, 0x9d, 0x55, 0x69, 0x94, 0xe1, 0x3c, 0x7e, + 0xf3, 0xe1, 0xfd, 0xf1, 0x5b, 0xa0, 0x25, 0xea, 0x59, 0x9c, 0x9d, 0x71, 0xa9, 0xe2, 0xcf, 0x97, + 0x2f, 0x94, 0x56, 0x05, 0x94, 0x69, 0xc7, 0xbe, 0xcc, 0xe7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x3b, 0x48, 0x95, 0x0d, 0x04, 0x00, 0x00, } func (m *EventUpdateParams) Marshal() (dAtA []byte, err error) { @@ -711,32 +703,18 @@ func (m *EventFundPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.AmountsPerBundle) > 0 { - for iNdEx := len(m.AmountsPerBundle) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AmountsPerBundle[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } + i -= len(m.AmountsPerBundle) + copy(dAtA[i:], m.AmountsPerBundle) + i = encodeVarintEvents(dAtA, i, uint64(len(m.AmountsPerBundle))) + i-- + dAtA[i] = 0x22 } if len(m.Amounts) > 0 { - for iNdEx := len(m.Amounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } + i -= len(m.Amounts) + copy(dAtA[i:], m.Amounts) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Amounts))) + i-- + dAtA[i] = 0x1a } if len(m.Address) > 0 { i -= len(m.Address) @@ -774,18 +752,11 @@ func (m *EventDefundPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.Amounts) > 0 { - for iNdEx := len(m.Amounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } + i -= len(m.Amounts) + copy(dAtA[i:], m.Amounts) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Amounts))) + i-- + dAtA[i] = 0x1a } if len(m.Address) > 0 { i -= len(m.Address) @@ -937,17 +908,13 @@ func (m *EventFundPool) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } - if len(m.Amounts) > 0 { - for _, e := range m.Amounts { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.Amounts) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } - if len(m.AmountsPerBundle) > 0 { - for _, e := range m.AmountsPerBundle { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.AmountsPerBundle) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } return n } @@ -965,11 +932,9 @@ func (m *EventDefundPool) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } - if len(m.Amounts) > 0 { - for _, e := range m.Amounts { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.Amounts) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } return n } @@ -1708,7 +1673,7 @@ func (m *EventFundPool) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amounts", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -1718,31 +1683,29 @@ func (m *EventFundPool) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.Amounts = append(m.Amounts, types.Coin{}) - if err := m.Amounts[len(m.Amounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Amounts = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AmountsPerBundle", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -1752,25 +1715,23 @@ func (m *EventFundPool) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.AmountsPerBundle = append(m.AmountsPerBundle, types.Coin{}) - if err := m.AmountsPerBundle[len(m.AmountsPerBundle)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.AmountsPerBundle = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1877,7 +1838,7 @@ func (m *EventDefundPool) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amounts", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -1887,25 +1848,23 @@ func (m *EventDefundPool) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.Amounts = append(m.Amounts, types.Coin{}) - if err := m.Amounts[len(m.Amounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Amounts = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/stakers/keeper/msg_server_claim_commission_rewards.go b/x/stakers/keeper/msg_server_claim_commission_rewards.go index ee6057ff..7b47dd95 100644 --- a/x/stakers/keeper/msg_server_claim_commission_rewards.go +++ b/x/stakers/keeper/msg_server_claim_commission_rewards.go @@ -36,8 +36,8 @@ func (k msgServer) ClaimCommissionRewards(goCtx context.Context, msg *types.MsgC k.setStaker(ctx, staker) _ = ctx.EventManager().EmitTypedEvent(&types.EventClaimCommissionRewards{ - Staker: msg.Creator, - Amount: msg.Amount, + Staker: msg.Creator, + Amounts: msg.Amount.String(), }) return &types.MsgClaimCommissionRewardsResponse{}, nil diff --git a/x/stakers/spec/05_events.md b/x/stakers/spec/05_events.md index 124d5885..eae7d6bf 100644 --- a/x/stakers/spec/05_events.md +++ b/x/stakers/spec/05_events.md @@ -99,11 +99,7 @@ message EventClaimCommissionRewards { // staker is the account address of the protocol node. string staker = 1; // amount is the amount of the commission rewards claimed - repeated cosmos.base.v1beta1.Coin amount = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string amounts = 2; } ``` diff --git a/x/stakers/types/events.pb.go b/x/stakers/types/events.pb.go index 8812a482..00974c17 100644 --- a/x/stakers/types/events.pb.go +++ b/x/stakers/types/events.pb.go @@ -6,9 +6,6 @@ package types import ( cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -296,8 +293,8 @@ func (m *EventUpdateCommission) GetStaker() string { type EventClaimCommissionRewards struct { // staker is the account address of the protocol node. Staker string `protobuf:"bytes,1,opt,name=staker,proto3" json:"staker,omitempty"` - // amount is the amount of the commission rewards claimed - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + // amounts is the amount of the commission rewards claimed + Amounts string `protobuf:"bytes,2,opt,name=amounts,proto3" json:"amounts,omitempty"` } func (m *EventClaimCommissionRewards) Reset() { *m = EventClaimCommissionRewards{} } @@ -340,11 +337,11 @@ func (m *EventClaimCommissionRewards) GetStaker() string { return "" } -func (m *EventClaimCommissionRewards) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *EventClaimCommissionRewards) GetAmounts() string { if m != nil { - return m.Amount + return m.Amounts } - return nil + return "" } // EventJoinPool ... @@ -491,46 +488,41 @@ func init() { func init() { proto.RegisterFile("kyve/stakers/v1beta1/events.proto", fileDescriptor_7a1b3dc9634155a0) } var fileDescriptor_7a1b3dc9634155a0 = []byte{ - // 612 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0x8e, 0xd3, 0xfc, 0xd2, 0x5f, 0xb7, 0xe2, 0x4f, 0x4d, 0x01, 0xd3, 0x22, 0xb7, 0x84, 0x4b, - 0x40, 0x60, 0xab, 0x45, 0x3c, 0x40, 0x13, 0x8a, 0x04, 0x14, 0x54, 0x19, 0x81, 0x04, 0x97, 0x6a, - 0xe2, 0x1d, 0x25, 0xab, 0xd8, 0x3b, 0x91, 0x77, 0x9b, 0x34, 0x6f, 0xc0, 0x91, 0x37, 0xe0, 0x8a, - 0x38, 0x21, 0xf1, 0x06, 0x9c, 0x7a, 0xec, 0x11, 0x71, 0x28, 0xa8, 0x3d, 0xf0, 0x1a, 0xc8, 0xeb, - 0x4d, 0xea, 0x4a, 0xad, 0x84, 0x7a, 0xb1, 0xf7, 0x9b, 0x99, 0x9d, 0xef, 0x9b, 0xd9, 0xd9, 0x65, - 0x77, 0xfa, 0xe3, 0x21, 0x86, 0x4a, 0x43, 0x1f, 0x33, 0x15, 0x0e, 0xd7, 0x3a, 0xa8, 0x61, 0x2d, - 0xc4, 0x21, 0x4a, 0xad, 0x82, 0x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82, 0x2d, 0xec, 0x42, - 0x3c, 0x7e, 0x82, 0x71, 0x54, 0xda, 0xd6, 0xf8, 0xee, 0xb0, 0x6b, 0xa5, 0x06, 0xbe, 0x44, 0x0d, - 0x1c, 0x34, 0x9c, 0x2b, 0xc6, 0x63, 0xb3, 0x29, 0x49, 0x91, 0x3b, 0xaa, 0x45, 0x51, 0x16, 0xe6, - 0x9e, 0x11, 0x76, 0x94, 0xd0, 0x38, 0x29, 0xd7, 0x42, 0x77, 0x89, 0xfd, 0x2f, 0x38, 0x4a, 0x2d, - 0xf4, 0xd8, 0xab, 0x19, 0xd7, 0x14, 0xbb, 0xf7, 0xd8, 0x55, 0x85, 0xf1, 0x6e, 0x26, 0xf4, 0x78, - 0x27, 0x26, 0xa9, 0x21, 0xd6, 0xde, 0x7f, 0x26, 0xe6, 0xca, 0xc4, 0xde, 0x2e, 0xcc, 0x39, 0x01, - 0x47, 0x0d, 0x22, 0x51, 0x5e, 0xbd, 0x20, 0xb0, 0xb0, 0xa1, 0xd9, 0xf5, 0x52, 0x0d, 0xed, 0x69, - 0x75, 0xe7, 0x56, 0x71, 0xba, 0x75, 0xd5, 0x8b, 0xb5, 0xee, 0x93, 0xc3, 0x96, 0x8b, 0x53, 0x4c, - 0x40, 0xa4, 0x27, 0xac, 0x11, 0x8e, 0x20, 0xe3, 0xea, 0x5c, 0xf2, 0x5e, 0xe9, 0x3c, 0x67, 0x9a, - 0xf3, 0xeb, 0xb7, 0x82, 0x82, 0x31, 0xc8, 0x6f, 0xc7, 0x74, 0xaa, 0xda, 0x24, 0x64, 0xeb, 0x71, - 0xae, 0xe9, 0xcb, 0xaf, 0x95, 0x66, 0x57, 0xe8, 0xde, 0x6e, 0x27, 0x88, 0x29, 0x0d, 0xed, 0x55, - 0x2a, 0x7e, 0x0f, 0x15, 0xef, 0x87, 0x7a, 0x3c, 0x40, 0x65, 0x36, 0xa8, 0xcf, 0x7f, 0xbe, 0xde, - 0x77, 0x26, 0x13, 0xd2, 0xd8, 0x63, 0x97, 0x8c, 0xc0, 0xe7, 0x24, 0xe4, 0x36, 0x51, 0xe2, 0xde, - 0x64, 0xb3, 0x03, 0xa2, 0x64, 0x47, 0x70, 0xa3, 0xa9, 0x16, 0xd5, 0x73, 0xf8, 0x8c, 0x97, 0xb4, - 0x56, 0x4f, 0x69, 0xf5, 0x19, 0x1b, 0x42, 0x02, 0x9c, 0x67, 0xa8, 0x94, 0x3d, 0xd7, 0x92, 0xa5, - 0x34, 0x9b, 0xb5, 0xf2, 0x6c, 0x36, 0x36, 0xd8, 0x65, 0xc3, 0xbc, 0x85, 0x30, 0xc4, 0x0b, 0x51, - 0xb7, 0x9e, 0xee, 0x1f, 0xf9, 0xce, 0xc1, 0x91, 0xef, 0xfc, 0x3e, 0xf2, 0x9d, 0x8f, 0xc7, 0x7e, - 0xe5, 0xe0, 0xd8, 0xaf, 0xfc, 0x38, 0xf6, 0x2b, 0xef, 0x1f, 0x94, 0xba, 0xf1, 0xe2, 0xdd, 0xdb, - 0xcd, 0x57, 0xa8, 0x47, 0x94, 0xf5, 0xc3, 0xb8, 0x07, 0x42, 0x86, 0x7b, 0xd3, 0x17, 0xc3, 0xf4, - 0xa5, 0x53, 0x37, 0x2f, 0xc5, 0xa3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x71, 0x63, 0xb4, 0x57, - 0xd0, 0x04, 0x00, 0x00, + // 538 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xc7, 0xe3, 0xfc, 0xf2, 0x4b, 0xc8, 0x22, 0xfe, 0x99, 0x02, 0x56, 0x8a, 0xdc, 0x62, 0x2e, + 0x45, 0x42, 0xb6, 0x0a, 0x4f, 0xd0, 0x84, 0x22, 0x01, 0x05, 0x2a, 0x23, 0x90, 0xe0, 0x12, 0x4d, + 0xbc, 0xa3, 0x64, 0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, 0x75, 0x12, 0xa2, 0x70, 0x28, 0x78, 0xc1, 0x68, 0xf9, 0xed, 0x5c, 0xbe, 0xe2, 0x35, 0x76, + 0xf3, 0x1c, 0xdb, 0x66, 0x6c, 0x0e, 0x21, 0x70, 0x9e, 0xa2, 0x94, 0xfa, 0x18, 0x6a, 0x91, 0xda, + 0x55, 0x6a, 0xd5, 0xaf, 0x92, 0xb3, 0xc7, 0x6e, 0x16, 0xce, 0x07, 0x08, 0x73, 0xbc, 0x92, 0x75, + 0xff, 0xe5, 0xf1, 0xd2, 0x36, 0x4e, 0x96, 0xb6, 0xf1, 0x7b, 0x69, 0x1b, 0xdf, 0x56, 0x76, 0xe3, + 0x64, 0x65, 0x37, 0x7e, 0xae, 0xec, 0xc6, 0x97, 0xa7, 0x63, 0xa1, 0x26, 0xb3, 0x91, 0x1b, 0x50, + 0xe4, 0xbd, 0xf9, 0xfc, 0x69, 0xff, 0x1d, 0xaa, 0x05, 0xa5, 0x53, 0x2f, 0x98, 0x80, 0x88, 0xbd, + 0xa3, 0xf5, 0x03, 0x57, 0x59, 0x82, 0x72, 0xd4, 0x2e, 0x1e, 0xf6, 0xf3, 0x3f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xca, 0x57, 0xf6, 0xb9, 0x4c, 0x04, 0x00, 0x00, } func (m *EventUpdateParams) Marshal() (dAtA []byte, err error) { @@ -753,19 +745,12 @@ func (m *EventClaimCommissionRewards) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } + if len(m.Amounts) > 0 { + i -= len(m.Amounts) + copy(dAtA[i:], m.Amounts) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Amounts))) + i-- + dAtA[i] = 0x12 } if len(m.Staker) > 0 { i -= len(m.Staker) @@ -963,11 +948,9 @@ func (m *EventClaimCommissionRewards) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } + l = len(m.Amounts) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) } return n } @@ -1721,9 +1704,9 @@ func (m *EventClaimCommissionRewards) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amounts", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -1733,25 +1716,23 @@ func (m *EventClaimCommissionRewards) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Amounts = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex From cac6176c5a4854d602199b35257b9477aa84f7a1 Mon Sep 17 00:00:00 2001 From: mbreithecker Date: Wed, 12 Jun 2024 10:04:41 +0200 Subject: [PATCH 2/3] chore: rename `amount` to `amounts` in MsgClaimCommissionRewards --- proto/kyve/stakers/v1beta1/tx.proto | 4 +- .../client/cli/tx_claim_commission_rewards.go | 2 +- .../msg_server_claim_commission_rewards.go | 8 +- ...sg_server_claim_commission_rewards_test.go | 22 +-- .../types/message_claim_commission_rewards.go | 4 +- x/stakers/types/tx.pb.go | 131 +++++++++--------- 6 files changed, 86 insertions(+), 85 deletions(-) diff --git a/proto/kyve/stakers/v1beta1/tx.proto b/proto/kyve/stakers/v1beta1/tx.proto index 63f71957..599c7787 100644 --- a/proto/kyve/stakers/v1beta1/tx.proto +++ b/proto/kyve/stakers/v1beta1/tx.proto @@ -89,8 +89,8 @@ message MsgClaimCommissionRewards { option (cosmos.msg.v1.signer) = "creator"; // creator ... string creator = 1; - // amount ... - repeated cosmos.base.v1beta1.Coin amount = 2 [ + // amounts ... + repeated cosmos.base.v1beta1.Coin amounts = 2 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" diff --git a/x/stakers/client/cli/tx_claim_commission_rewards.go b/x/stakers/client/cli/tx_claim_commission_rewards.go index d90e9a44..d02d8729 100644 --- a/x/stakers/client/cli/tx_claim_commission_rewards.go +++ b/x/stakers/client/cli/tx_claim_commission_rewards.go @@ -27,7 +27,7 @@ func CmdClaimCommissionRewards() *cobra.Command { msg := types.MsgClaimCommissionRewards{ Creator: clientCtx.GetFromAddress().String(), - Amount: argAmount, + Amounts: argAmount, } if err := msg.ValidateBasic(); err != nil { diff --git a/x/stakers/keeper/msg_server_claim_commission_rewards.go b/x/stakers/keeper/msg_server_claim_commission_rewards.go index 7b47dd95..5c3a6a6e 100644 --- a/x/stakers/keeper/msg_server_claim_commission_rewards.go +++ b/x/stakers/keeper/msg_server_claim_commission_rewards.go @@ -21,23 +21,23 @@ func (k msgServer) ClaimCommissionRewards(goCtx context.Context, msg *types.MsgC } // Check if amount can be claimed - if !msg.Amount.IsAllLTE(staker.CommissionRewards) { + if !msg.Amounts.IsAllLTE(staker.CommissionRewards) { return nil, types.ErrNotEnoughRewards } // send commission rewards from stakers module to claimer recipient := sdk.MustAccAddressFromBech32(msg.Creator) - if err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, recipient, msg.Amount); err != nil { + if err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, recipient, msg.Amounts); err != nil { return nil, err } // calculate new commission rewards and save - staker.CommissionRewards = staker.CommissionRewards.Sub(msg.Amount...) + staker.CommissionRewards = staker.CommissionRewards.Sub(msg.Amounts...) k.setStaker(ctx, staker) _ = ctx.EventManager().EmitTypedEvent(&types.EventClaimCommissionRewards{ Staker: msg.Creator, - Amounts: msg.Amount.String(), + Amounts: msg.Amounts.String(), }) return &types.MsgClaimCommissionRewardsResponse{}, nil diff --git a/x/stakers/keeper/msg_server_claim_commission_rewards_test.go b/x/stakers/keeper/msg_server_claim_commission_rewards_test.go index 67fed59d..509cb820 100644 --- a/x/stakers/keeper/msg_server_claim_commission_rewards_test.go +++ b/x/stakers/keeper/msg_server_claim_commission_rewards_test.go @@ -225,7 +225,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT _, err := s.RunTx(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_2, - Amount: i.KYVECoins(1), + Amounts: i.KYVECoins(1), }) // ASSERT @@ -246,7 +246,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT _, err := s.RunTx(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_1, - Amount: uploader.CommissionRewards.Add(i.KYVECoin(1)), + Amounts: uploader.CommissionRewards.Add(i.KYVECoin(1)), }) // ASSERT @@ -268,7 +268,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT _, err := s.RunTx(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_0, - Amount: sdk.NewCoins(), + Amounts: sdk.NewCoins(), }) // ASSERT @@ -289,7 +289,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT s.RunTxStakersSuccess(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_0, - Amount: i.KYVECoins(100), + Amounts: i.KYVECoins(100), }) // ASSERT @@ -303,7 +303,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ARRANGE s.RunTxStakersSuccess(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_0, - Amount: i.KYVECoins(100), + Amounts: i.KYVECoins(100), }) s.RunTxBundlesSuccess(&bundletypes.MsgVoteBundleProposal{ @@ -360,7 +360,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT s.RunTxSuccess(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_0, - Amount: i.KYVECoins(200), + Amounts: i.KYVECoins(200), }) // ASSERT @@ -378,7 +378,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT s.RunTxSuccess(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_0, - Amount: uploader.CommissionRewards, + Amounts: uploader.CommissionRewards, }) // ASSERT @@ -451,7 +451,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT s.RunTxSuccess(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_0, - Amount: sdk.NewCoins(i.KYVECoin(100), i.ACoin(200), i.BCoin(300)), + Amounts: sdk.NewCoins(i.KYVECoin(100), i.ACoin(200), i.BCoin(300)), }) // ASSERT @@ -527,7 +527,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT s.RunTxSuccess(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_0, - Amount: sdk.NewCoins(rewardsBCoin), + Amounts: sdk.NewCoins(rewardsBCoin), }) // ASSERT @@ -603,7 +603,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT _, err := s.RunTx(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_0, - Amount: sdk.NewCoins(i.KYVECoin(100), i.ACoin(200), rewardsBCoin.Add(i.BCoin(1))), + Amounts: sdk.NewCoins(i.KYVECoin(100), i.ACoin(200), rewardsBCoin.Add(i.BCoin(1))), }) // ASSERT @@ -679,7 +679,7 @@ var _ = Describe("msg_server_claim_commission_rewards.go", Ordered, func() { // ACT _, err := s.RunTx(&stakertypes.MsgClaimCommissionRewards{ Creator: i.STAKER_0, - Amount: sdk.NewCoins(i.KYVECoin(100), i.ACoin(200), i.CCoin(300)), + Amounts: sdk.NewCoins(i.KYVECoin(100), i.ACoin(200), i.CCoin(300)), }) // ASSERT diff --git a/x/stakers/types/message_claim_commission_rewards.go b/x/stakers/types/message_claim_commission_rewards.go index 9df09546..c7555719 100644 --- a/x/stakers/types/message_claim_commission_rewards.go +++ b/x/stakers/types/message_claim_commission_rewards.go @@ -39,11 +39,11 @@ func (msg *MsgClaimCommissionRewards) ValidateBasic() error { return errors.Wrapf(errorsTypes.ErrInvalidAddress, "invalid validator address: %s", err) } - if msg.Amount.Empty() { + if msg.Amounts.Empty() { return errors.Wrapf(errorsTypes.ErrInvalidRequest, "amount is empty") } - if err := msg.Amount.Validate(); err != nil { + if err := msg.Amounts.Validate(); err != nil { return errors.Wrapf(errorsTypes.ErrInvalidRequest, "invalid amount: %s", err) } diff --git a/x/stakers/types/tx.pb.go b/x/stakers/types/tx.pb.go index fd375ae5..12aa487c 100644 --- a/x/stakers/types/tx.pb.go +++ b/x/stakers/types/tx.pb.go @@ -346,8 +346,8 @@ var xxx_messageInfo_MsgUpdateCommissionResponse proto.InternalMessageInfo type MsgClaimCommissionRewards struct { // creator ... Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - // amount ... - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + // amounts ... + Amounts github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amounts,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amounts"` } func (m *MsgClaimCommissionRewards) Reset() { *m = MsgClaimCommissionRewards{} } @@ -390,9 +390,9 @@ func (m *MsgClaimCommissionRewards) GetCreator() string { return "" } -func (m *MsgClaimCommissionRewards) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *MsgClaimCommissionRewards) GetAmounts() github_com_cosmos_cosmos_sdk_types.Coins { if m != nil { - return m.Amount + return m.Amounts } return nil } @@ -748,59 +748,60 @@ func init() { func init() { proto.RegisterFile("kyve/stakers/v1beta1/tx.proto", fileDescriptor_f52b730e69b9fb06) } var fileDescriptor_f52b730e69b9fb06 = []byte{ - // 827 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4b, 0x6f, 0xd3, 0x4a, - 0x14, 0x8e, 0xfb, 0xce, 0x34, 0xea, 0xc3, 0x37, 0xb7, 0x75, 0x5c, 0xd5, 0x6d, 0x53, 0x55, 0x37, - 0xad, 0x6e, 0x6d, 0xa5, 0x08, 0x90, 0xba, 0x23, 0x01, 0x24, 0xa0, 0x81, 0x2a, 0x15, 0x88, 0xc7, - 0xa2, 0x9a, 0xd8, 0x23, 0x67, 0x48, 0xec, 0x89, 0x3c, 0x93, 0xb4, 0xd9, 0xa1, 0x2e, 0x58, 0xb3, - 0xe2, 0x37, 0x20, 0x24, 0xa4, 0x2e, 0xf8, 0x11, 0x5d, 0x56, 0xac, 0x10, 0x8b, 0x82, 0xda, 0x45, - 0xf7, 0xfc, 0x02, 0xe4, 0xd7, 0xc4, 0x49, 0xf3, 0x28, 0x88, 0x4d, 0x9c, 0x33, 0xdf, 0x77, 0xce, - 0xf9, 0x8e, 0xe7, 0x9c, 0x93, 0x80, 0xc5, 0x4a, 0xb3, 0x81, 0x34, 0xca, 0x60, 0x05, 0x39, 0x54, - 0x6b, 0x64, 0x4b, 0x88, 0xc1, 0xac, 0xc6, 0x0e, 0xd5, 0x9a, 0x43, 0x18, 0x11, 0x93, 0x2e, 0xac, - 0x06, 0xb0, 0x1a, 0xc0, 0xf2, 0x2c, 0xb4, 0xb0, 0x4d, 0x34, 0xef, 0xd3, 0x27, 0xca, 0x8a, 0x4e, - 0xa8, 0x45, 0xa8, 0x56, 0x82, 0x14, 0xf1, 0x30, 0x3a, 0xc1, 0x76, 0x80, 0xcf, 0x07, 0xb8, 0x45, - 0x4d, 0xad, 0x91, 0x75, 0x1f, 0x01, 0x90, 0xf2, 0x81, 0x7d, 0xcf, 0xd2, 0x7c, 0x23, 0x80, 0x92, - 0x26, 0x31, 0x89, 0x7f, 0xee, 0x7e, 0xf3, 0x4f, 0xd3, 0xef, 0x05, 0x30, 0x5d, 0xa0, 0x66, 0xde, - 0x41, 0x90, 0xa1, 0x3d, 0x4f, 0x99, 0x28, 0x81, 0x71, 0xdd, 0xb5, 0x89, 0x23, 0x09, 0xcb, 0x42, - 0x26, 0x5e, 0x0c, 0x4d, 0x71, 0x0e, 0x8c, 0x41, 0x8b, 0xd4, 0x6d, 0x26, 0x0d, 0x2d, 0x0b, 0x99, - 0x91, 0x62, 0x60, 0x89, 0x79, 0x00, 0x74, 0x62, 0x59, 0x98, 0x52, 0x4c, 0x6c, 0x69, 0xd8, 0x75, - 0xca, 0xad, 0x9e, 0x9c, 0x2d, 0xc5, 0xbe, 0x9d, 0x2d, 0x2d, 0xf8, 0x2a, 0xa8, 0x51, 0x51, 0x31, - 0xd1, 0x2c, 0xc8, 0xca, 0xea, 0x0e, 0x32, 0xa1, 0xde, 0xbc, 0x8b, 0xf4, 0x62, 0xc4, 0x6d, 0x3b, - 0x71, 0x74, 0x79, 0xbc, 0x11, 0xa6, 0x4a, 0xa7, 0xc0, 0x7c, 0x87, 0xae, 0x22, 0xa2, 0x35, 0x62, - 0x53, 0x94, 0x3e, 0x15, 0xc0, 0x6c, 0x81, 0x9a, 0x4f, 0x6b, 0x06, 0x64, 0xa8, 0x80, 0x18, 0x34, - 0x20, 0x83, 0x7d, 0x54, 0x4b, 0x60, 0xdc, 0x22, 0x36, 0xae, 0x20, 0xc7, 0x93, 0x1d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cc, 0xf9, 0xfa, 0x80, 0x20, 0x2d, 0xaa, 0x9c, 0xbd, 0x36, - 0x95, 0x67, 0x3c, 0x12, 0xc0, 0x5c, 0x8f, 0xb1, 0xed, 0xad, 0xbe, 0xbb, 0x83, 0x7c, 0xfb, 0x37, - 0x1d, 0xb8, 0x88, 0xe7, 0x60, 0x82, 0x4f, 0xd9, 0x4a, 0xcf, 0x20, 0x21, 0x45, 0x5e, 0x1f, 0x48, - 0xe1, 0x91, 0x5f, 0x81, 0x78, 0x6b, 0x40, 0xd2, 0x3d, 0xfd, 0x38, 0x47, 0xde, 0x18, 0xcc, 0xe1, - 0xc1, 0x0d, 0x90, 0x68, 0x1b, 0x8a, 0xb5, 0x01, 0xaf, 0xdf, 0xa7, 0xf5, 0xe9, 0xbf, 0x6e, 0xdd, - 0x2e, 0x8f, 0xbe, 0x71, 0x17, 0x59, 0xee, 0xfe, 0xc9, 0xb9, 0x22, 0x9c, 0x9e, 0x2b, 0xc2, 0x8f, - 0x73, 0x45, 0x78, 0x77, 0xa1, 0xc4, 0x4e, 0x2f, 0x94, 0xd8, 0xd7, 0x0b, 0x25, 0xf6, 0xf2, 0xff, - 0xc8, 0x46, 0x7c, 0xf4, 0xe2, 0xd9, 0xbd, 0xc7, 0x88, 0x1d, 0x10, 0xa7, 0xa2, 0xe9, 0x65, 0x88, - 0x6d, 0xed, 0x90, 0xff, 0x21, 0xf1, 0x76, 0x63, 0x69, 0xcc, 0xfb, 0xe5, 0xbf, 0xf1, 0x2b, 0x00, - 0x00, 0xff, 0xff, 0xd8, 0xe7, 0x63, 0x3f, 0xad, 0x08, 0x00, 0x00, + // 836 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4b, 0x6f, 0xdb, 0x46, + 0x10, 0x16, 0xfd, 0x92, 0xb5, 0x16, 0xfc, 0x60, 0x55, 0x9b, 0xa2, 0x61, 0xda, 0x96, 0x61, 0x54, + 0x36, 0x6a, 0x12, 0x72, 0xd1, 0x16, 0xf0, 0xad, 0x52, 0x5b, 0xa0, 0xad, 0xd5, 0x1a, 0x34, 0x1a, + 0xe4, 0x71, 0x30, 0x56, 0xe4, 0x82, 0x5a, 0x4b, 0xe4, 0x0a, 0xdc, 0x95, 0x6c, 0xdd, 0x02, 0x1f, + 0x72, 0xce, 0x29, 0xbf, 0x21, 0xc8, 0x25, 0x3e, 0xe4, 0x47, 0xf8, 0x68, 0xe4, 0x14, 0xe4, 0xe0, + 0x04, 0xf6, 0xc1, 0xf7, 0xfc, 0x82, 0x80, 0xaf, 0x15, 0x25, 0xeb, 0xe1, 0x04, 0xb9, 0x88, 0x9a, + 0xfd, 0xbe, 0x99, 0xf9, 0x86, 0x3b, 0x33, 0x12, 0x58, 0xa9, 0xb5, 0x5b, 0x48, 0xa3, 0x0c, 0xd6, + 0x90, 0x4b, 0xb5, 0x56, 0xa1, 0x82, 0x18, 0x2c, 0x68, 0xec, 0x54, 0x6d, 0xb8, 0x84, 0x11, 0x31, + 0xe3, 0xc1, 0x6a, 0x08, 0xab, 0x21, 0x2c, 0x2f, 0x40, 0x1b, 0x3b, 0x44, 0xf3, 0x3f, 0x03, 0xa2, + 0xac, 0x18, 0x84, 0xda, 0x84, 0x6a, 0x15, 0x48, 0x11, 0x0f, 0x63, 0x10, 0xec, 0x84, 0xf8, 0x52, + 0x88, 0xdb, 0xd4, 0xd2, 0x5a, 0x05, 0xef, 0x11, 0x02, 0xd9, 0x00, 0x38, 0xf2, 0x2d, 0x2d, 0x30, + 0x42, 0x28, 0x63, 0x11, 0x8b, 0x04, 0xe7, 0xde, 0xb7, 0xe0, 0x34, 0xf7, 0x42, 0x00, 0x73, 0x65, + 0x6a, 0x95, 0x5c, 0x04, 0x19, 0x3a, 0xf4, 0x95, 0x89, 0x12, 0x48, 0x1a, 0x9e, 0x4d, 0x5c, 0x49, + 0x58, 0x13, 0xf2, 0x29, 0x3d, 0x32, 0xc5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0x53, 0x6f, 0x93, 0x15, 0xff, 0xbc, + 0xb8, 0x56, 0x84, 0xcb, 0x6b, 0x45, 0xf8, 0x78, 0xad, 0x08, 0xcf, 0x6f, 0x94, 0xc4, 0xe5, 0x8d, + 0x92, 0x78, 0x77, 0xa3, 0x24, 0x1e, 0xff, 0x18, 0x5b, 0x89, 0xff, 0x3c, 0x7a, 0xf0, 0xc7, 0xbf, + 0x88, 0x9d, 0x10, 0xb7, 0xa6, 0x19, 0x55, 0x88, 0x1d, 0xed, 0x94, 0xff, 0x25, 0xf1, 0x97, 0x63, + 0x65, 0xca, 0xff, 0xed, 0xff, 0xe9, 0x73, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbe, 0xa4, 0x12, 0x10, + 0xaf, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1354,10 +1355,10 @@ func (m *MsgClaimCommissionRewards) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Amounts) > 0 { + for iNdEx := len(m.Amounts) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Amounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1703,8 +1704,8 @@ func (m *MsgClaimCommissionRewards) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if len(m.Amount) > 0 { - for _, e := range m.Amount { + if len(m.Amounts) > 0 { + for _, e := range m.Amounts { l = e.Size() n += 1 + l + sovTx(uint64(l)) } @@ -2516,7 +2517,7 @@ func (m *MsgClaimCommissionRewards) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amounts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2543,8 +2544,8 @@ func (m *MsgClaimCommissionRewards) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Amounts = append(m.Amounts, types.Coin{}) + if err := m.Amounts[len(m.Amounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From fa8cd5b75de7d79a911df7a64db6d971f595aa8d Mon Sep 17 00:00:00 2001 From: mbreithecker Date: Wed, 12 Jun 2024 10:04:56 +0200 Subject: [PATCH 3/3] fix: emit all properties for BundleFinalizedEvent --- x/bundles/keeper/logic_bundles.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x/bundles/keeper/logic_bundles.go b/x/bundles/keeper/logic_bundles.go index a2852a8c..a9b30c71 100644 --- a/x/bundles/keeper/logic_bundles.go +++ b/x/bundles/keeper/logic_bundles.go @@ -422,13 +422,14 @@ func (k Keeper) finalizeCurrentBundleProposal(ctx sdk.Context, poolId uint64, vo FundersPayout: fundersPayout.String(), InflationPayout: inflationPayout, RewardTreasury: bundleReward.Treasury.String(), - RewardUploaderCommission: bundleReward.UploaderCommission.String(), - RewardUploaderStorageCost: bundleReward.UploaderStorageCost.String(), + RewardUploader: bundleReward.UploaderCommission.Add(bundleReward.UploaderStorageCost...).String(), RewardDelegation: bundleReward.Delegation.String(), RewardTotal: bundleReward.Total.String(), FinalizedAt: uint64(ctx.BlockTime().Unix()), Uploader: bundleProposal.Uploader, NextUploader: nextUploader, + RewardUploaderCommission: bundleReward.UploaderCommission.String(), + RewardUploaderStorageCost: bundleReward.UploaderStorageCost.String(), }) // Finalize the proposal, saving useful information.