diff --git a/CHANGELOG.md b/CHANGELOG.md index 698d90a0..4f9b9f16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,9 +14,14 @@ - Ensure native oracle denoms are always on whitelist and registered as vote targets when updating fee abstraction params - Validate rewards baseDenom using sdk.ValidateDenom to enforce proper denom format (min 3 chars, valid characters, no leading digits) - Ensure feeTokens is not nil at genesis +- Ensure feeTokenMetadata initial prices after updateFeeTokenMetadata is picked up from oracle - Use `DecCoins.Validate()` on `RewardPool.ValidateGenesis` to catch malformed denom formats, duplicate denoms, bad ordering - Enforce denom consistency in `GenesisState.Validate` with `Params.TokenDenom` +### Removed + +- Removed price field input in updateTokenMetadata request + ## v7.1.0-mainnet - 2026-03-13 ### Fixed diff --git a/proto/kiichain/feeabstraction/v1beta1/params.proto b/proto/kiichain/feeabstraction/v1beta1/params.proto index a2f10c37..d6611bf5 100644 --- a/proto/kiichain/feeabstraction/v1beta1/params.proto +++ b/proto/kiichain/feeabstraction/v1beta1/params.proto @@ -40,7 +40,7 @@ message FeeTokenMetadata { (gogoproto.nullable) = false ]; // Enabled indicates if the token is enabled for fee abstraction - bool enabled = 6; + bool enabled = 5; } // Defines a collection of fee token metadata diff --git a/proto/kiichain/feeabstraction/v1beta1/tx.proto b/proto/kiichain/feeabstraction/v1beta1/tx.proto index 2b47aacf..d08d733e 100644 --- a/proto/kiichain/feeabstraction/v1beta1/tx.proto +++ b/proto/kiichain/feeabstraction/v1beta1/tx.proto @@ -45,10 +45,29 @@ message MsgUpdateFeeTokens { // authority is the address of the governance account. string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // fee_tokens defines the fee tokens to update. - FeeTokenMetadataCollection fee_tokens = 2 [ (gogoproto.nullable) = false ]; + // tokens defines the fee tokens to update. + UpdateTokenMetadataCollection tokens = 2 [ (gogoproto.nullable) = false ]; } +// UpdateTokenMetadata defines the metadata for a fee token to be updated +message UpdateTokenMetadata { + // Denom is the token denom + string denom = 1; + // Identifier on the oracle module + string oracle_denom = 2; + // Decimals is the number of decimals for the token + uint32 decimals = 3; + // Enabled indicates if the token is enabled for fee abstraction + bool enabled = 4; +} + +// Defines a collection of fee token metadata to be updated +message UpdateTokenMetadataCollection { + // Items is a repeated field of UpdateTokenMetadata + repeated UpdateTokenMetadata items = 1 [ (gogoproto.nullable) = false ]; +} + + // MsgUpdateFeeTokensResponse defines the response structure for update fee // tokens message MsgUpdateFeeTokensResponse {} diff --git a/x/feeabstraction/README.md b/x/feeabstraction/README.md index 75f1725c..cc93dabf 100644 --- a/x/feeabstraction/README.md +++ b/x/feeabstraction/README.md @@ -115,13 +115,6 @@ message Params { ]; // TwapLookbackWindow is the lookback window for calculating TWAPs uint64 twap_lookback_window = 5; - // FallbackNativePrice is the fallback price for the native token if the - // oracle price is not available (in USD) - string fallback_native_price = 6 [ - (gogoproto.moretags) = "yaml:\"fallback_native_price\"", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; } ``` @@ -147,7 +140,7 @@ message FeeTokenMetadata { (gogoproto.nullable) = false ]; // Enabled indicates if the token is enabled for fee abstraction - bool enabled = 6; + bool enabled = 5; } // Defines a collection of fee token metadata @@ -188,6 +181,7 @@ Only the governance account can update the fee tokens, and it requires a valid s On each update, all fee tokens must be provided, even if they are not changed: - Ordering is important, since the balance will be calculated based on the order of the fee tokens. +- Prices are always set to zero so that BeginBlocker adopts the current TWAP. It is defined as: @@ -200,8 +194,26 @@ message MsgUpdateFeeTokens { // authority is the address of the governance account. string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // fee_tokens defines the fee tokens to update. - FeeTokenMetadataCollection fee_tokens = 2 [ (gogoproto.nullable) = false ]; + // tokens defines the fee tokens to update. + UpdateTokenMetadataCollection tokens = 2 [ (gogoproto.nullable) = false ]; +} + +// UpdateTokenMetadata defines the metadata for a fee token to be updated +message UpdateTokenMetadata { + // Denom is the token denom + string denom = 1; + // Identifier on the oracle module + string oracle_denom = 2; + // Decimals is the number of decimals for the token + uint32 decimals = 3; + // Enabled indicates if the token is enabled for fee abstraction + bool enabled = 4; +} + +// Defines a collection of fee token metadata to be updated +message UpdateTokenMetadataCollection { + // Items is a repeated field of UpdateTokenMetadata + repeated UpdateTokenMetadata items = 1 [ (gogoproto.nullable) = false ]; } ``` diff --git a/x/feeabstraction/keeper/msg_server.go b/x/feeabstraction/keeper/msg_server.go index 816b7512..9b6c2406 100644 --- a/x/feeabstraction/keeper/msg_server.go +++ b/x/feeabstraction/keeper/msg_server.go @@ -4,6 +4,7 @@ import ( "context" "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -103,14 +104,23 @@ func (ms MsgServer) UpdateFeeTokens(ctx context.Context, msg *types.MsgUpdateFee for _, denom := range voteTargets { voteTargetMap[denom] = struct{}{} } - for _, feeToken := range msg.FeeTokens.Items { + for _, feeToken := range msg.Tokens.Items { if _, ok := voteTargetMap[feeToken.OracleDenom]; !ok { return nil, sdkerrors.ErrInvalidRequest.Wrapf("fee token denom %s is not registered on the oracle module", feeToken.OracleDenom) } } + // Zero out all token prices so BeginBlocker adopts the current TWAP immediately + // rather than being clamped from a stale governance-submitted price. + // Clamp skip can be found here on /x/feeabstraction/types/fee.go#L55 + resetItems := make([]types.FeeTokenMetadata, len(msg.Tokens.Items)) + for i, token := range msg.Tokens.Items { + resetItems[i] = types.NewFeeTokenMetadata(token.Denom, token.OracleDenom, token.Decimals, math.LegacyZeroDec()) + } + resetFeeTokens := types.NewFeeTokenMetadataCollection(resetItems...) + // Update the fee tokens - if err := ms.FeeTokens.Set(ctx, msg.FeeTokens); err != nil { + if err := ms.FeeTokens.Set(ctx, *resetFeeTokens); err != nil { return nil, sdkerrors.ErrInvalidRequest.Wrapf("failed to update fee tokens: %s", err) } diff --git a/x/feeabstraction/keeper/msg_server_test.go b/x/feeabstraction/keeper/msg_server_test.go index de497966..7c67a91e 100644 --- a/x/feeabstraction/keeper/msg_server_test.go +++ b/x/feeabstraction/keeper/msg_server_test.go @@ -1,8 +1,6 @@ package keeper_test import ( - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -129,10 +127,10 @@ func (s *KeeperTestSuite) TestUpdateParams() { // TestUpdateFeeTokens tests the UpdateFeeTokens method func (s *KeeperTestSuite) TestUpdateFeeTokens() { - defaultFeeTokens := types.NewFeeTokenMetadataCollection( - types.NewFeeTokenMetadata("one", "oracleone", 6, math.LegacyMustNewDecFromStr("0.01")), - types.NewFeeTokenMetadata("two", "oracletwo", 6, math.LegacyMustNewDecFromStr("0.01")), - types.NewFeeTokenMetadata("three", "oraclethree", 6, math.LegacyMustNewDecFromStr("0.01"))) + defaultFeeTokens := types.NewUpdateTokenMetadataCollection( + types.NewUpdateTokenMetadata("one", "oracleone", 6), + types.NewUpdateTokenMetadata("two", "oracletwo", 6), + types.NewUpdateTokenMetadata("three", "oraclethree", 6)) // Prepare all the test cases testCases := []struct { @@ -183,7 +181,7 @@ func (s *KeeperTestSuite) TestUpdateFeeTokens() { name: "invalid - wrong authority", msg: &types.MsgUpdateFeeTokens{ Authority: authtypes.NewModuleAddress(types.ModuleName).String(), - FeeTokens: *defaultFeeTokens, + Tokens: *defaultFeeTokens, }, errContains: "expected gov account as only signer for proposal message", }, @@ -191,8 +189,8 @@ func (s *KeeperTestSuite) TestUpdateFeeTokens() { name: "invalid - invalid fee tokens (bad denom)", msg: types.NewMessageUpdateFeeTokens( authtypes.NewModuleAddress(govtypes.ModuleName).String(), - *types.NewFeeTokenMetadataCollection( - types.NewFeeTokenMetadata("invalid denom!", "oracleCoin", 6, math.LegacyMustNewDecFromStr("0.01")), + *types.NewUpdateTokenMetadataCollection( + types.NewUpdateTokenMetadata("invalid denom!", "oracleCoin", 6), ), ), errContains: "denom is invalid: invalid fee token metadata: invalid request", @@ -223,7 +221,13 @@ func (s *KeeperTestSuite) TestUpdateFeeTokens() { // Verify the fee tokens were updated tokens, err := s.keeper.FeeTokens.Get(cachedCtx) s.Require().NoError(err) - s.Require().Equal(tc.msg.FeeTokens, tokens) + s.Require().Len(tokens.Items, len(tc.msg.Tokens.Items)) + for i, token := range tokens.Items { + s.Require().Equal(tc.msg.Tokens.Items[i].Denom, token.Denom) + s.Require().Equal(tc.msg.Tokens.Items[i].OracleDenom, token.OracleDenom) + s.Require().Equal(tc.msg.Tokens.Items[i].Decimals, token.Decimals) + s.Require().True(token.Price.IsZero(), "expected price to be 0 for denom %s, got %s", token.Denom, token.Price) + } } }) } diff --git a/x/feeabstraction/types/msg.go b/x/feeabstraction/types/msg.go index fa8fa5f9..764be88d 100644 --- a/x/feeabstraction/types/msg.go +++ b/x/feeabstraction/types/msg.go @@ -37,10 +37,10 @@ func (msg *MsgUpdateParams) Validate() error { } // NewMessageUpdateFeeTokens creates a new MsgUpdateFeeTokens instance -func NewMessageUpdateFeeTokens(authority string, feeTokens FeeTokenMetadataCollection) *MsgUpdateFeeTokens { +func NewMessageUpdateFeeTokens(authority string, tokens UpdateTokenMetadataCollection) *MsgUpdateFeeTokens { return &MsgUpdateFeeTokens{ Authority: authority, - FeeTokens: feeTokens, + Tokens: tokens, } } @@ -52,5 +52,5 @@ func (msg *MsgUpdateFeeTokens) Validate() error { } // Validate the fee tokens - return msg.FeeTokens.Validate() + return msg.Tokens.Validate() } diff --git a/x/feeabstraction/types/msg_test.go b/x/feeabstraction/types/msg_test.go index 35cfef07..5f08fa08 100644 --- a/x/feeabstraction/types/msg_test.go +++ b/x/feeabstraction/types/msg_test.go @@ -5,8 +5,6 @@ import ( "github.com/stretchr/testify/require" - "cosmossdk.io/math" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -78,23 +76,23 @@ func TestMsgUpdateFeeTokensValidate(t *testing.T) { name: "valid - empty fee tokens", msg: types.NewMessageUpdateFeeTokens( authtypes.NewModuleAddress(govtypes.ModuleName).String(), - *types.NewFeeTokenMetadataCollection(), + *types.NewUpdateTokenMetadataCollection(), ), }, { name: "valid - fee tokens", msg: types.NewMessageUpdateFeeTokens( authtypes.NewModuleAddress(govtypes.ModuleName).String(), - *types.NewFeeTokenMetadataCollection( - types.NewFeeTokenMetadata("coin", "oracleCoin", 6, math.LegacyMustNewDecFromStr("0.01")), + *types.NewUpdateTokenMetadataCollection( + types.NewUpdateTokenMetadata("coin", "oracleCoin", 6), ), ), }, { name: "invalid - empty authority", msg: types.NewMessageUpdateFeeTokens("", - *types.NewFeeTokenMetadataCollection( - types.NewFeeTokenMetadata("coin", "oracleCoin", 6, math.LegacyMustNewDecFromStr("0.01")), + *types.NewUpdateTokenMetadataCollection( + types.NewUpdateTokenMetadata("coin", "oracleCoin", 6), ), ), errContains: "empty address string is not allowed", @@ -103,9 +101,9 @@ func TestMsgUpdateFeeTokensValidate(t *testing.T) { name: "invalid - duplicate fee tokens", msg: types.NewMessageUpdateFeeTokens( authtypes.NewModuleAddress(govtypes.ModuleName).String(), - *types.NewFeeTokenMetadataCollection( - types.NewFeeTokenMetadata("coin", "oracleCoin", 6, math.LegacyMustNewDecFromStr("0.01")), - types.NewFeeTokenMetadata("coin", "oracleCoin", 6, math.LegacyMustNewDecFromStr("0.01")), + *types.NewUpdateTokenMetadataCollection( + types.NewUpdateTokenMetadata("coin", "oracleCoin", 6), + types.NewUpdateTokenMetadata("coin", "oracleCoin", 6), ), ), errContains: "duplicate denom found: coin: invalid fee token metadata", diff --git a/x/feeabstraction/types/params.go b/x/feeabstraction/types/params.go index 635d6b5e..1d2291b5 100644 --- a/x/feeabstraction/types/params.go +++ b/x/feeabstraction/types/params.go @@ -134,3 +134,64 @@ func (c *FeeTokenMetadataCollection) Validate() error { return nil } + +// NewUpdateTokenMetadata creates a new fee token with the given denom and decimals +func NewUpdateTokenMetadata( + denom, oracleDenom string, + decimals uint32, +) UpdateTokenMetadata { + return UpdateTokenMetadata{ + Denom: denom, + OracleDenom: oracleDenom, + Decimals: decimals, + Enabled: true, + } +} + +// Validate validates the UpdateTokenMetadata +func (f UpdateTokenMetadata) Validate() error { + // Validate the denom + if err := sdk.ValidateDenom(f.Denom); err != nil { + return errorsmod.Wrap(ErrInvalidFeeTokenMetadata, "denom is invalid") + } + // Validate the oracle denom + if err := sdk.ValidateDenom(f.OracleDenom); err != nil { + return errorsmod.Wrap(ErrInvalidFeeTokenMetadata, "oracle denom is invalid") + } + + // Validate the decimals, must be between bigger than 0 and less than or equal to 18 + if f.Decimals < 1 || f.Decimals > 18 { + return errorsmod.Wrap(ErrInvalidFeeTokenMetadata, "decimals must be between 1 and 18") + } + + return nil +} + +// NewUpdateTokenMetadataCollection creates a new UpdateTokenMetadataCollection +func NewUpdateTokenMetadataCollection(tokens ...UpdateTokenMetadata) *UpdateTokenMetadataCollection { + return &UpdateTokenMetadataCollection{ + Items: tokens, + } +} + +// Validate validates the UpdateTokenMetadataCollection +func (c *UpdateTokenMetadataCollection) Validate() error { + // Check if the collection is nil + if c == nil { + return errorsmod.Wrap(ErrInvalidFeeTokenMetadata, "fee token metadata collection cannot be nil") + } + + // Validate each fee token metadata and check for duplicates + denomSet := make(map[string]struct{}) + for _, token := range c.Items { + if err := token.Validate(); err != nil { + return err + } + if _, exists := denomSet[token.Denom]; exists { + return errorsmod.Wrapf(ErrInvalidFeeTokenMetadata, "duplicate denom found: %s", token.Denom) + } + denomSet[token.Denom] = struct{}{} + } + + return nil +} diff --git a/x/feeabstraction/types/params.pb.go b/x/feeabstraction/types/params.pb.go index 72c568d1..80d88e3e 100644 --- a/x/feeabstraction/types/params.pb.go +++ b/x/feeabstraction/types/params.pb.go @@ -112,7 +112,7 @@ type FeeTokenMetadata struct { // So, this equals to the token/native denom Price cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=price,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price" yaml:"price"` // Enabled indicates if the token is enabled for fee abstraction - Enabled bool `protobuf:"varint,6,opt,name=enabled,proto3" json:"enabled,omitempty"` + Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"` } func (m *FeeTokenMetadata) Reset() { *m = FeeTokenMetadata{} } @@ -233,36 +233,36 @@ func init() { } var fileDescriptor_4c9ebe382042ec91 = []byte{ - // 456 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x8b, 0xd3, 0x4e, - 0x1c, 0x6d, 0x76, 0xdb, 0xfe, 0xf7, 0x3f, 0xad, 0xa0, 0xd9, 0x1e, 0x42, 0x85, 0xb4, 0xe6, 0xd4, - 0x83, 0x4c, 0xac, 0xbd, 0xed, 0xb1, 0x2e, 0x0b, 0xc2, 0x16, 0x25, 0x08, 0x82, 0x20, 0xe5, 0x97, - 0xc9, 0x6f, 0xdb, 0x21, 0x99, 0xfc, 0x42, 0x32, 0x6e, 0xed, 0x17, 0xf0, 0xec, 0xc7, 0xda, 0x83, - 0x87, 0x3d, 0x8a, 0x87, 0x22, 0xed, 0x37, 0xf0, 0x13, 0x48, 0x26, 0x6d, 0xe9, 0x16, 0x41, 0x6f, - 0xf3, 0xe6, 0xbd, 0x79, 0xcc, 0x7b, 0x3c, 0xf6, 0x3c, 0x96, 0x52, 0xcc, 0x41, 0xa6, 0xfe, 0x0d, - 0x22, 0x84, 0x85, 0xce, 0x41, 0x68, 0x49, 0xa9, 0x7f, 0x3b, 0x0c, 0x51, 0xc3, 0xd0, 0xcf, 0x20, - 0x07, 0x55, 0xf0, 0x2c, 0x27, 0x4d, 0x76, 0x6f, 0xa7, 0xe6, 0x0f, 0xd5, 0x7c, 0xab, 0xee, 0x76, - 0x66, 0x34, 0x23, 0xa3, 0xf5, 0xcb, 0x53, 0xf5, 0xcc, 0xfb, 0x72, 0xc2, 0x9a, 0x6f, 0x8d, 0x8f, - 0xfd, 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x7f, 0x14, 0xec, 0xb1, 0xfd, 0x9a, 0x35, 0xb2, - 0x5c, 0x0a, 0xdc, 0x66, 0x1e, 0xfd, 0x5b, 0xe6, 0x76, 0x95, 0xd9, 0xbc, 0xf4, 0x82, 0xca, 0xe1, - 0xb0, 0xdf, 0xe6, 0x83, 0x7e, 0xbd, 0x98, 0x75, 0x8f, 0xd3, 0xbc, 0xa2, 0x24, 0x41, 0xb3, 0x09, - 0x7b, 0xc2, 0x1a, 0x52, 0xa3, 0x2a, 0x1c, 0xab, 0x7f, 0x3a, 0x68, 0xbd, 0x1c, 0xf2, 0xbf, 0x8c, - 0x87, 0x1f, 0x7b, 0x8d, 0xeb, 0xe5, 0xaf, 0x83, 0xca, 0x65, 0x3c, 0xb9, 0x5b, 0xbb, 0xd6, 0xfd, - 0xda, 0xb5, 0x7e, 0xae, 0x5d, 0xeb, 0xeb, 0xc6, 0xad, 0xdd, 0x6f, 0xdc, 0xda, 0xf7, 0x8d, 0x5b, - 0xfb, 0x30, 0x9a, 0x49, 0x3d, 0xff, 0x14, 0x72, 0x41, 0xca, 0xdf, 0xcf, 0x79, 0x7f, 0xf8, 0x7c, - 0xbc, 0x6c, 0xbd, 0xcc, 0xb0, 0x08, 0x9b, 0x66, 0x9a, 0xa3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x48, 0x96, 0xe4, 0x25, 0x01, 0x03, 0x00, 0x00, + // 454 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x8b, 0xd3, 0x40, + 0x18, 0x6d, 0x76, 0xdb, 0x75, 0x9d, 0x56, 0xd0, 0x6c, 0x0f, 0xa1, 0x42, 0x5a, 0x73, 0xea, 0x41, + 0x26, 0xd6, 0xde, 0xf6, 0x58, 0x97, 0x05, 0x61, 0x8b, 0x12, 0x04, 0x41, 0x90, 0xf2, 0x65, 0xf2, + 0x6d, 0x3b,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 0x5c, 0xbb, 0xb5, 0x4f, + 0xc3, 0xa9, 0xd4, 0xb3, 0x2f, 0x21, 0x17, 0xa4, 0xfc, 0xdd, 0x9c, 0x77, 0x87, 0xaf, 0x87, 0xcb, + 0xd6, 0x8b, 0x0c, 0x8b, 0xf0, 0xc4, 0x4c, 0x73, 0xf8, 0x37, 0x00, 0x00, 0xff, 0xff, 0x91, 0x2e, + 0x11, 0x6e, 0x01, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -355,7 +355,7 @@ func (m *FeeTokenMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x30 + dAtA[i] = 0x28 } { size := m.Price.Size() @@ -841,7 +841,7 @@ func (m *FeeTokenMetadata) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) } diff --git a/x/feeabstraction/types/tx.pb.go b/x/feeabstraction/types/tx.pb.go index 9489ac4b..362ad802 100644 --- a/x/feeabstraction/types/tx.pb.go +++ b/x/feeabstraction/types/tx.pb.go @@ -128,8 +128,8 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo type MsgUpdateFeeTokens struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // fee_tokens defines the fee tokens to update. - FeeTokens FeeTokenMetadataCollection `protobuf:"bytes,2,opt,name=fee_tokens,json=feeTokens,proto3" json:"fee_tokens"` + // tokens defines the fee tokens to update. + Tokens UpdateTokenMetadataCollection `protobuf:"bytes,2,opt,name=tokens,proto3" json:"tokens"` } func (m *MsgUpdateFeeTokens) Reset() { *m = MsgUpdateFeeTokens{} } @@ -172,11 +172,130 @@ func (m *MsgUpdateFeeTokens) GetAuthority() string { return "" } -func (m *MsgUpdateFeeTokens) GetFeeTokens() FeeTokenMetadataCollection { +func (m *MsgUpdateFeeTokens) GetTokens() UpdateTokenMetadataCollection { if m != nil { - return m.FeeTokens + return m.Tokens } - return FeeTokenMetadataCollection{} + return UpdateTokenMetadataCollection{} +} + +// UpdateTokenMetadata defines the metadata for a fee token to be updated +type UpdateTokenMetadata struct { + // Denom is the token denom + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // Identifier on the oracle module + OracleDenom string `protobuf:"bytes,2,opt,name=oracle_denom,json=oracleDenom,proto3" json:"oracle_denom,omitempty"` + // Decimals is the number of decimals for the token + Decimals uint32 `protobuf:"varint,3,opt,name=decimals,proto3" json:"decimals,omitempty"` + // Enabled indicates if the token is enabled for fee abstraction + Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (m *UpdateTokenMetadata) Reset() { *m = UpdateTokenMetadata{} } +func (m *UpdateTokenMetadata) String() string { return proto.CompactTextString(m) } +func (*UpdateTokenMetadata) ProtoMessage() {} +func (*UpdateTokenMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_6352be81da2292da, []int{3} +} +func (m *UpdateTokenMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateTokenMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateTokenMetadata.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 *UpdateTokenMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateTokenMetadata.Merge(m, src) +} +func (m *UpdateTokenMetadata) XXX_Size() int { + return m.Size() +} +func (m *UpdateTokenMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateTokenMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateTokenMetadata proto.InternalMessageInfo + +func (m *UpdateTokenMetadata) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *UpdateTokenMetadata) GetOracleDenom() string { + if m != nil { + return m.OracleDenom + } + return "" +} + +func (m *UpdateTokenMetadata) GetDecimals() uint32 { + if m != nil { + return m.Decimals + } + return 0 +} + +func (m *UpdateTokenMetadata) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// Defines a collection of fee token metadata to be updated +type UpdateTokenMetadataCollection struct { + // Items is a repeated field of UpdateTokenMetadata + Items []UpdateTokenMetadata `protobuf:"bytes,1,rep,name=items,proto3" json:"items"` +} + +func (m *UpdateTokenMetadataCollection) Reset() { *m = UpdateTokenMetadataCollection{} } +func (m *UpdateTokenMetadataCollection) String() string { return proto.CompactTextString(m) } +func (*UpdateTokenMetadataCollection) ProtoMessage() {} +func (*UpdateTokenMetadataCollection) Descriptor() ([]byte, []int) { + return fileDescriptor_6352be81da2292da, []int{4} +} +func (m *UpdateTokenMetadataCollection) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateTokenMetadataCollection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateTokenMetadataCollection.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 *UpdateTokenMetadataCollection) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateTokenMetadataCollection.Merge(m, src) +} +func (m *UpdateTokenMetadataCollection) XXX_Size() int { + return m.Size() +} +func (m *UpdateTokenMetadataCollection) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateTokenMetadataCollection.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateTokenMetadataCollection proto.InternalMessageInfo + +func (m *UpdateTokenMetadataCollection) GetItems() []UpdateTokenMetadata { + if m != nil { + return m.Items + } + return nil } // MsgUpdateFeeTokensResponse defines the response structure for update fee @@ -188,7 +307,7 @@ func (m *MsgUpdateFeeTokensResponse) Reset() { *m = MsgUpdateFeeTokensRe func (m *MsgUpdateFeeTokensResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateFeeTokensResponse) ProtoMessage() {} func (*MsgUpdateFeeTokensResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6352be81da2292da, []int{3} + return fileDescriptor_6352be81da2292da, []int{5} } func (m *MsgUpdateFeeTokensResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -221,6 +340,8 @@ func init() { proto.RegisterType((*MsgUpdateParams)(nil), "kiichain.feeabstraction.v1beta1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "kiichain.feeabstraction.v1beta1.MsgUpdateParamsResponse") proto.RegisterType((*MsgUpdateFeeTokens)(nil), "kiichain.feeabstraction.v1beta1.MsgUpdateFeeTokens") + proto.RegisterType((*UpdateTokenMetadata)(nil), "kiichain.feeabstraction.v1beta1.UpdateTokenMetadata") + proto.RegisterType((*UpdateTokenMetadataCollection)(nil), "kiichain.feeabstraction.v1beta1.UpdateTokenMetadataCollection") proto.RegisterType((*MsgUpdateFeeTokensResponse)(nil), "kiichain.feeabstraction.v1beta1.MsgUpdateFeeTokensResponse") } @@ -229,36 +350,42 @@ func init() { } var fileDescriptor_6352be81da2292da = []byte{ - // 459 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x41, 0x6b, 0xd4, 0x40, - 0x14, 0xde, 0xa9, 0x5a, 0xd8, 0x51, 0x28, 0x86, 0x42, 0xb7, 0xa1, 0xa4, 0xcb, 0x5e, 0x5c, 0x16, - 0x37, 0xe3, 0x36, 0x20, 0xd2, 0x9e, 0x5c, 0xd1, 0x5b, 0x40, 0x56, 0xbd, 0x78, 0xa9, 0x93, 0xe4, - 0x25, 0x3b, 0xb4, 0xc9, 0x84, 0xcc, 0x6c, 0x69, 0x3d, 0x89, 0xde, 0x3c, 0x88, 0x3f, 0x65, 0x0f, - 0xfe, 0x01, 0x6f, 0x3d, 0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 0x75, 0x38, 0xad, 0xef, 0x9f, 0x3c, 0x4b, 0x41, 0x78, 0xeb, 0xc5, 0x26, 0x39, 0x7f, 0x02, 0x00, - 0x00, 0xff, 0xff, 0xa3, 0xbd, 0xb3, 0xe2, 0x21, 0x04, 0x00, 0x00, + // 553 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0xcf, 0x25, 0x4d, 0x68, 0x2f, 0x45, 0x15, 0x26, 0x52, 0x5d, 0xab, 0xb8, 0xc6, 0x0b, 0x56, + 0x44, 0x6c, 0x92, 0x20, 0x84, 0x8a, 0x84, 0x44, 0xf8, 0xb3, 0x45, 0xaa, 0x0c, 0x2c, 0x08, 0xa9, + 0xba, 0xd8, 0xaf, 0x8e, 0xd5, 0xd8, 0x17, 0x7c, 0x97, 0xaa, 0x65, 0x42, 0xc0, 0xc4, 0x80, 0xf8, + 0x28, 0x19, 0xf8, 0x02, 0x6c, 0x1d, 0x2b, 0x26, 0x26, 0x40, 0xc9, 0x90, 0xaf, 0x81, 0x7a, 0x67, + 0xa7, 0x6a, 0x5a, 0x11, 0xc8, 0x92, 0xf8, 0xdd, 0xfb, 0xfd, 0x79, 0xbf, 0xbb, 0xd3, 0x61, 0x6b, + 0x3f, 0x0c, 0xbd, 0x2e, 0x09, 0x63, 0x67, 0x0f, 0x80, 0x74, 0x18, 0x4f, 0x88, 0xc7, 0x43, 0x1a, + 0x3b, 0x07, 0xf5, 0x0e, 0x70, 0x52, 0x77, 0xf8, 0xa1, 0xdd, 0x4f, 0x28, 0xa7, 0xca, 0x56, 0x86, + 0xb4, 0xcf, 0x23, 0xed, 0x14, 0xa9, 0x55, 0x02, 0x1a, 0x50, 0x81, 0x75, 0x4e, 0xbf, 0x24, 0x4d, + 0x5b, 0xf7, 0x28, 0x8b, 0x28, 0x73, 0x22, 0x16, 0x38, 0x07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 0x07, 0x1d, 0xdb, 0xa3, 0x91, 0x33, 0x7d, 0x6a, 0xa6, 0x1f, 0x87, + 0xb3, 0xaf, 0x0e, 0x3f, 0xea, 0x03, 0xeb, 0x94, 0xc4, 0xfb, 0xd1, 0xfc, 0x13, 0x00, 0x00, 0xff, + 0xff, 0xef, 0xcf, 0xe2, 0x5d, 0x17, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -467,7 +594,7 @@ func (m *MsgUpdateFeeTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size, err := m.FeeTokens.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Tokens.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -486,6 +613,95 @@ func (m *MsgUpdateFeeTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *UpdateTokenMetadata) 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 *UpdateTokenMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateTokenMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Decimals != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Decimals)) + i-- + dAtA[i] = 0x18 + } + if len(m.OracleDenom) > 0 { + i -= len(m.OracleDenom) + copy(dAtA[i:], m.OracleDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.OracleDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateTokenMetadataCollection) 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 *UpdateTokenMetadataCollection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateTokenMetadataCollection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *MsgUpdateFeeTokensResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -554,11 +770,49 @@ func (m *MsgUpdateFeeTokens) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.FeeTokens.Size() + l = m.Tokens.Size() n += 1 + l + sovTx(uint64(l)) return n } +func (m *UpdateTokenMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OracleDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Decimals != 0 { + n += 1 + sovTx(uint64(m.Decimals)) + } + if m.Enabled { + n += 2 + } + return n +} + +func (m *UpdateTokenMetadataCollection) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + func (m *MsgUpdateFeeTokensResponse) Size() (n int) { if m == nil { return 0 @@ -802,7 +1056,243 @@ func (m *MsgUpdateFeeTokens) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeTokens", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tokens", 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 + } + if err := m.Tokens.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 *UpdateTokenMetadata) 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: UpdateTokenMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateTokenMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleDenom", 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.OracleDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + m.Decimals = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimals |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + 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 *UpdateTokenMetadataCollection) 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: UpdateTokenMetadataCollection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateTokenMetadataCollection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -829,7 +1319,8 @@ func (m *MsgUpdateFeeTokens) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.FeeTokens.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Items = append(m.Items, UpdateTokenMetadata{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex