diff --git a/integration_tests/minimum_fee_test.go b/integration_tests/minimum_fee_test.go index f1a91c80..da92ab84 100644 --- a/integration_tests/minimum_fee_test.go +++ b/integration_tests/minimum_fee_test.go @@ -2,8 +2,16 @@ package integration_tests import ( "context" + "encoding/json" "fmt" + "strconv" "testing" + "time" + + xiontypes "github.com/burnt-labs/xion/x/xion/types" + "github.com/cosmos/cosmos-sdk/codec" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "cosmossdk.io/math" @@ -97,6 +105,61 @@ func testMinimumFee(t *testing.T, td *TestData, assert assertionFn) { require.NoError(t, err) require.Equal(t, fundAmount, xionUserBalInitial) + cdc := codec.NewProtoCodec(xion.Config().EncodingConfig.InterfaceRegistry) + config := types.GetConfig() + config.SetBech32PrefixForAccount("xion", "xionpub") + + setPlatformMinimumsMsg := xiontypes.MsgSetPlatformMinimum{ + Authority: authtypes.NewModuleAddress("gov").String(), + Minimums: types.Coins{types.Coin{Amount: math.NewInt(10), Denom: "uxion"}}, + } + + msg, err := cdc.MarshalInterfaceJSON(&setPlatformMinimumsMsg) + require.NoError(t, err) + + prop := cosmos.TxProposalv1{ + Messages: []json.RawMessage{msg}, + Metadata: "", + Deposit: "100uxion", + Title: "Set platform percentage to 5%", + Summary: "Ups the platform fee to 5% for the integration test", + } + paramChangeTx, err := xion.SubmitProposal(ctx, xionUser.KeyName(), prop) + require.NoError(t, err) + t.Logf("Platform percentage change proposal submitted with ID %s in transaction %s", paramChangeTx.ProposalID, paramChangeTx.TxHash) + + proposalID, err := strconv.Atoi(paramChangeTx.ProposalID) + require.NoError(t, err) + + require.Eventuallyf(t, func() bool { + proposalInfo, err := xion.GovQueryProposal(ctx, uint64(proposalID)) + if err != nil { + require.NoError(t, err) + } else { + if proposalInfo.Status == govv1beta1.StatusVotingPeriod { + return true + } + t.Logf("Waiting for proposal to enter voting status VOTING, current status: %s", proposalInfo.Status) + } + return false + }, time.Second*11, time.Second, "failed to reach status VOTING after 11s") + + err = xion.VoteOnProposalAllValidators(ctx, uint64(proposalID), cosmos.ProposalVoteYes) + require.NoError(t, err) + + require.Eventuallyf(t, func() bool { + proposalInfo, err := xion.GovQueryProposal(ctx, uint64(proposalID)) + if err != nil { + require.NoError(t, err) + } else { + if proposalInfo.Status == govv1beta1.StatusPassed { + return true + } + t.Logf("Waiting for proposal to enter voting status PASSED, current status: %s", proposalInfo.Status) + } + return false + }, time.Second*11, time.Second, "failed to reach status PASSED after 11s") + // step 1: send a xion message with default (0%) platform fee recipientKeyName := "recipient-key" err = xion.CreateKey(ctx, recipientKeyName) diff --git a/integration_tests/send_test.go b/integration_tests/send_test.go index 36147042..62c7b4bd 100644 --- a/integration_tests/send_test.go +++ b/integration_tests/send_test.go @@ -54,6 +54,68 @@ func TestXionSendPlatformFee(t *testing.T) { require.NoError(t, err) cdc := codec.NewProtoCodec(xion.Config().EncodingConfig.InterfaceRegistry) + config := types.GetConfig() + config.SetBech32PrefixForAccount("xion", "xionpub") + + setPlatformMinimumsMsg := xiontypes.MsgSetPlatformMinimum{ + Authority: authtypes.NewModuleAddress("gov").String(), + Minimums: types.Coins{types.Coin{Amount: math.NewInt(10), Denom: "uxion"}}, + } + + msg, err := cdc.MarshalInterfaceJSON(&setPlatformMinimumsMsg) + require.NoError(t, err) + + _, err = xion.GetNode().ExecTx(ctx, + xionUser.KeyName(), + "xion", "send", xionUser.KeyName(), + "--chain-id", xion.Config().ChainID, + recipientKeyAddress, fmt.Sprintf("%d%s", 100, xion.Config().Denom), + ) + // platform minimums unset, so this should fail + require.Error(t, err) + + prop := cosmos.TxProposalv1{ + Messages: []json.RawMessage{msg}, + Metadata: "", + Deposit: "100uxion", + Title: "Set platform percentage to 5%", + Summary: "Ups the platform fee to 5% for the integration test", + } + paramChangeTx, err := xion.SubmitProposal(ctx, xionUser.KeyName(), prop) + require.NoError(t, err) + t.Logf("Platform percentage change proposal submitted with ID %s in transaction %s", paramChangeTx.ProposalID, paramChangeTx.TxHash) + + proposalID, err := strconv.Atoi(paramChangeTx.ProposalID) + require.NoError(t, err) + + require.Eventuallyf(t, func() bool { + proposalInfo, err := xion.GovQueryProposal(ctx, uint64(proposalID)) + if err != nil { + require.NoError(t, err) + } else { + if proposalInfo.Status == govv1beta1.StatusVotingPeriod { + return true + } + t.Logf("Waiting for proposal to enter voting status VOTING, current status: %s", proposalInfo.Status) + } + return false + }, time.Second*11, time.Second, "failed to reach status VOTING after 11s") + + err = xion.VoteOnProposalAllValidators(ctx, uint64(proposalID), cosmos.ProposalVoteYes) + require.NoError(t, err) + + require.Eventuallyf(t, func() bool { + proposalInfo, err := xion.GovQueryProposal(ctx, uint64(proposalID)) + if err != nil { + require.NoError(t, err) + } else { + if proposalInfo.Status == govv1beta1.StatusPassed { + return true + } + t.Logf("Waiting for proposal to enter voting status PASSED, current status: %s", proposalInfo.Status) + } + return false + }, time.Second*11, time.Second, "failed to reach status PASSED after 11s") _, err = xion.GetNode().ExecTx(ctx, xionUser.KeyName(), @@ -74,29 +136,26 @@ func TestXionSendPlatformFee(t *testing.T) { "balance never correctly changed") // step 2: update the platform percentage to 5% - config := types.GetConfig() - config.SetBech32PrefixForAccount("xion", "xionpub") setPlatformPercentageMsg := xiontypes.MsgSetPlatformPercentage{ Authority: authtypes.NewModuleAddress("gov").String(), PlatformPercentage: 500, } - - msg, err := cdc.MarshalInterfaceJSON(&setPlatformPercentageMsg) + msg, err = cdc.MarshalInterfaceJSON(&setPlatformPercentageMsg) require.NoError(t, err) - prop := cosmos.TxProposalv1{ + prop = cosmos.TxProposalv1{ Messages: []json.RawMessage{msg}, Metadata: "", Deposit: "100uxion", Title: "Set platform percentage to 5%", Summary: "Ups the platform fee to 5% for the integration test", } - paramChangeTx, err := xion.SubmitProposal(ctx, xionUser.KeyName(), prop) + paramChangeTx, err = xion.SubmitProposal(ctx, xionUser.KeyName(), prop) require.NoError(t, err) t.Logf("Platform percentage change proposal submitted with ID %s in transaction %s", paramChangeTx.ProposalID, paramChangeTx.TxHash) - proposalID, err := strconv.Atoi(paramChangeTx.ProposalID) + proposalID, err = strconv.Atoi(paramChangeTx.ProposalID) require.NoError(t, err) require.Eventuallyf(t, func() bool { diff --git a/proto/xion/v1/genesis.proto b/proto/xion/v1/genesis.proto index 73dc03c6..23805469 100644 --- a/proto/xion/v1/genesis.proto +++ b/proto/xion/v1/genesis.proto @@ -1,8 +1,17 @@ syntax = "proto3"; package xion.v1; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/burnt-labs/xion/x/xion/types"; -message GenesisState { uint32 platform_percentage = 1; } +message GenesisState { + uint32 platform_percentage = 1; + repeated cosmos.base.v1beta1.Coin platform_minimums = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "platform_minimums,omitempty", + (gogoproto.moretags) = "yaml:\"platform_minimums\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} diff --git a/proto/xion/v1/tx.proto b/proto/xion/v1/tx.proto index f5a0b3ac..70353242 100644 --- a/proto/xion/v1/tx.proto +++ b/proto/xion/v1/tx.proto @@ -25,6 +25,11 @@ service Msg { // percentage fee rpc SetPlatformPercentage(MsgSetPlatformPercentage) returns (MsgSetPlatformPercentageResponse); + + // SetPlatformMinimum defines the method for updating the platform + // percentage fee + rpc SetPlatformMinimum(MsgSetPlatformMinimum) + returns (MsgSetPlatformMinimumResponse); } // MsgSend represents a message to send coins from one account to another. @@ -76,3 +81,18 @@ message MsgSetPlatformPercentage { } message MsgSetPlatformPercentageResponse {} + +message MsgSetPlatformMinimum { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "xion/MsgSetPlatformMinimum"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + repeated cosmos.base.v1beta1.Coin minimums = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message MsgSetPlatformMinimumResponse {} diff --git a/x/xion/keeper/genesis.go b/x/xion/keeper/genesis.go index d3b61658..c7c5c6a8 100644 --- a/x/xion/keeper/genesis.go +++ b/x/xion/keeper/genesis.go @@ -11,12 +11,21 @@ import ( // InitGenesis initializes the bank module's state from a given genesis state. func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) { k.OverwritePlatformPercentage(ctx, genState.PlatformPercentage) + err := k.OverwritePlatformMinimum(ctx, genState.PlatformMinimums) + if err != nil { + panic(err) + } } // ExportGenesis returns the bank module's genesis state. func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { bz := ctx.KVStore(k.storeKey).Get(types.PlatformPercentageKey) platformPercentage := binary.BigEndian.Uint32(bz) - rv := types.NewGenesisState(platformPercentage) + + platformMinimums, err := k.GetPlatformMinimums(ctx) + if err != nil { + panic(err) + } + rv := types.NewGenesisState(platformPercentage, platformMinimums) return rv } diff --git a/x/xion/keeper/keeper.go b/x/xion/keeper/keeper.go index e63d1faf..5d023b10 100644 --- a/x/xion/keeper/keeper.go +++ b/x/xion/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "encoding/json" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -70,6 +71,26 @@ func (k Keeper) OverwritePlatformPercentage(ctx sdktypes.Context, percentage uin ctx.KVStore(k.storeKey).Set(types.PlatformPercentageKey, sdktypes.Uint64ToBigEndian(uint64(percentage))) } +// Platform Minimum +func (k Keeper) GetPlatformMinimums(ctx sdktypes.Context) (coins sdktypes.Coins, err error) { + bz := ctx.KVStore(k.storeKey).Get(types.PlatformMinimumKey) + + if len(bz) != 0 { + err = json.Unmarshal(bz, &coins) + } + + return coins, err +} + +func (k Keeper) OverwritePlatformMinimum(ctx sdktypes.Context, coins sdktypes.Coins) error { + bz, err := json.Marshal(coins) + if err != nil { + return err + } + ctx.KVStore(k.storeKey).Set(types.PlatformMinimumKey, bz) + return nil +} + // Authority // GetAuthority returns the x/xion module's authority. diff --git a/x/xion/keeper/msg_server.go b/x/xion/keeper/msg_server.go index b9387394..9d493b9c 100644 --- a/x/xion/keeper/msg_server.go +++ b/x/xion/keeper/msg_server.go @@ -52,7 +52,15 @@ func (k msgServer) Send(goCtx context.Context, msg *types.MsgSend) (*types.MsgSe } percentage := k.GetPlatformPercentage(ctx) + minimums, err := k.GetPlatformMinimums(ctx) + if err != nil { + return nil, err + } throughCoins := msg.Amount + if !msg.Amount.IsAnyGT(minimums) { + // minimum has not been met. no coin in msg.Amount exceeds a minimum that has been set + return nil, errorsmod.Wrapf(types.ErrMinimumNotMet, "received %v, needed at least %v", msg.Amount, minimums) + } if !percentage.IsZero() { platformCoins := msg.Amount.MulInt(percentage).QuoInt(math.NewInt(10000)) @@ -94,9 +102,18 @@ func (k msgServer) MultiSend(goCtx context.Context, msg *types.MsgMultiSend) (*t } percentage := k.GetPlatformPercentage(ctx) + minimums, err := k.GetPlatformMinimums(ctx) + if err != nil { + return nil, err + } var outputs []banktypes.Output totalPlatformCoins := sdk.NewCoins() + if !msg.Inputs[0].Coins.IsAnyGT(minimums) { + // minimum has not been met. no coin in msg.Amount exceeds a minimum that has been set + return nil, errorsmod.Wrapf(types.ErrMinimumNotMet, "received %v, needed at least %v", msg.Inputs[0].Coins, minimums) + } + for _, out := range msg.Outputs { accAddr := sdk.MustAccAddressFromBech32(out.Address) @@ -125,7 +142,7 @@ func (k msgServer) MultiSend(goCtx context.Context, msg *types.MsgMultiSend) (*t outputs = append(outputs, banktypes.NewOutput(feeCollectorAcc, totalPlatformCoins)) } - err := k.bankKeeper.InputOutputCoins(ctx, msg.Inputs[0], outputs) + err = k.bankKeeper.InputOutputCoins(ctx, msg.Inputs[0], outputs) if err != nil { return nil, err } @@ -143,3 +160,14 @@ func (k msgServer) SetPlatformPercentage(goCtx context.Context, msg *types.MsgSe return &types.MsgSetPlatformPercentageResponse{}, nil } + +func (k msgServer) SetPlatformMinimum(goCtx context.Context, msg *types.MsgSetPlatformMinimum) (*types.MsgSetPlatformMinimumResponse, error) { + if k.GetAuthority() != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), msg.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + err := k.OverwritePlatformMinimum(ctx, msg.Minimums) + + return &types.MsgSetPlatformMinimumResponse{}, err +} diff --git a/x/xion/types/errors.go b/x/xion/types/errors.go index 57b36186..859323c0 100644 --- a/x/xion/types/errors.go +++ b/x/xion/types/errors.go @@ -11,4 +11,5 @@ var ( ErrNoAllowedContracts = errorsmod.Register(DefaultCodespace, 2, "no contract addresses specified") ErrNoValidAllowances = errorsmod.Register(DefaultCodespace, 3, "none of the allowances accepted the msg") ErrInconsistentExpiry = errorsmod.Register(DefaultCodespace, 4, "multi allowances must all expire together") + ErrMinimumNotMet = errorsmod.Register(DefaultCodespace, 5, "minimum send amount not met") ) diff --git a/x/xion/types/genesis.go b/x/xion/types/genesis.go index 205801ee..16155aea 100644 --- a/x/xion/types/genesis.go +++ b/x/xion/types/genesis.go @@ -5,6 +5,7 @@ import ( "errors" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/types" ) // Validate performs basic validation of supply genesis data returning an @@ -18,16 +19,17 @@ func (gs GenesisState) Validate() error { } // NewGenesisState creates a new genesis state. -func NewGenesisState(platformPercentage uint32) *GenesisState { +func NewGenesisState(platformPercentage uint32, platformMinimums types.Coins) *GenesisState { rv := &GenesisState{ PlatformPercentage: platformPercentage, + PlatformMinimums: platformMinimums, } return rv } // DefaultGenesisState returns a default bank module genesis state. func DefaultGenesisState() *GenesisState { - return NewGenesisState(0) + return NewGenesisState(0, types.Coins{}) } // GetGenesisStateFromAppState returns x/bank GenesisState given raw application diff --git a/x/xion/types/genesis.pb.go b/x/xion/types/genesis.pb.go index 3346616f..4bfc95be 100644 --- a/x/xion/types/genesis.pb.go +++ b/x/xion/types/genesis.pb.go @@ -5,6 +5,8 @@ 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/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -24,7 +26,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { - PlatformPercentage uint32 `protobuf:"varint,1,opt,name=platform_percentage,json=platformPercentage,proto3" json:"platform_percentage,omitempty"` + PlatformPercentage uint32 `protobuf:"varint,1,opt,name=platform_percentage,json=platformPercentage,proto3" json:"platform_percentage,omitempty"` + PlatformMinimums github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=platform_minimums,json=platformMinimums,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"platform_minimums,omitempty" yaml:"platform_minimums"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -67,6 +70,13 @@ func (m *GenesisState) GetPlatformPercentage() uint32 { return 0 } +func (m *GenesisState) GetPlatformMinimums() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.PlatformMinimums + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "xion.v1.GenesisState") } @@ -74,19 +84,27 @@ func init() { func init() { proto.RegisterFile("xion/v1/genesis.proto", fileDescriptor_9a0f59b6b1baf029) } var fileDescriptor_9a0f59b6b1baf029 = []byte{ - // 181 bytes of a gzipped FileDescriptorProto + // 312 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xad, 0xc8, 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x62, 0x07, 0x09, 0xeb, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0xc5, - 0xf4, 0x41, 0x2c, 0x88, 0xb4, 0x92, 0x3d, 0x17, 0x8f, 0x3b, 0x44, 0x7d, 0x70, 0x49, 0x62, 0x49, - 0xaa, 0x90, 0x3e, 0x97, 0x70, 0x41, 0x4e, 0x62, 0x49, 0x5a, 0x7e, 0x51, 0x6e, 0x7c, 0x41, 0x6a, - 0x51, 0x72, 0x6a, 0x5e, 0x49, 0x62, 0x7a, 0xaa, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x6f, 0x90, 0x10, - 0x4c, 0x2a, 0x00, 0x2e, 0xe3, 0xe4, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, - 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, - 0x51, 0xea, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x49, 0xa5, 0x45, - 0x79, 0x25, 0xba, 0x39, 0x89, 0x49, 0xc5, 0xfa, 0x60, 0x67, 0x56, 0x40, 0xa8, 0x92, 0xca, 0x82, - 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x53, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x35, 0xe8, - 0xba, 0xc2, 0x00, 0x00, 0x00, + 0xc9, 0x17, 0x62, 0x07, 0x09, 0xeb, 0x95, 0x19, 0x4a, 0xc9, 0x25, 0xe7, 0x17, 0xe7, 0xe6, 0x17, + 0xeb, 0x27, 0x25, 0x16, 0xa7, 0xea, 0x97, 0x19, 0x26, 0xa5, 0x96, 0x24, 0x1a, 0xea, 0x27, 0xe7, + 0x67, 0xe6, 0x41, 0x14, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x99, 0xfa, 0x20, 0x16, 0x44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0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xa9, + 0x23, 0x99, 0x9a, 0x54, 0x5a, 0x94, 0x57, 0xa2, 0x9b, 0x93, 0x98, 0x54, 0xac, 0x0f, 0x0e, 0xfd, + 0x0a, 0x08, 0x05, 0x36, 0x3a, 0x89, 0x0d, 0x1c, 0x82, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xa0, 0xd2, 0xf5, 0xdb, 0x99, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -109,6 +127,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.PlatformMinimums) > 0 { + for iNdEx := len(m.PlatformMinimums) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PlatformMinimums[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } if m.PlatformPercentage != 0 { i = encodeVarintGenesis(dAtA, i, uint64(m.PlatformPercentage)) i-- @@ -137,6 +169,12 @@ func (m *GenesisState) Size() (n int) { if m.PlatformPercentage != 0 { n += 1 + sovGenesis(uint64(m.PlatformPercentage)) } + if len(m.PlatformMinimums) > 0 { + for _, e := range m.PlatformMinimums { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -194,6 +232,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { break } } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PlatformMinimums", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PlatformMinimums = append(m.PlatformMinimums, types.Coin{}) + if err := m.PlatformMinimums[len(m.PlatformMinimums)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/xion/types/keys.go b/x/xion/types/keys.go index 7d27d8db..15b7d299 100644 --- a/x/xion/types/keys.go +++ b/x/xion/types/keys.go @@ -1,6 +1,9 @@ package types -var PlatformPercentageKey = []byte{0x00} +var ( + PlatformPercentageKey = []byte{0x00} + PlatformMinimumKey = []byte{0x01} +) const ( // ModuleName is the module name constant used in many places diff --git a/x/xion/types/tx.pb.go b/x/xion/types/tx.pb.go index 8275d518..95c96f64 100644 --- a/x/xion/types/tx.pb.go +++ b/x/xion/types/tx.pb.go @@ -292,6 +292,94 @@ func (m *MsgSetPlatformPercentageResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetPlatformPercentageResponse proto.InternalMessageInfo +type MsgSetPlatformMinimum struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Minimums github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=minimums,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"minimums"` +} + +func (m *MsgSetPlatformMinimum) Reset() { *m = MsgSetPlatformMinimum{} } +func (m *MsgSetPlatformMinimum) String() string { return proto.CompactTextString(m) } +func (*MsgSetPlatformMinimum) ProtoMessage() {} +func (*MsgSetPlatformMinimum) Descriptor() ([]byte, []int) { + return fileDescriptor_5076275aa290c9b8, []int{6} +} +func (m *MsgSetPlatformMinimum) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetPlatformMinimum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetPlatformMinimum.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 *MsgSetPlatformMinimum) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetPlatformMinimum.Merge(m, src) +} +func (m *MsgSetPlatformMinimum) XXX_Size() int { + return m.Size() +} +func (m *MsgSetPlatformMinimum) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetPlatformMinimum.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetPlatformMinimum proto.InternalMessageInfo + +func (m *MsgSetPlatformMinimum) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgSetPlatformMinimum) GetMinimums() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Minimums + } + return nil +} + +type MsgSetPlatformMinimumResponse struct { +} + +func (m *MsgSetPlatformMinimumResponse) Reset() { *m = MsgSetPlatformMinimumResponse{} } +func (m *MsgSetPlatformMinimumResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetPlatformMinimumResponse) ProtoMessage() {} +func (*MsgSetPlatformMinimumResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5076275aa290c9b8, []int{7} +} +func (m *MsgSetPlatformMinimumResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetPlatformMinimumResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetPlatformMinimumResponse.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 *MsgSetPlatformMinimumResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetPlatformMinimumResponse.Merge(m, src) +} +func (m *MsgSetPlatformMinimumResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetPlatformMinimumResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetPlatformMinimumResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetPlatformMinimumResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSend)(nil), "xion.v1.MsgSend") proto.RegisterType((*MsgSendResponse)(nil), "xion.v1.MsgSendResponse") @@ -299,50 +387,56 @@ func init() { proto.RegisterType((*MsgMultiSendResponse)(nil), "xion.v1.MsgMultiSendResponse") proto.RegisterType((*MsgSetPlatformPercentage)(nil), "xion.v1.MsgSetPlatformPercentage") proto.RegisterType((*MsgSetPlatformPercentageResponse)(nil), "xion.v1.MsgSetPlatformPercentageResponse") + proto.RegisterType((*MsgSetPlatformMinimum)(nil), "xion.v1.MsgSetPlatformMinimum") + proto.RegisterType((*MsgSetPlatformMinimumResponse)(nil), "xion.v1.MsgSetPlatformMinimumResponse") } func init() { proto.RegisterFile("xion/v1/tx.proto", fileDescriptor_5076275aa290c9b8) } var fileDescriptor_5076275aa290c9b8 = []byte{ - // 601 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x41, 0x8f, 0xd2, 0x40, - 0x14, 0x6e, 0x41, 0x21, 0xcc, 0xae, 0x71, 0xa9, 0xac, 0xb2, 0x35, 0x5b, 0xb0, 0x89, 0x11, 0x49, - 0x68, 0x05, 0xa3, 0x26, 0x18, 0x13, 0xc1, 0x93, 0x07, 0xe2, 0x86, 0xbd, 0x79, 0x21, 0x2d, 0xcc, - 0x96, 0x06, 0x3a, 0xd3, 0x74, 0xa6, 0x84, 0xbd, 0x19, 0x4f, 0xc6, 0x93, 0x17, 0xef, 0x7b, 0x34, - 0x9e, 0xf6, 0xa0, 0xfe, 0x86, 0x3d, 0x6e, 0x3c, 0x79, 0x52, 0x03, 0x87, 0x35, 0xfe, 0x0a, 0x33, - 0xd3, 0x69, 0x61, 0x5d, 0x36, 0x5c, 0xe8, 0xcc, 0x7b, 0xef, 0xfb, 0xe6, 0xfb, 0xde, 0x9b, 0x01, - 0x6c, 0x4d, 0x5d, 0x8c, 0xcc, 0x49, 0xdd, 0xa4, 0x53, 0xc3, 0x0f, 0x30, 0xc5, 0x4a, 0x96, 0x45, - 0x8c, 0x49, 0x5d, 0x2d, 0x38, 0xd8, 0xc1, 0x3c, 0x66, 0xb2, 0x55, 0x94, 0x56, 0x6f, 0xf5, 0x31, - 0xf1, 0x30, 0x31, 0x3d, 0xe2, 0x30, 0x98, 0x47, 0x1c, 0x91, 0xc8, 0x5b, 0x9e, 0x8b, 0xb0, 0xc9, - 0x7f, 0x45, 0x68, 0x27, 0xaa, 0xed, 0x45, 0x24, 0xd1, 0x46, 0xa4, 0x34, 0x41, 0x63, 0x5b, 0x04, - 0x9a, 0x93, 0xba, 0x0d, 0xa9, 0x55, 0x37, 0xfb, 0xd8, 0x45, 0x17, 0xf2, 0x68, 0x94, 0xe4, 0xd9, - 0x26, 0xca, 0xeb, 0x1f, 0x53, 0x20, 0xdb, 0x21, 0xce, 0x3e, 0x44, 0x03, 0xe5, 0x29, 0xd8, 0x3c, - 0x08, 0xb0, 0xd7, 0xb3, 0x06, 0x83, 0x00, 0x12, 0x52, 0x94, 0xcb, 0x72, 0x25, 0xd7, 0x2e, 0x7e, - 0xff, 0x52, 0x2b, 0x88, 0x33, 0x5b, 0x51, 0x66, 0x9f, 0x06, 0x2e, 0x72, 0xba, 0x1b, 0xac, 0x5a, - 0x84, 0x94, 0x27, 0x00, 0x50, 0x9c, 0x40, 0x53, 0x6b, 0xa0, 0x39, 0x8a, 0x63, 0xe0, 0x10, 0x64, - 0x2c, 0x0f, 0x87, 0x88, 0x16, 0xd3, 0xe5, 0x74, 0x65, 0xa3, 0xb1, 0x63, 0x08, 0x04, 0xb3, 0x64, - 0x08, 0xc9, 0xc6, 0x0b, 0xec, 0xa2, 0xf6, 0xa3, 0x93, 0x9f, 0x25, 0xe9, 0xf3, 0xaf, 0x52, 0xc5, - 0x71, 0xe9, 0x30, 0xb4, 0x8d, 0x3e, 0xf6, 0x44, 0x37, 0xc4, 0xa7, 0x46, 0x06, 0x23, 0x93, 0x1e, - 0xfa, 0x90, 0x70, 0x00, 0xf9, 0x74, 0x76, 0x5c, 0x95, 0xbb, 0x82, 0xbf, 0x59, 0x7d, 0x77, 0x54, - 0x92, 0xfe, 0x1c, 0x95, 0xa4, 0xb7, 0x67, 0xc7, 0xd5, 0x73, 0x56, 0xdf, 0xb3, 0x00, 0x9f, 0xa0, - 0xe8, 0x85, 0x9e, 0x07, 0xd7, 0xc5, 0xb2, 0x0b, 0x89, 0x8f, 0x11, 0x81, 0xfa, 0x37, 0x19, 0x6c, - 0x76, 0x88, 0xd3, 0x09, 0xc7, 0xd4, 0xe5, 0xfd, 0x7a, 0x06, 0x32, 0x2e, 0xf2, 0x43, 0xca, 0x3a, - 0xc5, 0x94, 0xab, 0x0b, 0xe5, 0x68, 0x94, 0x28, 0x7f, 0xc9, 0x4a, 0xda, 0x39, 0x26, 0x5d, 0xc8, - 0x89, 0x40, 0xca, 0x73, 0x90, 0xc5, 0x21, 0xe5, 0xf8, 0x14, 0xc7, 0xdf, 0x5e, 0x89, 0x7f, 0xc5, - 0x6b, 0x96, 0x09, 0x62, 0x58, 0xf3, 0x6e, 0x6c, 0x46, 0x50, 0x32, 0x1b, 0xf9, 0xd8, 0x46, 0xa2, - 0x53, 0xbf, 0x09, 0x0a, 0xcb, 0xfb, 0xc4, 0xd0, 0x57, 0x19, 0x14, 0xb9, 0x49, 0xba, 0x37, 0xb6, - 0xe8, 0x01, 0x0e, 0xbc, 0x3d, 0x18, 0xf4, 0x21, 0xa2, 0x96, 0x03, 0x95, 0xc7, 0x20, 0x67, 0x85, - 0x74, 0x88, 0x03, 0x97, 0x1e, 0xae, 0xbd, 0x09, 0x8b, 0x52, 0xc5, 0x04, 0x37, 0x7c, 0xc1, 0xd6, - 0xf3, 0x13, 0x3a, 0x7e, 0x21, 0xae, 0x75, 0x15, 0xff, 0xc2, 0x41, 0xcd, 0x07, 0xcc, 0xc0, 0x82, - 0x80, 0x79, 0xd8, 0x5d, 0x8c, 0x62, 0x85, 0x34, 0x5d, 0x07, 0xe5, 0xcb, 0x72, 0xb1, 0xb7, 0xc6, - 0x5f, 0x19, 0xa4, 0x3b, 0xc4, 0x51, 0x1a, 0xe0, 0x0a, 0x9f, 0xd5, 0x96, 0x21, 0x9e, 0xa3, 0x21, - 0xc6, 0xaa, 0x16, 0xff, 0x8f, 0xc4, 0x58, 0xa5, 0x05, 0x72, 0x8b, 0x21, 0x6f, 0x2f, 0x97, 0x25, - 0x61, 0x75, 0x77, 0x65, 0x38, 0xa1, 0x80, 0x60, 0x7b, 0x75, 0x5b, 0xef, 0x9c, 0x3f, 0x75, 0x45, - 0x89, 0x7a, 0x7f, 0x6d, 0x49, 0x7c, 0x8c, 0x7a, 0xf5, 0x0d, 0xbb, 0x10, 0xed, 0xd6, 0xc9, 0x4c, - 0x93, 0x4f, 0x67, 0x9a, 0xfc, 0x7b, 0xa6, 0xc9, 0x1f, 0xe6, 0x9a, 0x74, 0x3a, 0xd7, 0xa4, 0x1f, - 0x73, 0x4d, 0x7a, 0x7d, 0x6f, 0xe9, 0xa5, 0xd8, 0x61, 0x80, 0x68, 0x6d, 0x6c, 0xd9, 0xc4, 0xe4, - 0xfd, 0x9d, 0x46, 0x1f, 0xfe, 0x5c, 0xec, 0x0c, 0xff, 0x3b, 0x78, 0xf8, 0x2f, 0x00, 0x00, 0xff, - 0xff, 0x33, 0x6e, 0xe5, 0xa1, 0xc8, 0x04, 0x00, 0x00, + // 660 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xb6, 0x53, 0x68, 0xc9, 0xb5, 0x88, 0xd6, 0xb4, 0x90, 0x1a, 0xc5, 0x09, 0x96, 0x80, 0x10, + 0x29, 0x36, 0x09, 0x02, 0xa4, 0x20, 0x24, 0x12, 0x26, 0x86, 0x88, 0x2a, 0xdd, 0x10, 0x52, 0x64, + 0x27, 0xae, 0x63, 0x25, 0xbe, 0xb3, 0x7c, 0xe7, 0x28, 0xdd, 0x10, 0x13, 0x62, 0x62, 0x61, 0xef, + 0x88, 0x98, 0x3a, 0x00, 0xbf, 0x21, 0x63, 0xc5, 0xc4, 0x04, 0x28, 0x19, 0xca, 0xc0, 0x8f, 0x40, + 0x77, 0x3e, 0x3b, 0x09, 0x71, 0x89, 0x84, 0xc4, 0x62, 0xfb, 0xde, 0xf7, 0xbe, 0xef, 0xde, 0xf7, + 0xde, 0x93, 0xc1, 0xe6, 0xd0, 0x41, 0x50, 0x1f, 0x94, 0x75, 0x32, 0xd4, 0x3c, 0x1f, 0x11, 0x24, + 0xad, 0xd1, 0x88, 0x36, 0x28, 0xcb, 0xdb, 0x36, 0xb2, 0x11, 0x8b, 0xe9, 0xf4, 0x2b, 0x84, 0xe5, + 0xab, 0x6d, 0x84, 0x5d, 0x84, 0x75, 0x17, 0xdb, 0x94, 0xe6, 0x62, 0x9b, 0x03, 0x5b, 0x86, 0xeb, + 0x40, 0xa4, 0xb3, 0x27, 0x0f, 0xed, 0x86, 0xb9, 0xad, 0x50, 0x24, 0x3c, 0x70, 0x48, 0xe1, 0x32, + 0xa6, 0x81, 0x2d, 0x7d, 0x50, 0x36, 0x2d, 0x62, 0x94, 0xf5, 0x36, 0x72, 0xe0, 0x02, 0x0e, 0x7b, + 0x31, 0x4e, 0x0f, 0x21, 0xae, 0xbe, 0x4b, 0x81, 0xb5, 0x06, 0xb6, 0xf7, 0x2d, 0xd8, 0x91, 0x1e, + 0x82, 0x8d, 0x03, 0x1f, 0xb9, 0x2d, 0xa3, 0xd3, 0xf1, 0x2d, 0x8c, 0x33, 0x62, 0x5e, 0x2c, 0xa4, + 0xeb, 0x99, 0x2f, 0x1f, 0x4b, 0xdb, 0xfc, 0xce, 0x5a, 0x88, 0xec, 0x13, 0xdf, 0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0x9c, 0x21, 0xc0, 0x71, 0xf9, 0xe6, 0xdf, + 0xf1, 0x48, 0x5d, 0x3e, 0xff, 0x92, 0x0e, 0xa9, 0x5e, 0x1b, 0x8d, 0x15, 0xf1, 0x64, 0xac, 0x88, + 0x3f, 0xc6, 0x8a, 0xf8, 0x76, 0xa2, 0x08, 0x27, 0x13, 0x45, 0xf8, 0x3a, 0x51, 0x84, 0xe7, 0xb7, + 0x66, 0xa6, 0x6d, 0x06, 0x3e, 0x24, 0xa5, 0xbe, 0x61, 0x62, 0x9d, 0xcd, 0x6d, 0x18, 0xbe, 0xd8, + 0xc8, 0xcd, 0x55, 0xf6, 0xf3, 0xbd, 0xfb, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x4a, 0x24, 0x83, + 0x36, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -366,6 +460,9 @@ type MsgClient interface { // SetPlatformPercentage defines the method for updating the platform // percentage fee SetPlatformPercentage(ctx context.Context, in *MsgSetPlatformPercentage, opts ...grpc.CallOption) (*MsgSetPlatformPercentageResponse, error) + // SetPlatformMinimum defines the method for updating the platform + // percentage fee + SetPlatformMinimum(ctx context.Context, in *MsgSetPlatformMinimum, opts ...grpc.CallOption) (*MsgSetPlatformMinimumResponse, error) } type msgClient struct { @@ -403,6 +500,15 @@ func (c *msgClient) SetPlatformPercentage(ctx context.Context, in *MsgSetPlatfor return out, nil } +func (c *msgClient) SetPlatformMinimum(ctx context.Context, in *MsgSetPlatformMinimum, opts ...grpc.CallOption) (*MsgSetPlatformMinimumResponse, error) { + out := new(MsgSetPlatformMinimumResponse) + err := c.cc.Invoke(ctx, "/xion.v1.Msg/SetPlatformMinimum", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // Send defines a method for sending coins from one account to another @@ -414,6 +520,9 @@ type MsgServer interface { // SetPlatformPercentage defines the method for updating the platform // percentage fee SetPlatformPercentage(context.Context, *MsgSetPlatformPercentage) (*MsgSetPlatformPercentageResponse, error) + // SetPlatformMinimum defines the method for updating the platform + // percentage fee + SetPlatformMinimum(context.Context, *MsgSetPlatformMinimum) (*MsgSetPlatformMinimumResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -429,6 +538,9 @@ func (*UnimplementedMsgServer) MultiSend(ctx context.Context, req *MsgMultiSend) func (*UnimplementedMsgServer) SetPlatformPercentage(ctx context.Context, req *MsgSetPlatformPercentage) (*MsgSetPlatformPercentageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetPlatformPercentage not implemented") } +func (*UnimplementedMsgServer) SetPlatformMinimum(ctx context.Context, req *MsgSetPlatformMinimum) (*MsgSetPlatformMinimumResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetPlatformMinimum not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -488,6 +600,24 @@ func _Msg_SetPlatformPercentage_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Msg_SetPlatformMinimum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetPlatformMinimum) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetPlatformMinimum(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/xion.v1.Msg/SetPlatformMinimum", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetPlatformMinimum(ctx, req.(*MsgSetPlatformMinimum)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "xion.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -504,6 +634,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SetPlatformPercentage", Handler: _Msg_SetPlatformPercentage_Handler, }, + { + MethodName: "SetPlatformMinimum", + Handler: _Msg_SetPlatformMinimum_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "xion/v1/tx.proto", @@ -715,6 +849,73 @@ func (m *MsgSetPlatformPercentageResponse) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } +func (m *MsgSetPlatformMinimum) 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 *MsgSetPlatformMinimum) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetPlatformMinimum) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Minimums) > 0 { + for iNdEx := len(m.Minimums) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Minimums[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetPlatformMinimumResponse) 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 *MsgSetPlatformMinimumResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetPlatformMinimumResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -813,6 +1014,34 @@ func (m *MsgSetPlatformPercentageResponse) Size() (n int) { return n } +func (m *MsgSetPlatformMinimum) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Minimums) > 0 { + for _, e := range m.Minimums { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgSetPlatformMinimumResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1336,6 +1565,172 @@ func (m *MsgSetPlatformPercentageResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSetPlatformMinimum) 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 ErrIntOverflowTx + } + 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: MsgSetPlatformMinimum: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetPlatformMinimum: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minimums", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Minimums = append(m.Minimums, types.Coin{}) + if err := m.Minimums[len(m.Minimums)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetPlatformMinimumResponse) 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 ErrIntOverflowTx + } + 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: MsgSetPlatformMinimumResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetPlatformMinimumResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0