diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index a7e4ee0a48..96844c2e72 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -96,12 +96,12 @@ message MsgOptOutResponse {} message MsgSetConsumerCommissionRate { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // The chain id of the consumer chain to set a commission rate - string chain_id = 1; // The validator address on the provider - string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - // The rate to charge delegators on the consumer chain, as a fraction - string rate = 3 [ + string provider_addr = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + // The chain id of the consumer chain to set a commission rate + string chain_id = 2; + // The rate to charge delegators on the consumer chain, as a fraction + string rate = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index d63f36997a..65473d3bcf 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -1011,7 +1011,7 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { s.Require().NoError(err) // check that the withdrawn coins is equal to the entire reward amount - // times the set consumer commission + // times the set consumer commission rate commission := rewards.Rewards.MulDec(tc.rate) c, _ := commission.TruncateDecimal() s.Require().Equal(withdrawnCoins, c) diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index ed92101e32..16511f8bde 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -280,3 +280,23 @@ func (k Keeper) IdentifyConsumerChainIDFromIBCPacket(ctx sdk.Context, packet cha return chainID, nil } + +// HandleSetConsumerCommissionRate sets a per-consumer chain commission rate for the given provider address +// on the condition that the given consumer chain exists. +func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { + // check that the consumer chain exists + if !k.IsConsumerProposedOrRegistered(ctx, chainID) { + return errorsmod.Wrapf( + types.ErrUnknownConsumerChainId, + "unknown consumer chain, with id: %s", chainID) + } + // set per-consumer chain commission rate for the validator address + k.SetConsumerCommissionRate( + ctx, + chainID, + providerAddr, + commissionRate, + ) + + return nil +} diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index e2899d4962..ec73d85383 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1287,9 +1287,6 @@ func (k Keeper) GetConsumerCommissionRate( return cr, true } -<<<<<<< Updated upstream -// DeleteConsumerCommissionRate deletes the per-consumer chain commission rate -======= // GetAllCommissionRateValidators returns all the validator address // that set a commission rate for the given chain ID func (k Keeper) GetAllCommissionRateValidators( @@ -1310,7 +1307,6 @@ func (k Keeper) GetAllCommissionRateValidators( } // DeleteConsumerCommissionRate the per-consumer chain commission rate ->>>>>>> Stashed changes // associated to the given validator address func (k Keeper) DeleteConsumerCommissionRate( ctx sdk.Context, diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 42b59fc737..9e019bcb22 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -217,5 +217,14 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M return nil, err } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeSetConsumerCommissionRate, + sdk.NewAttribute(types.AttributeConsumerChainID, msg.ChainId), + sdk.NewAttribute(types.AttributeProviderValidatorAddress, msg.ProviderAddr), + sdk.NewAttribute(types.AttributeConsumerCommissionRate, msg.Rate.String()), + ), + }) + return &types.MsgSetConsumerCommissionRateResponse{}, nil } diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 97c9107270..bf76e7d7c8 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -61,21 +61,3 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types return nil } - -func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { - // check that the consumer chain exists - if !k.IsConsumerProposedOrRegistered(ctx, chainID) { - return errorsmod.Wrapf( - types.ErrUnknownConsumerChainId, - "unknown consumer chain, with id: %s", chainID) - } - // set per-consumer chain commission rate for the validator address - k.SetConsumerCommissionRate( - ctx, - chainID, - providerAddr, - commissionRate, - ) - - return nil -} diff --git a/x/ccv/provider/types/events.go b/x/ccv/provider/types/events.go index 58d686020f..4838c1ba43 100644 --- a/x/ccv/provider/types/events.go +++ b/x/ccv/provider/types/events.go @@ -7,6 +7,7 @@ const ( EventTypeAddConsumerRewardDenom = "add_consumer_reward_denom" EventTypeRemoveConsumerRewardDenom = "remove_consumer_reward_denom" EventTypeExecuteConsumerChainSlash = "execute_consumer_chain_slash" + EventTypeSetConsumerCommissionRate = "set_consumer_commission_rate" AttributeInfractionHeight = "infraction_height" AttributeInitialHeight = "initial_height" AttributeInitializationTimeout = "initialization_timeout" @@ -15,4 +16,6 @@ const ( AttributeProviderValidatorAddress = "provider_validator_address" AttributeConsumerConsensusPubKey = "consumer_consensus_pub_key" AttributeConsumerRewardDenom = "consumer_reward_denom" + AttributeConsumerCommissionRate = "consumer_commission_rate" + AttributeConsumerChainID = "consumer_chain_id" ) diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 9c4cf5c7a6..7330433f5b 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -430,11 +430,11 @@ var xxx_messageInfo_MsgOptOutResponse proto.InternalMessageInfo // MsgSetConsumerCommissionRate allows validators to set // a per-consumer chain commission rate type MsgSetConsumerCommissionRate struct { - // The chain id of the consumer chain to assign a consensus public key to - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // The validator address on the provider - ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` - // The rate to charge delegators on the consumer chain + ProviderAddr string `protobuf:"bytes,1,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` + // The chain id of the consumer chain to set a commission rate + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // The rate to charge delegators on the consumer chain, as a fraction Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` } @@ -527,55 +527,57 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 763 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcd, 0x4e, 0x14, 0x4b, - 0x14, 0x9e, 0x86, 0x0b, 0x17, 0x0a, 0xee, 0xcd, 0xa5, 0x2f, 0x04, 0x98, 0xe0, 0x8c, 0x8e, 0x0a, - 0x2e, 0x98, 0xee, 0x80, 0x7f, 0x91, 0xe8, 0x82, 0x01, 0x13, 0xd1, 0x4c, 0x20, 0x4d, 0x82, 0x89, - 0x0b, 0x3b, 0xdd, 0xd5, 0x87, 0x9e, 0x0a, 0xd3, 0x55, 0x93, 0xae, 0xea, 0x0e, 0xf3, 0x06, 0x24, - 0x6e, 0x74, 0x65, 0xdc, 0xf1, 0x00, 0x2e, 0x7d, 0x08, 0x56, 0x86, 0xb8, 0x22, 0x2e, 0x88, 0x81, - 0x8d, 0x6b, 0x9f, 0xc0, 0x4c, 0xf5, 0xcf, 0x34, 0x61, 0x1c, 0x7e, 0x0c, 0x71, 0x35, 0x53, 0xe7, - 0x7c, 0x75, 0xbe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 0x50, 0x6a, 0x45, 0x81, 0xf3, 0x92, 0x31, 0x9c, - 0x00, 0x17, 0x1d, 0xc7, 0x57, 0x6f, 0xa0, 0x61, 0x1c, 0x53, 0x98, 0x5b, 0xd0, 0x9c, 0xe8, 0x95, - 0x75, 0x87, 0x70, 0x9b, 0x76, 0x61, 0x60, 0x67, 0xb7, 0x98, 0xfb, 0xbe, 0x5b, 0xcc, 0x95, 0x0a, - 0x68, 0xaa, 0x93, 0x30, 0x03, 0x78, 0x83, 0x51, 0x0e, 0xa5, 0x0f, 0x0a, 0xba, 0x56, 0xe5, 0xee, - 0x7a, 0x60, 0x7b, 0x44, 0x24, 0x80, 0x2a, 0xe1, 0x36, 0xd4, 0xac, 0x90, 0xb0, 0xc0, 0x57, 0xa7, - 0xd0, 0x20, 0x97, 0x59, 0x01, 0x7e, 0xec, 0xa1, 0x1d, 0x50, 0xd7, 0xd0, 0xb0, 0x97, 0x41, 0x4b, - 0x13, 0x43, 0xf3, 0xb3, 0x1a, 0xb1, 0xb1, 0x96, 0x6d, 0xb1, 0x96, 0x69, 0x6a, 0x38, 0xa7, 0x65, - 0x19, 0x8c, 0x13, 0x15, 0x32, 0xda, 0x67, 0xd0, 0xed, 0xae, 0xd2, 0x52, 0x13, 0x3b, 0x3d, 0x1d, - 0x4c, 0x2c, 0xb3, 0xc0, 0xae, 0xc3, 0x06, 0x13, 0x84, 0xba, 0x67, 0x98, 0x30, 0xd1, 0xb8, 0x13, - 0x34, 0xea, 0x04, 0x5b, 0x02, 0xcc, 0x90, 0x09, 0x30, 0x93, 0xef, 0x1b, 0xfb, 0x99, 0xc9, 0xca, - 0x97, 0x27, 0x40, 0x5b, 0x4e, 0x36, 0x6c, 0x30, 0x01, 0x4f, 0x63, 0xb8, 0x31, 0xe6, 0x74, 0x0a, - 0xab, 0xaf, 0xd1, 0x38, 0xa1, 0x9b, 0xbe, 0x85, 0x05, 0x61, 0xd4, 0xb4, 0xeb, 0x0c, 0x6f, 0x99, - 0x35, 0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 0xfe, 0xfb, 0x35, 0xba, 0xc8, 0x3d, 0x31, - 0x96, 0x2e, 0x29, 0x37, 0x5b, 0xe3, 0xb2, 0x72, 0x3b, 0x0d, 0x05, 0xd5, 0x43, 0x7d, 0xd1, 0x40, - 0x28, 0x9f, 0xb7, 0xa8, 0x84, 0xe7, 0xef, 0x5f, 0x08, 0x9e, 0xd2, 0x35, 0x50, 0x7f, 0x7c, 0xbd, - 0xb5, 0x0b, 0x14, 0x58, 0x0d, 0x44, 0xfe, 0xc1, 0xc5, 0xf0, 0x09, 0x63, 0xe5, 0xe5, 0xde, 0x51, - 0x41, 0xd9, 0x3f, 0x2a, 0x28, 0xdf, 0x8e, 0x0a, 0xca, 0xdb, 0xe3, 0x42, 0x6e, 0xff, 0xb8, 0x90, - 0x3b, 0x38, 0x2e, 0xe4, 0x5e, 0x3d, 0x39, 0x7d, 0xc5, 0xda, 0x14, 0xe5, 0xf4, 0x15, 0x13, 0xde, - 0xd3, 0xb7, 0x4f, 0x3e, 0x65, 0xe4, 0xed, 0xb3, 0xfb, 0xe5, 0x43, 0xe0, 0xee, 0xcf, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x29, 0x8c, 0x94, 0x31, 0xfb, 0x08, 0x00, 0x00, + // 787 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcd, 0x4f, 0xd4, 0x4e, + 0x18, 0xde, 0xc2, 0xef, 0xc7, 0xc7, 0x80, 0x46, 0x2a, 0x04, 0x68, 0x70, 0x57, 0x57, 0x05, 0x0f, + 0x6c, 0x1b, 0xf0, 0x2b, 0x12, 0x3d, 0xb0, 0x60, 0x22, 0x9a, 0x0d, 0xa4, 0x24, 0x98, 0x78, 0xb0, + 0x69, 0xa7, 0x43, 0x77, 0xc2, 0x76, 0xa6, 0xe9, 0x4c, 0x1b, 0xf6, 0xee, 0x81, 0xc4, 0x8b, 0x9e, + 0x8c, 0x37, 0xae, 0x26, 0x1e, 0xfd, 0x23, 0x38, 0x19, 0xe2, 0xc9, 0x78, 0x20, 0x06, 0x2e, 0x9e, + 0xfd, 0x0b, 0xcc, 0x4e, 0x3f, 0xb6, 0x1b, 0x96, 0x65, 0x81, 0x18, 0x4f, 0xbb, 0x33, 0xef, 0x33, + 0xcf, 0xfb, 0x3c, 0x6f, 0xa7, 0x4f, 0x0a, 0x66, 0x31, 0xe1, 0xc8, 0x87, 0x55, 0x13, 0x13, 0x83, + 0x21, 0x18, 0xf8, 0x98, 0xd7, 0x35, 0x08, 0x43, 0xcd, 0xf3, 0x69, 0x88, 0x6d, 0xe4, 0x6b, 0xe1, + 0x9c, 0xc6, 0xb7, 0x55, 0xcf, 0xa7, 0x9c, 0xca, 0x37, 0xdb, 0xa0, 0x55, 0x08, 0x43, 0x35, 0x41, + 0xab, 0xe1, 0x9c, 0x32, 0xea, 0x50, 0x87, 0x0a, 0xbc, 0xd6, 0xf8, 0x17, 0x1d, 0x55, 0x26, 0x21, + 0x65, 0x2e, 0x65, 0x46, 0x54, 0x88, 0x16, 0x49, 0xc9, 0xa1, 0xd4, 0xa9, 0x21, 0x4d, 0xac, 0xac, + 0x60, 0x53, 0x33, 0x49, 0x3d, 0x2e, 0x69, 0xd8, 0x82, 0x5a, 0x0d, 0x3b, 0x55, 0x0e, 0x6b, 0x18, + 0x11, 0xce, 0x34, 0x8e, 0x88, 0x8d, 0x7c, 0x17, 0x13, 0x2e, 0x94, 0xa5, 0xab, 0xf8, 0x40, 0x21, + 0x53, 0xe7, 0x75, 0x0f, 0x31, 0x0d, 0x35, 0x84, 0x11, 0x88, 0x22, 0x40, 0xf1, 0x83, 0x04, 0x46, + 0x2b, 0xcc, 0x59, 0x64, 0x0c, 0x3b, 0x64, 0x89, 0x12, 0x16, 0xb8, 0xc8, 0x7f, 0x81, 0xea, 0xf2, + 0x24, 0x18, 0x88, 0x8c, 0x61, 0x7b, 0x42, 0xba, 0x2e, 0xdd, 0x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0x8c, 0xcf, 0xbf, 0xe9, 0x07, 0xbd, 0x15, 0xe6, 0xc8, 0xef, + 0x25, 0x30, 0x72, 0x3c, 0xd2, 0x1e, 0xa9, 0x5d, 0xe4, 0xb5, 0xda, 0x2e, 0x74, 0x94, 0xc5, 0x73, + 0x1f, 0x4d, 0xb4, 0xc9, 0x9f, 0x25, 0xa0, 0x74, 0x08, 0xab, 0x72, 0xb7, 0x1d, 0x4e, 0xe6, 0x50, + 0x9e, 0x5f, 0x9c, 0xa3, 0x83, 0xdc, 0x96, 0x58, 0x3a, 0xa7, 0xdc, 0x2c, 0xc7, 0x79, 0xe5, 0xb6, + 0x0b, 0x05, 0xd9, 0x05, 0xff, 0x47, 0x81, 0x50, 0xea, 0x96, 0x54, 0xc0, 0x95, 0xfb, 0x67, 0x82, + 0xa7, 0xed, 0x3c, 0xd0, 0x17, 0xbf, 0xde, 0xea, 0x19, 0x08, 0x56, 0x03, 0xae, 0x3c, 0x38, 0x1b, + 0x3e, 0xed, 0xf8, 0x49, 0x02, 0x93, 0x27, 0xbf, 0xd0, 0x5d, 0xdf, 0xcf, 0x13, 0x29, 0x94, 0x95, + 0x0b, 0x53, 0x24, 0x5a, 0xcb, 0x2f, 0xf7, 0x0e, 0xf3, 0xd2, 0xfe, 0x61, 0x5e, 0xfa, 0x79, 0x98, + 0x97, 0xde, 0x1d, 0xe5, 0x73, 0xfb, 0x47, 0xf9, 0xdc, 0xf7, 0xa3, 0x7c, 0xee, 0xd5, 0x93, 0xe3, + 0x71, 0xd0, 0xec, 0x5a, 0x4a, 0xbf, 0xb8, 0xc2, 0x7b, 0xda, 0x76, 0xeb, 0x67, 0x97, 0x48, 0x0a, + 0xab, 0x4f, 0x7c, 0xb4, 0xdc, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x76, 0xb7, 0xbf, 0x16, 0xa7, + 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -595,6 +597,7 @@ type MsgClient interface { SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) } type msgClient struct { @@ -650,6 +653,15 @@ func (c *msgClient) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.Call return out, nil } +func (c *msgClient) SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) { + out := new(MsgSetConsumerCommissionRateResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { AssignConsumerKey(context.Context, *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) @@ -657,6 +669,7 @@ type MsgServer interface { SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) OptIn(context.Context, *MsgOptIn) (*MsgOptInResponse, error) OptOut(context.Context, *MsgOptOut) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(context.Context, *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -678,6 +691,9 @@ func (*UnimplementedMsgServer) OptIn(ctx context.Context, req *MsgOptIn) (*MsgOp func (*UnimplementedMsgServer) OptOut(ctx context.Context, req *MsgOptOut) (*MsgOptOutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method OptOut not implemented") } +func (*UnimplementedMsgServer) SetConsumerCommissionRate(ctx context.Context, req *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetConsumerCommissionRate not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -773,6 +789,24 @@ func _Msg_OptOut_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Msg_SetConsumerCommissionRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetConsumerCommissionRate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, req.(*MsgSetConsumerCommissionRate)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.provider.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -797,6 +831,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "OptOut", Handler: _Msg_OptOut_Handler, }, + { + MethodName: "SetConsumerCommissionRate", + Handler: _Msg_SetConsumerCommissionRate_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/provider/v1/tx.proto", @@ -1168,18 +1206,18 @@ func (m *MsgSetConsumerCommissionRate) MarshalToSizedBuffer(dAtA []byte) (int, e } i-- dAtA[i] = 0x1a - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) - i-- - dAtA[i] = 0x12 - } if len(m.ChainId) > 0 { i -= len(m.ChainId) copy(dAtA[i:], m.ChainId) i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- + dAtA[i] = 0x12 + } + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -1367,11 +1405,11 @@ func (m *MsgSetConsumerCommissionRate) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ProviderAddr) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ProviderAddr) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -2354,7 +2392,7 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2382,11 +2420,11 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2414,7 +2452,7 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 {