diff --git a/app/ibctesting/simapp/app.go b/app/ibctesting/simapp/app.go index df44ea4f6..ac27bb2c4 100644 --- a/app/ibctesting/simapp/app.go +++ b/app/ibctesting/simapp/app.go @@ -379,6 +379,7 @@ func NewSimApp( app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) app.TransferMiddlewarekeeper = transfermiddlewarekeeper.NewKeeper( keys[transfermiddlewaretypes.StoreKey], + app.GetSubspace(transfermiddlewaretypes.ModuleName), appCodec, app.IBCKeeper.ChannelKeeper, app.TransferKeeper, diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 50d8fba05..7262dfefc 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -239,6 +239,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.TransferMiddlewareKeeper = transfermiddlewarekeeper.NewKeeper( appKeepers.keys[transfermiddlewaretypes.StoreKey], + appKeepers.GetSubspace(transfermiddlewaretypes.ModuleName), appCodec, &appKeepers.HooksICS4Wrapper, &appKeepers.TransferKeeper, @@ -413,6 +414,7 @@ func (appKeepers *AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legac paramsKeeper.Subspace(ibchost.ModuleName) paramsKeeper.Subspace(alliancemoduletypes.ModuleName) paramsKeeper.Subspace(wasm.ModuleName) + paramsKeeper.Subspace(transfermiddlewaretypes.ModuleName) return paramsKeeper } diff --git a/go.mod b/go.mod index b62f8a844..9b3f742dd 100644 --- a/go.mod +++ b/go.mod @@ -172,7 +172,7 @@ require ( golang.org/x/sys v0.7.0 // indirect golang.org/x/term v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/protobuf v1.30.0 gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/proto/centauri/mint/v1beta1/genesis.proto b/proto/centauri/mint/v1beta1/genesis.proto index 40d80aff0..a30271a06 100644 --- a/proto/centauri/mint/v1beta1/genesis.proto +++ b/proto/centauri/mint/v1beta1/genesis.proto @@ -10,13 +10,13 @@ option go_package = "x/mint/types"; // GenesisState defines the mint module's genesis state. message GenesisState { // minter is a space for holding current inflation information. - Minter minter = 1 [(gogoproto.nullable) = false]; + Minter minter = 1 [ (gogoproto.nullable) = false ]; // params defines all the paramaters of the module. - Params params = 2 [(gogoproto.nullable) = false]; + Params params = 2 [ (gogoproto.nullable) = false ]; cosmos.base.v1beta1.Coin incentives_supply = 3 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; } diff --git a/proto/centauri/mint/v1beta1/mint.proto b/proto/centauri/mint/v1beta1/mint.proto index 1c2b14033..fb898d8c3 100644 --- a/proto/centauri/mint/v1beta1/mint.proto +++ b/proto/centauri/mint/v1beta1/mint.proto @@ -10,15 +10,15 @@ import "cosmos_proto/cosmos.proto"; message Minter { // current annual inflation rate string inflation = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; // current annual expected provisions string annual_provisions = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; } @@ -30,28 +30,28 @@ message Params { string mint_denom = 1; // maximum annual change in inflation rate string inflation_rate_change = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; // goal of percent bonded atoms string goal_bonded = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; // expected blocks per year uint64 blocks_per_year = 4; // expected max amount of token to be distribute per year - string max_token_per_year = 6[ - (cosmos_proto.scalar) = "cosmos.Int", + string max_token_per_year = 6 [ + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false -]; + (gogoproto.nullable) = false + ]; // expected mint amount of token to be distribute per year string min_token_per_year = 7 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; } diff --git a/proto/centauri/mint/v1beta1/query.proto b/proto/centauri/mint/v1beta1/query.proto index 924e37143..f07d158d1 100644 --- a/proto/centauri/mint/v1beta1/query.proto +++ b/proto/centauri/mint/v1beta1/query.proto @@ -20,7 +20,8 @@ service Query { } // AnnualProvisions current minting annual provisions value. - rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) { + rpc AnnualProvisions(QueryAnnualProvisionsRequest) + returns (QueryAnnualProvisionsResponse) { option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions"; } } @@ -31,7 +32,7 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [ (gogoproto.nullable) = false ]; } // QueryInflationRequest is the request type for the Query/Inflation RPC method. @@ -41,7 +42,10 @@ message QueryInflationRequest {} // method. message QueryInflationResponse { // inflation is the current minting inflation value. - bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes inflation = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } // QueryAnnualProvisionsRequest is the request type for the @@ -52,6 +56,8 @@ message QueryAnnualProvisionsRequest {} // Query/AnnualProvisions RPC method. message QueryAnnualProvisionsResponse { // annual_provisions is the current minting annual provisions value. - bytes annual_provisions = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes annual_provisions = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } diff --git a/proto/centauri/mint/v1beta1/tx.proto b/proto/centauri/mint/v1beta1/tx.proto index 96638cd91..429a06d73 100644 --- a/proto/centauri/mint/v1beta1/tx.proto +++ b/proto/centauri/mint/v1beta1/tx.proto @@ -15,8 +15,10 @@ service Msg { option (cosmos.msg.v1.service) = true; rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - rpc FundModuleAccount(MsgFundModuleAccount) returns (MsgFundModuleAccountResponse); - rpc AddAccountToFundModuleSet(MsgAddAccountToFundModuleSet) returns (MsgAddAccountToFundModuleSetResponse); + rpc FundModuleAccount(MsgFundModuleAccount) + returns (MsgFundModuleAccountResponse); + rpc AddAccountToFundModuleSet(MsgAddAccountToFundModuleSet) + returns (MsgAddAccountToFundModuleSetResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. @@ -24,15 +26,17 @@ service Msg { // Since: cosmos-sdk 0.47 message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "centauri/x/mint/MsgUpdateParams"; + option (amino.name) = "centauri/x/mint/MsgUpdateParams"; - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // params defines the x/mint parameters to update. // // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // MsgUpdateParamsResponse defines the response structure for executing a @@ -42,8 +46,8 @@ message MsgUpdateParams { message MsgUpdateParamsResponse {} message MsgFundModuleAccount { - string from_address = 1; - repeated cosmos.base.v1beta1.Coin amount = 2 [ + string from_address = 1; + repeated cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" @@ -54,9 +58,11 @@ message MsgFundModuleAccountResponse {} // MsgAddAccountToFundModuleSet add account in to allowed fund module set message MsgAddAccountToFundModuleSet { - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1[ (gogoproto.moretags) = "yaml:\"authority\"" ]; - string allowed_address = 2 [ (gogoproto.moretags) = "yaml:\"allowed_address\"" ]; + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (gogoproto.moretags) = "yaml:\"authority\"" ]; + string allowed_address = 2 + [ (gogoproto.moretags) = "yaml:\"allowed_address\"" ]; } message MsgAddAccountToFundModuleSetResponse {} diff --git a/proto/centauri/transfermiddleware/v1beta1/genesis.proto b/proto/centauri/transfermiddleware/v1beta1/genesis.proto index fe9490b12..b6b978d0a 100644 --- a/proto/centauri/transfermiddleware/v1beta1/genesis.proto +++ b/proto/centauri/transfermiddleware/v1beta1/genesis.proto @@ -2,23 +2,15 @@ syntax = "proto3"; package centauri.transfermiddleware.v1beta1; import "gogoproto/gogo.proto"; +import "centauri/transfermiddleware/v1beta1/params.proto"; +import "centauri/transfermiddleware/v1beta1/parachain_token_info.proto"; option go_package = "x/transfermiddleware/types"; // GenesisState defines the module various parameters when first // initialized message GenesisState { - repeated ParachainIBCTokenInfo token_infos = 1 [ (gogoproto.nullable) = false ]; + repeated ParachainIBCTokenInfo token_infos = 1 + [ (gogoproto.nullable) = false ]; + Params params = 2 [ (gogoproto.nullable) = false ]; } - -// ParachainIBCTokenInfo represents information about transferable IBC tokens from Parachain. -message ParachainIBCTokenInfo{ - // ibc_denom is the denomination of the ibced token transferred from the dotsama chain. - string ibc_denom = 1 [ (gogoproto.moretags) = "yaml:\"ibc_denom\"" ]; - // channel_id is source channel in IBC connection from centauri chain - string channel_id = 2 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; - // native denom is new native minted denom in centauri chain. - string native_denom = 3 [ (gogoproto.moretags) = "yaml:\"native_denom\"" ]; - // asset id is the id of the asset on Picasso - string asset_id = 4 [ (gogoproto.moretags) = "yaml:\"asset_id\"" ]; -} \ No newline at end of file diff --git a/proto/centauri/transfermiddleware/v1beta1/parachain_token_info.proto b/proto/centauri/transfermiddleware/v1beta1/parachain_token_info.proto new file mode 100644 index 000000000..f570c3f9b --- /dev/null +++ b/proto/centauri/transfermiddleware/v1beta1/parachain_token_info.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package centauri.transfermiddleware.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "x/transfermiddleware/types"; + +// ParachainIBCTokenInfo represents information about transferable IBC tokens +// from Parachain. +message ParachainIBCTokenInfo { + // ibc_denom is the denomination of the ibced token transferred from the + // dotsama chain. + string ibc_denom = 1 [ (gogoproto.moretags) = "yaml:\"ibc_denom\"" ]; + // channel_id is source channel in IBC connection from centauri chain + string channel_id = 2 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; + // native denom is new native minted denom in centauri chain. + string native_denom = 3 [ (gogoproto.moretags) = "yaml:\"native_denom\"" ]; + // asset id is the id of the asset on Picasso + string asset_id = 4 [ (gogoproto.moretags) = "yaml:\"asset_id\"" ]; +} + +message RemoveParachainIBCTokenInfo { + // native denom is new native minted denom in centauri chain. + string native_denom = 1 [ (gogoproto.moretags) = "yaml:\"native_denom\"" ]; + // + // remove_time is the time at which the parachain token info will be removed. + google.protobuf.Timestamp remove_time = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; +} \ No newline at end of file diff --git a/proto/centauri/transfermiddleware/v1beta1/params.proto b/proto/centauri/transfermiddleware/v1beta1/params.proto new file mode 100644 index 000000000..d93818302 --- /dev/null +++ b/proto/centauri/transfermiddleware/v1beta1/params.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package centauri.transfermiddleware.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "x/transfermiddleware/types"; + +// Params holds parameters for the mint module. +message Params { + google.protobuf.Duration duration = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; +} \ No newline at end of file diff --git a/proto/centauri/transfermiddleware/v1beta1/query.proto b/proto/centauri/transfermiddleware/v1beta1/query.proto index 1d30ca5b4..fc12b0249 100644 --- a/proto/centauri/transfermiddleware/v1beta1/query.proto +++ b/proto/centauri/transfermiddleware/v1beta1/query.proto @@ -9,33 +9,38 @@ option go_package = "x/transfermiddleware/types"; // Query provides defines the gRPC querier service. service Query { // ParaTokenInfo queries all token info of a native denom. - rpc ParaTokenInfo(QueryParaTokenInfoRequest) returns (QueryParaTokenInfoResponse) { + rpc ParaTokenInfo(QueryParaTokenInfoRequest) + returns (QueryParaTokenInfoResponse) { option (google.api.http).get = "/centauri/paratokeninfo"; } - rpc EscrowAddress(QueryEscrowAddressRequest) returns (QueryEscrowAddressResponse) { + rpc EscrowAddress(QueryEscrowAddressRequest) + returns (QueryEscrowAddressResponse) { option (google.api.http).get = "/centauri/escrowaddress"; } } -// message QueryEscrowAddressRequest +// message QueryEscrowAddressRequest message QueryEscrowAddressRequest { - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 1 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; } -// QueryEscrowAddressResponse +// QueryEscrowAddressResponse message QueryEscrowAddressResponse { - string escrow_address = 1 [(gogoproto.moretags) = "yaml:\"escrow_address\""]; + string escrow_address = 1 + [ (gogoproto.moretags) = "yaml:\"escrow_address\"" ]; } -// QueryParaTokenInfoRequest is the request type for the Query/Params RPC method. +// QueryParaTokenInfoRequest is the request type for the Query/Params RPC +// method. message QueryParaTokenInfoRequest { - string native_denom = 1 [(gogoproto.moretags) = "yaml:\"native_denom\""]; + string native_denom = 1 [ (gogoproto.moretags) = "yaml:\"native_denom\"" ]; } -// QueryParaTokenInfoResponse is the response type for the Query/ParaTokenInfo RPC method. +// QueryParaTokenInfoResponse is the response type for the Query/ParaTokenInfo +// RPC method. message QueryParaTokenInfoResponse { - string ibc_denom = 1 [ (gogoproto.moretags) = "yaml:\"ibc_denom\"" ]; - string channel_id = 2 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; - string native_denom = 3 [ (gogoproto.moretags) = "yaml:\"native_denom\"" ]; - string asset_id = 4 [ (gogoproto.moretags) = "yaml:\"asset_id\"" ]; + string ibc_denom = 1 [ (gogoproto.moretags) = "yaml:\"ibc_denom\"" ]; + string channel_id = 2 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; + string native_denom = 3 [ (gogoproto.moretags) = "yaml:\"native_denom\"" ]; + string asset_id = 4 [ (gogoproto.moretags) = "yaml:\"asset_id\"" ]; } diff --git a/proto/centauri/transfermiddleware/v1beta1/tx.proto b/proto/centauri/transfermiddleware/v1beta1/tx.proto index 0d42610c3..d8ce98314 100644 --- a/proto/centauri/transfermiddleware/v1beta1/tx.proto +++ b/proto/centauri/transfermiddleware/v1beta1/tx.proto @@ -8,50 +8,55 @@ option go_package = "x/transfermiddleware/types"; // Msg defines the transfer middleware Msg service. service Msg { - rpc AddParachainIBCTokenInfo(MsgAddParachainIBCTokenInfo) returns (MsgAddParachainIBCTokenInfoResponse); - rpc RemoveParachainIBCTokenInfo(MsgRemoveParachainIBCTokenInfo) returns (MsgRemoveParachainIBCTokenInfoResponse); - rpc AddRlyAddress(MsgAddRlyAddress) returns (MsgAddRlyAddressResponse); + rpc AddParachainIBCTokenInfo(MsgAddParachainIBCTokenInfo) + returns (MsgAddParachainIBCTokenInfoResponse); + rpc RemoveParachainIBCTokenInfo(MsgRemoveParachainIBCTokenInfo) + returns (MsgRemoveParachainIBCTokenInfoResponse); + rpc AddRlyAddress(MsgAddRlyAddress) returns (MsgAddRlyAddressResponse); } // MsgAddParachainInfo represents a message to add new parachain info. message MsgAddParachainIBCTokenInfo { - option (cosmos.msg.v1.signer) = "authority"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1[ (gogoproto.moretags) = "yaml:\"authority\"" ];; - - string channel_id = 2 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; - string ibc_denom = 3 [ (gogoproto.moretags) = "yaml:\"ibc_denom\"" ]; - string native_denom = 4 [ (gogoproto.moretags) = "yaml:\"native_denom\"" ]; - string asset_id = 5 [ (gogoproto.moretags) = "yaml:\"asset_id\"" ]; -} + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (gogoproto.moretags) = "yaml:\"authority\"" ]; + ; -message MsgAddParachainIBCTokenInfoResponse { + string channel_id = 2 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; + string ibc_denom = 3 [ (gogoproto.moretags) = "yaml:\"ibc_denom\"" ]; + string native_denom = 4 [ (gogoproto.moretags) = "yaml:\"native_denom\"" ]; + string asset_id = 5 [ (gogoproto.moretags) = "yaml:\"asset_id\"" ]; } +message MsgAddParachainIBCTokenInfoResponse {} -// MsgRemoveParachainIBCTokenInfo represents a message to remove new parachain info. +// MsgRemoveParachainIBCTokenInfo represents a message to remove new parachain +// info. message MsgRemoveParachainIBCTokenInfo { - option (cosmos.msg.v1.signer) = "authority"; + option (cosmos.msg.v1.signer) = "authority"; - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1[ (gogoproto.moretags) = "yaml:\"authority\"" ];; + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (gogoproto.moretags) = "yaml:\"authority\"" ]; + ; - string native_denom = 2 [ (gogoproto.moretags) = "yaml:\"ibc_denom\"" ]; + string native_denom = 2 [ (gogoproto.moretags) = "yaml:\"ibc_denom\"" ]; } -message MsgRemoveParachainIBCTokenInfoResponse { -} +message MsgRemoveParachainIBCTokenInfoResponse {} // MsgAddRlyAddress represents a message to add new rly address to allow list message MsgAddRlyAddress { - option (cosmos.msg.v1.signer) = "authority"; + option (cosmos.msg.v1.signer) = "authority"; - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1[ (gogoproto.moretags) = "yaml:\"authority\"" ];; + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (gogoproto.moretags) = "yaml:\"authority\"" ]; + ; - string rly_address = 2 [ (gogoproto.moretags) = "yaml:\"rly_address\"" ]; + string rly_address = 2 [ (gogoproto.moretags) = "yaml:\"rly_address\"" ]; } -message MsgAddRlyAddressResponse { -} \ No newline at end of file +message MsgAddRlyAddressResponse {} \ No newline at end of file diff --git a/x/mint/types/tx.pb.go b/x/mint/types/tx.pb.go index ba74708ab..ac75494ea 100644 --- a/x/mint/types/tx.pb.go +++ b/x/mint/types/tx.pb.go @@ -37,7 +37,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // // Since: cosmos-sdk 0.47 type MsgUpdateParams struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // params defines the x/mint parameters to update. // @@ -222,7 +223,8 @@ var xxx_messageInfo_MsgFundModuleAccountResponse proto.InternalMessageInfo // MsgAddAccountToFundModuleSet add account in to allowed fund module set type MsgAddAccountToFundModuleSet struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty" yaml:"authority"` AllowedAddress string `protobuf:"bytes,2,opt,name=allowed_address,json=allowedAddress,proto3" json:"allowed_address,omitempty" yaml:"allowed_address"` } diff --git a/x/transfermiddleware/keeper/abci.go b/x/transfermiddleware/keeper/abci.go new file mode 100644 index 000000000..4c45d2be5 --- /dev/null +++ b/x/transfermiddleware/keeper/abci.go @@ -0,0 +1,20 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/notional-labs/centauri/v3/x/transfermiddleware/types" +) + +// BeginBlocker of epochs module. +func (k Keeper) BeginBlocker(ctx sdk.Context) { + // Iterate over remove list + k.IterateRemoveListInfo(ctx, func(removeList types.RemoveParachainIBCTokenInfo) (stop bool) { + // If pass the duration, remove parachain token info + if ctx.BlockTime().After(removeList.RemoveTime) { + k.RemoveParachainIBCInfo(ctx, removeList.NativeDenom) + } + + return false + }) + +} diff --git a/x/transfermiddleware/keeper/genesis.go b/x/transfermiddleware/keeper/genesis.go index 9d838a292..680a36ab2 100644 --- a/x/transfermiddleware/keeper/genesis.go +++ b/x/transfermiddleware/keeper/genesis.go @@ -11,6 +11,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { for _, tokenInfo := range genState.TokenInfos { k.AddParachainIBCInfo(ctx, tokenInfo.IbcDenom, tokenInfo.ChannelId, tokenInfo.NativeDenom, tokenInfo.AssetId) } + k.SetParams(ctx, genState.Params) } // IterateParaTokenInfos iterate through all parachain token info. @@ -47,5 +48,6 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { return &types.GenesisState{ TokenInfos: infos, + Params: k.GetParams(ctx), } } diff --git a/x/transfermiddleware/keeper/keeper.go b/x/transfermiddleware/keeper/keeper.go index 2765ffb1b..9a2700076 100644 --- a/x/transfermiddleware/keeper/keeper.go +++ b/x/transfermiddleware/keeper/keeper.go @@ -1,11 +1,15 @@ package keeper import ( + "time" + errorsmod "cosmossdk.io/errors" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" "github.com/cosmos/ibc-go/v7/modules/core/exported" @@ -15,6 +19,7 @@ import ( type Keeper struct { cdc codec.BinaryCodec storeKey storetypes.StoreKey + paramSpace paramtypes.Subspace ICS4Wrapper porttypes.ICS4Wrapper bankKeeper types.BankKeeper transferKeeper types.TransferKeeper @@ -27,14 +32,21 @@ type Keeper struct { // NewKeeper returns a new instance of the x/ibchooks keeper func NewKeeper( storeKey storetypes.StoreKey, + paramSpace paramtypes.Subspace, codec codec.BinaryCodec, ics4Wrapper porttypes.ICS4Wrapper, transferKeeper types.TransferKeeper, bankKeeper types.BankKeeper, authority string, ) Keeper { + // set KeyTable if it has not already been set + if !paramSpace.HasKeyTable() { + paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) + } + return Keeper{ storeKey: storeKey, + paramSpace: paramSpace, transferKeeper: transferKeeper, bankKeeper: bankKeeper, cdc: codec, @@ -75,6 +87,47 @@ func (keeper Keeper) AddParachainIBCInfo(ctx sdk.Context, ibcDenom, channelID, n return nil } +// TODO: testing +// AddParachainIBCInfoToRemoveList add parachain token information token to remove list. +func (keeper Keeper) AddParachainIBCInfoToRemoveList(ctx sdk.Context, nativeDenom string) (time.Time, error) { + params := keeper.GetParams(ctx) + store := ctx.KVStore(keeper.storeKey) + if store.Has(types.GetKeyParachainIBCTokenInfoByNativeDenom(nativeDenom)) { + return time.Time{}, errorsmod.Wrapf(sdkerrors.ErrKeyNotFound, "Token %v info not found", nativeDenom) + } + + // Add to remove list + removeTime := ctx.BlockTime().Add(params.Duration) + removeToken := types.RemoveParachainIBCTokenInfo{ + NativeDenom: nativeDenom, + RemoveTime: removeTime, + } + + bz, err := keeper.cdc.Marshal(&removeToken) + if err != nil { + return time.Time{}, err + } + + store.Set(types.GetKeyParachainIBCTokenRemoveListByNativeDenom(nativeDenom), bz) + return removeTime, nil +} + +// TODO: testing +// IterateRemoveListInfo iterate all parachain token in remove list. +func (keeper Keeper) IterateRemoveListInfo(ctx sdk.Context, cb func(removeInfo types.RemoveParachainIBCTokenInfo) (stop bool)) { + store := ctx.KVStore(keeper.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.KeyParachainIBCTokenRemoveListByNativeDenom) + + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + var removeInfo types.RemoveParachainIBCTokenInfo + keeper.cdc.MustUnmarshal(iterator.Value(), &removeInfo) + if cb(removeInfo) { + break + } + } +} + // TODO: testing // RemoveParachainIBCTokenInfo remove parachain token information from chain state. func (keeper Keeper) RemoveParachainIBCInfo(ctx sdk.Context, nativeDenom string) error { diff --git a/x/transfermiddleware/keeper/msg_server.go b/x/transfermiddleware/keeper/msg_server.go index 60dbb250e..7c83cd854 100644 --- a/x/transfermiddleware/keeper/msg_server.go +++ b/x/transfermiddleware/keeper/msg_server.go @@ -55,7 +55,7 @@ func (ms msgServer) RemoveParachainIBCTokenInfo(goCtx context.Context, req *type return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, req.Authority) } - err := ms.RemoveParachainIBCInfo(ctx, req.NativeDenom) + removeTime, err := ms.AddParachainIBCInfoToRemoveList(ctx, req.NativeDenom) if err != nil { return nil, err } @@ -64,6 +64,7 @@ func (ms msgServer) RemoveParachainIBCTokenInfo(goCtx context.Context, req *type sdk.NewEvent( types.EventRemoveParachainIBCTokenInfo, sdk.NewAttribute(types.AttributeKeyNativeDenom, req.NativeDenom), + sdk.NewAttribute(types.AttributeKeyRemoveTime, removeTime.String()), ), }) diff --git a/x/transfermiddleware/keeper/params.go b/x/transfermiddleware/keeper/params.go new file mode 100644 index 000000000..47370718d --- /dev/null +++ b/x/transfermiddleware/keeper/params.go @@ -0,0 +1,15 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/notional-labs/centauri/v3/x/transfermiddleware/types" +) + +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + k.paramSpace.GetParamSet(ctx, ¶ms) + return params +} + +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramSpace.SetParamSet(ctx, ¶ms) +} diff --git a/x/transfermiddleware/module.go b/x/transfermiddleware/module.go index e50cebf18..2e5aafcde 100644 --- a/x/transfermiddleware/module.go +++ b/x/transfermiddleware/module.go @@ -123,7 +123,9 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock implements the AppModule interface -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + am.keeper.BeginBlocker(ctx) +} // EndBlock implements the AppModule interface func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { diff --git a/x/transfermiddleware/types/events.go b/x/transfermiddleware/types/events.go index 4509e190f..61938b986 100644 --- a/x/transfermiddleware/types/events.go +++ b/x/transfermiddleware/types/events.go @@ -10,4 +10,5 @@ const ( AttributeKeyIbcDenom = "ibc-denom" AttributeKeyAssetID = "asset-id" AttributeKeyRlyAdress = "rly-address" + AttributeKeyRemoveTime = "remove_time" ) diff --git a/x/transfermiddleware/types/genesis.go b/x/transfermiddleware/types/genesis.go index 24d380e4a..d33a1a2f8 100644 --- a/x/transfermiddleware/types/genesis.go +++ b/x/transfermiddleware/types/genesis.go @@ -6,7 +6,9 @@ import ( // DefaultGenesisState returns a GenesisState with "transfer" as the default PortID. func DefaultGenesisState() *GenesisState { - return &GenesisState{} + return &GenesisState{ + Params: DefaultParams(), + } } // ValidateGenesis validates the provided genesis state to ensure the diff --git a/x/transfermiddleware/types/genesis.pb.go b/x/transfermiddleware/types/genesis.pb.go index 6d93416fa..15a12add3 100644 --- a/x/transfermiddleware/types/genesis.pb.go +++ b/x/transfermiddleware/types/genesis.pb.go @@ -27,6 +27,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // initialized type GenesisState struct { TokenInfos []ParachainIBCTokenInfo `protobuf:"bytes,1,rep,name=token_infos,json=tokenInfos,proto3" json:"token_infos"` + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -69,82 +70,15 @@ func (m *GenesisState) GetTokenInfos() []ParachainIBCTokenInfo { return nil } -// ParachainIBCTokenInfo represents information about transferable IBC tokens from Parachain. -type ParachainIBCTokenInfo struct { - // ibc_denom is the denomination of the ibced token transferred from the dotsama chain. - IbcDenom string `protobuf:"bytes,1,opt,name=ibc_denom,json=ibcDenom,proto3" json:"ibc_denom,omitempty" yaml:"ibc_denom"` - // channel_id is source channel in IBC connection from centauri chain - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` - // native denom is new native minted denom in centauri chain. - NativeDenom string `protobuf:"bytes,3,opt,name=native_denom,json=nativeDenom,proto3" json:"native_denom,omitempty" yaml:"native_denom"` - // asset id is the id of the asset on Picasso - AssetId string `protobuf:"bytes,4,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` -} - -func (m *ParachainIBCTokenInfo) Reset() { *m = ParachainIBCTokenInfo{} } -func (m *ParachainIBCTokenInfo) String() string { return proto.CompactTextString(m) } -func (*ParachainIBCTokenInfo) ProtoMessage() {} -func (*ParachainIBCTokenInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_bba390f1246595d3, []int{1} -} -func (m *ParachainIBCTokenInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParachainIBCTokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParachainIBCTokenInfo.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 *ParachainIBCTokenInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParachainIBCTokenInfo.Merge(m, src) -} -func (m *ParachainIBCTokenInfo) XXX_Size() int { - return m.Size() -} -func (m *ParachainIBCTokenInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ParachainIBCTokenInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ParachainIBCTokenInfo proto.InternalMessageInfo - -func (m *ParachainIBCTokenInfo) GetIbcDenom() string { - if m != nil { - return m.IbcDenom - } - return "" -} - -func (m *ParachainIBCTokenInfo) GetChannelId() string { +func (m *GenesisState) GetParams() Params { if m != nil { - return m.ChannelId + return m.Params } - return "" -} - -func (m *ParachainIBCTokenInfo) GetNativeDenom() string { - if m != nil { - return m.NativeDenom - } - return "" -} - -func (m *ParachainIBCTokenInfo) GetAssetId() string { - if m != nil { - return m.AssetId - } - return "" + return Params{} } func init() { proto.RegisterType((*GenesisState)(nil), "centauri.transfermiddleware.v1beta1.GenesisState") - proto.RegisterType((*ParachainIBCTokenInfo)(nil), "centauri.transfermiddleware.v1beta1.ParachainIBCTokenInfo") } func init() { @@ -152,29 +86,23 @@ func init() { } var fileDescriptor_bba390f1246595d3 = []byte{ - // 347 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4f, 0xea, 0x40, - 0x14, 0x85, 0xdb, 0x07, 0x79, 0x0f, 0x06, 0x92, 0xa7, 0x05, 0x22, 0x61, 0xd1, 0x92, 0x71, 0xc3, - 0xaa, 0x4d, 0x95, 0x15, 0xcb, 0x6a, 0x62, 0xba, 0x33, 0xd5, 0x95, 0x1b, 0x32, 0x6d, 0x2f, 0x30, - 0x11, 0x66, 0xb0, 0x33, 0xa2, 0xfc, 0x0b, 0x7f, 0x16, 0x4b, 0x96, 0xae, 0x1a, 0x03, 0x5b, 0x57, - 0xfd, 0x05, 0xa6, 0x1d, 0x50, 0x13, 0x59, 0xb8, 0x3b, 0xf7, 0x9e, 0xfb, 0xdd, 0xb3, 0x38, 0xc8, - 0x8d, 0x80, 0x49, 0xf2, 0x98, 0x50, 0x47, 0x26, 0x84, 0x89, 0x11, 0x24, 0x33, 0x1a, 0xc7, 0x53, - 0x78, 0x22, 0x09, 0x38, 0x0b, 0x37, 0x04, 0x49, 0x5c, 0x67, 0x0c, 0x0c, 0x04, 0x15, 0xf6, 0x3c, - 0xe1, 0x92, 0x1b, 0xa7, 0x7b, 0xc4, 0xfe, 0x89, 0xd8, 0x3b, 0xa4, 0xd3, 0x1c, 0xf3, 0x31, 0x2f, - 0xee, 0x9d, 0x5c, 0x29, 0x14, 0x3f, 0xa0, 0xfa, 0x95, 0xfa, 0x75, 0x23, 0x89, 0x04, 0x83, 0xa0, - 0x9a, 0xe4, 0xf7, 0xc0, 0x86, 0x94, 0x8d, 0xb8, 0x68, 0xeb, 0xdd, 0x52, 0xaf, 0x76, 0x36, 0xb0, - 0x7f, 0x11, 0x60, 0x5f, 0x93, 0x84, 0x44, 0x13, 0x42, 0x99, 0xef, 0x5d, 0xdc, 0xe6, 0x3f, 0x7c, - 0x36, 0xe2, 0x5e, 0x79, 0x95, 0x5a, 0x5a, 0x80, 0xe4, 0x7e, 0x21, 0xf0, 0xbb, 0x8e, 0x5a, 0x07, - 0x6f, 0x0d, 0x17, 0x55, 0x69, 0x18, 0x0d, 0x63, 0x60, 0x7c, 0xd6, 0xd6, 0xbb, 0x7a, 0xaf, 0xea, - 0x35, 0xb3, 0xd4, 0x3a, 0x5a, 0x92, 0xd9, 0x74, 0x80, 0x3f, 0x2d, 0x1c, 0x54, 0x68, 0x18, 0x5d, - 0xe6, 0xd2, 0xe8, 0x23, 0x14, 0x4d, 0x08, 0x63, 0x30, 0x1d, 0xd2, 0xb8, 0xfd, 0xa7, 0x60, 0x5a, - 0x59, 0x6a, 0x1d, 0x2b, 0xe6, 0xcb, 0xc3, 0x41, 0x75, 0x37, 0xf8, 0xb1, 0x31, 0x40, 0x75, 0x46, - 0x24, 0x5d, 0xc0, 0x2e, 0xab, 0x54, 0x70, 0x27, 0x59, 0x6a, 0x35, 0x14, 0xf7, 0xdd, 0xc5, 0x41, - 0x4d, 0x8d, 0x2a, 0xd1, 0x46, 0x15, 0x22, 0x04, 0xc8, 0x3c, 0xaf, 0x5c, 0x70, 0x8d, 0x2c, 0xb5, - 0xfe, 0x2b, 0x6e, 0xef, 0xe0, 0xe0, 0x5f, 0x21, 0xfd, 0xd8, 0xeb, 0xaf, 0x36, 0xa6, 0xbe, 0xde, - 0x98, 0xfa, 0xdb, 0xc6, 0xd4, 0x5f, 0xb6, 0xa6, 0xb6, 0xde, 0x9a, 0xda, 0xeb, 0xd6, 0xd4, 0xee, - 0x3a, 0xcf, 0x87, 0x2a, 0x96, 0xcb, 0x39, 0x88, 0xf0, 0x6f, 0x51, 0xcf, 0xf9, 0x47, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x1d, 0x03, 0xda, 0x49, 0x0e, 0x02, 0x00, 0x00, + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4c, 0x4e, 0xcd, 0x2b, + 0x49, 0x2c, 0x2d, 0xca, 0xd4, 0x2f, 0x29, 0x4a, 0xcc, 0x2b, 0x4e, 0x4b, 0x2d, 0xca, 0xcd, 0x4c, + 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, + 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x86, + 0x69, 0xd1, 0xc3, 0xd4, 0xa2, 0x07, 0xd5, 0x22, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xaf, + 0x0f, 0x62, 0x41, 0xb4, 0x4a, 0x19, 0x10, 0x63, 0x5b, 0x41, 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x32, + 0x29, 0x3b, 0x62, 0x75, 0x24, 0x67, 0x24, 0x66, 0xe6, 0xc5, 0x97, 0xe4, 0x67, 0xa7, 0xe6, 0xc5, + 0x67, 0xe6, 0xa5, 0x41, 0x6d, 0x54, 0xda, 0xc3, 0xc8, 0xc5, 0xe3, 0x0e, 0x71, 0x7e, 0x70, 0x49, + 0x62, 0x49, 0xaa, 0x50, 0x22, 0x17, 0x37, 0x42, 0x51, 0xb1, 0x04, 0xa3, 0x02, 0xb3, 0x06, 0xb7, + 0x91, 0x95, 0x1e, 0x11, 0x7e, 0xd2, 0x0b, 0x80, 0x59, 0xe3, 0xe9, 0xe4, 0x1c, 0x02, 0x32, 0xc3, + 0x33, 0x2f, 0x2d, 0xdf, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xae, 0x12, 0x98, 0x40, 0xb1, + 0x90, 0x27, 0x17, 0x1b, 0xc4, 0x0f, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0xda, 0x44, 0x9b, + 0x9e, 0x5b, 0x0c, 0x35, 0x0e, 0x6a, 0x80, 0x93, 0xc9, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, + 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, + 0xcb, 0x31, 0x44, 0x49, 0x55, 0x60, 0x0b, 0x91, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, + 0xdf, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xbd, 0x63, 0x88, 0xdd, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -197,6 +125,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 if len(m.TokenInfos) > 0 { for iNdEx := len(m.TokenInfos) - 1; iNdEx >= 0; iNdEx-- { { @@ -214,57 +152,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ParachainIBCTokenInfo) 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 *ParachainIBCTokenInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParachainIBCTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AssetId) > 0 { - i -= len(m.AssetId) - copy(dAtA[i:], m.AssetId) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.AssetId))) - i-- - dAtA[i] = 0x22 - } - if len(m.NativeDenom) > 0 { - i -= len(m.NativeDenom) - copy(dAtA[i:], m.NativeDenom) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.NativeDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0x12 - } - if len(m.IbcDenom) > 0 { - i -= len(m.IbcDenom) - copy(dAtA[i:], m.IbcDenom) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.IbcDenom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -288,31 +175,8 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - return n -} - -func (m *ParachainIBCTokenInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.IbcDenom) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.NativeDenom) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.AssetId) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -385,125 +249,11 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ParachainIBCTokenInfo) 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 ErrIntOverflowGenesis - } - 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: ParachainIBCTokenInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParachainIBCTokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IbcDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IbcDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NativeDenom", wireType) - } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -513,55 +263,24 @@ func (m *ParachainIBCTokenInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.NativeDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.AssetId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/transfermiddleware/types/keys.go b/x/transfermiddleware/types/keys.go index edf8720c9..6a1b8b9e8 100644 --- a/x/transfermiddleware/types/keys.go +++ b/x/transfermiddleware/types/keys.go @@ -18,10 +18,11 @@ const ( ) var ( - KeyParachainIBCTokenInfoByNativeDenom = []byte{0x01} - KeyParachainIBCTokenInfoByAssetID = []byte{0x02} - KeyIBCDenomAndNativeIndex = []byte{0x03} - KeyRlyAddress = []byte{0x04} + KeyParachainIBCTokenInfoByNativeDenom = []byte{0x01} + KeyParachainIBCTokenInfoByAssetID = []byte{0x02} + KeyIBCDenomAndNativeIndex = []byte{0x03} + KeyRlyAddress = []byte{0x04} + KeyParachainIBCTokenRemoveListByNativeDenom = []byte{0x05} ) func GetKeyParachainIBCTokenInfoByNativeDenom(nativeDenom string) []byte { @@ -39,3 +40,7 @@ func GetKeyNativeDenomAndIbcSecondaryIndex(ibcDenom string) []byte { func GetKeyByRlyAddress(rlyAddress string) []byte { return append(KeyRlyAddress, []byte(rlyAddress)...) } + +func GetKeyParachainIBCTokenRemoveListByNativeDenom(nativeDenom string) []byte { + return append(KeyParachainIBCTokenRemoveListByNativeDenom, []byte(nativeDenom)...) +} diff --git a/x/transfermiddleware/types/parachain_token_info.pb.go b/x/transfermiddleware/types/parachain_token_info.pb.go new file mode 100644 index 000000000..effd9f8de --- /dev/null +++ b/x/transfermiddleware/types/parachain_token_info.pb.go @@ -0,0 +1,719 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: centauri/transfermiddleware/v1beta1/parachain_token_info.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ParachainIBCTokenInfo represents information about transferable IBC tokens +// from Parachain. +type ParachainIBCTokenInfo struct { + // ibc_denom is the denomination of the ibced token transferred from the + // dotsama chain. + IbcDenom string `protobuf:"bytes,1,opt,name=ibc_denom,json=ibcDenom,proto3" json:"ibc_denom,omitempty" yaml:"ibc_denom"` + // channel_id is source channel in IBC connection from centauri chain + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + // native denom is new native minted denom in centauri chain. + NativeDenom string `protobuf:"bytes,3,opt,name=native_denom,json=nativeDenom,proto3" json:"native_denom,omitempty" yaml:"native_denom"` + // asset id is the id of the asset on Picasso + AssetId string `protobuf:"bytes,4,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` +} + +func (m *ParachainIBCTokenInfo) Reset() { *m = ParachainIBCTokenInfo{} } +func (m *ParachainIBCTokenInfo) String() string { return proto.CompactTextString(m) } +func (*ParachainIBCTokenInfo) ProtoMessage() {} +func (*ParachainIBCTokenInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_b9cc8ea0d211210f, []int{0} +} +func (m *ParachainIBCTokenInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ParachainIBCTokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ParachainIBCTokenInfo.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 *ParachainIBCTokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ParachainIBCTokenInfo.Merge(m, src) +} +func (m *ParachainIBCTokenInfo) XXX_Size() int { + return m.Size() +} +func (m *ParachainIBCTokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ParachainIBCTokenInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ParachainIBCTokenInfo proto.InternalMessageInfo + +func (m *ParachainIBCTokenInfo) GetIbcDenom() string { + if m != nil { + return m.IbcDenom + } + return "" +} + +func (m *ParachainIBCTokenInfo) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *ParachainIBCTokenInfo) GetNativeDenom() string { + if m != nil { + return m.NativeDenom + } + return "" +} + +func (m *ParachainIBCTokenInfo) GetAssetId() string { + if m != nil { + return m.AssetId + } + return "" +} + +type RemoveParachainIBCTokenInfo struct { + // native denom is new native minted denom in centauri chain. + NativeDenom string `protobuf:"bytes,1,opt,name=native_denom,json=nativeDenom,proto3" json:"native_denom,omitempty" yaml:"native_denom"` + // remove_time is the time at which the parachain token info will be removed. + RemoveTime time.Time `protobuf:"bytes,2,opt,name=remove_time,json=removeTime,proto3,stdtime" json:"remove_time" yaml:"start_time"` +} + +func (m *RemoveParachainIBCTokenInfo) Reset() { *m = RemoveParachainIBCTokenInfo{} } +func (m *RemoveParachainIBCTokenInfo) String() string { return proto.CompactTextString(m) } +func (*RemoveParachainIBCTokenInfo) ProtoMessage() {} +func (*RemoveParachainIBCTokenInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_b9cc8ea0d211210f, []int{1} +} +func (m *RemoveParachainIBCTokenInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RemoveParachainIBCTokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RemoveParachainIBCTokenInfo.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 *RemoveParachainIBCTokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveParachainIBCTokenInfo.Merge(m, src) +} +func (m *RemoveParachainIBCTokenInfo) XXX_Size() int { + return m.Size() +} +func (m *RemoveParachainIBCTokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveParachainIBCTokenInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveParachainIBCTokenInfo proto.InternalMessageInfo + +func (m *RemoveParachainIBCTokenInfo) GetNativeDenom() string { + if m != nil { + return m.NativeDenom + } + return "" +} + +func (m *RemoveParachainIBCTokenInfo) GetRemoveTime() time.Time { + if m != nil { + return m.RemoveTime + } + return time.Time{} +} + +func init() { + proto.RegisterType((*ParachainIBCTokenInfo)(nil), "centauri.transfermiddleware.v1beta1.ParachainIBCTokenInfo") + proto.RegisterType((*RemoveParachainIBCTokenInfo)(nil), "centauri.transfermiddleware.v1beta1.RemoveParachainIBCTokenInfo") +} + +func init() { + proto.RegisterFile("centauri/transfermiddleware/v1beta1/parachain_token_info.proto", fileDescriptor_b9cc8ea0d211210f) +} + +var fileDescriptor_b9cc8ea0d211210f = []byte{ + // 392 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xbf, 0xae, 0xd3, 0x30, + 0x14, 0xc6, 0x63, 0x40, 0x70, 0xeb, 0x22, 0x01, 0xb9, 0xad, 0xa8, 0x82, 0x48, 0x90, 0x59, 0x98, + 0x12, 0x15, 0x3a, 0x75, 0x60, 0x08, 0x2c, 0xd9, 0x50, 0xd4, 0xa9, 0x4b, 0xe4, 0x24, 0x4e, 0x6a, + 0x91, 0xd8, 0x91, 0xe3, 0x16, 0xfa, 0x16, 0x7d, 0x19, 0xde, 0xa1, 0x63, 0x47, 0xa6, 0x80, 0xda, + 0x95, 0x29, 0x4f, 0x80, 0x62, 0x37, 0x14, 0x41, 0x97, 0xbb, 0x9d, 0xa3, 0xef, 0xfc, 0xfc, 0x9d, + 0x3f, 0x86, 0xef, 0x13, 0xc2, 0x24, 0x5e, 0x0b, 0xea, 0x49, 0x81, 0x59, 0x9d, 0x11, 0x51, 0xd2, + 0x34, 0x2d, 0xc8, 0x17, 0x2c, 0x88, 0xb7, 0x99, 0xc6, 0x44, 0xe2, 0xa9, 0x57, 0x61, 0x81, 0x93, + 0x15, 0xa6, 0x2c, 0x92, 0xfc, 0x33, 0x61, 0x11, 0x65, 0x19, 0x77, 0x2b, 0xc1, 0x25, 0x37, 0x5f, + 0xf7, 0xbc, 0xfb, 0x3f, 0xef, 0x9e, 0x79, 0x6b, 0x94, 0xf3, 0x9c, 0xab, 0x7a, 0xaf, 0x8b, 0x34, + 0x6a, 0x39, 0x39, 0xe7, 0x79, 0x41, 0x3c, 0x95, 0xc5, 0xeb, 0xcc, 0x93, 0xb4, 0x24, 0xb5, 0xc4, + 0x65, 0xa5, 0x0b, 0xd0, 0x2f, 0x00, 0xc7, 0x9f, 0x7a, 0xeb, 0xc0, 0xff, 0xb0, 0xe8, 0xcc, 0x03, + 0x96, 0x71, 0x73, 0x0a, 0x07, 0x34, 0x4e, 0xa2, 0x94, 0x30, 0x5e, 0x4e, 0xc0, 0x2b, 0xf0, 0x66, + 0xe0, 0x8f, 0xda, 0xc6, 0x79, 0xba, 0xc5, 0x65, 0x31, 0x47, 0x7f, 0x24, 0x14, 0xde, 0xd0, 0x38, + 0xf9, 0xd8, 0x85, 0xe6, 0x0c, 0xc2, 0x64, 0x85, 0x19, 0x23, 0x45, 0x44, 0xd3, 0xc9, 0x3d, 0xc5, + 0x8c, 0xdb, 0xc6, 0x79, 0xa6, 0x99, 0x8b, 0x86, 0xc2, 0xc1, 0x39, 0x09, 0x52, 0x73, 0x0e, 0x1f, + 0x33, 0x2c, 0xe9, 0x86, 0x9c, 0xbd, 0xee, 0x2b, 0xee, 0x79, 0xdb, 0x38, 0xb7, 0x9a, 0xfb, 0x5b, + 0x45, 0xe1, 0x50, 0xa7, 0xda, 0xd1, 0x85, 0x37, 0xb8, 0xae, 0x89, 0xec, 0xfc, 0x1e, 0x28, 0xee, + 0xb6, 0x6d, 0x9c, 0x27, 0x9a, 0xeb, 0x15, 0x14, 0x3e, 0x52, 0x61, 0x90, 0xa2, 0x6f, 0x00, 0xbe, + 0x08, 0x49, 0xc9, 0x37, 0xe4, 0xfa, 0xd0, 0xff, 0xf6, 0x02, 0xee, 0xd0, 0xcb, 0x12, 0x0e, 0x85, + 0x7a, 0x3a, 0xea, 0x96, 0xac, 0xc6, 0x1f, 0xbe, 0xb5, 0x5c, 0x7d, 0x01, 0xb7, 0xbf, 0x80, 0xbb, + 0xe8, 0x2f, 0xe0, 0xbf, 0xdc, 0x37, 0x8e, 0x71, 0x59, 0x4f, 0x2d, 0xb1, 0x90, 0x8a, 0x45, 0xbb, + 0x1f, 0x0e, 0x08, 0xa1, 0x7e, 0xad, 0xab, 0xf7, 0x67, 0xfb, 0xa3, 0x0d, 0x0e, 0x47, 0x1b, 0xfc, + 0x3c, 0xda, 0x60, 0x77, 0xb2, 0x8d, 0xc3, 0xc9, 0x36, 0xbe, 0x9f, 0x6c, 0x63, 0x69, 0x7d, 0xbd, + 0xf6, 0xab, 0xe4, 0xb6, 0x22, 0x75, 0xfc, 0x50, 0x99, 0xbe, 0xfb, 0x1d, 0x00, 0x00, 0xff, 0xff, + 0xd7, 0x2a, 0x55, 0xb9, 0x81, 0x02, 0x00, 0x00, +} + +func (m *ParachainIBCTokenInfo) 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 *ParachainIBCTokenInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ParachainIBCTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AssetId) > 0 { + i -= len(m.AssetId) + copy(dAtA[i:], m.AssetId) + i = encodeVarintParachainTokenInfo(dAtA, i, uint64(len(m.AssetId))) + i-- + dAtA[i] = 0x22 + } + if len(m.NativeDenom) > 0 { + i -= len(m.NativeDenom) + copy(dAtA[i:], m.NativeDenom) + i = encodeVarintParachainTokenInfo(dAtA, i, uint64(len(m.NativeDenom))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintParachainTokenInfo(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.IbcDenom) > 0 { + i -= len(m.IbcDenom) + copy(dAtA[i:], m.IbcDenom) + i = encodeVarintParachainTokenInfo(dAtA, i, uint64(len(m.IbcDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemoveParachainIBCTokenInfo) 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 *RemoveParachainIBCTokenInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveParachainIBCTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RemoveTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RemoveTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintParachainTokenInfo(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + if len(m.NativeDenom) > 0 { + i -= len(m.NativeDenom) + copy(dAtA[i:], m.NativeDenom) + i = encodeVarintParachainTokenInfo(dAtA, i, uint64(len(m.NativeDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintParachainTokenInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovParachainTokenInfo(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ParachainIBCTokenInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.IbcDenom) + if l > 0 { + n += 1 + l + sovParachainTokenInfo(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovParachainTokenInfo(uint64(l)) + } + l = len(m.NativeDenom) + if l > 0 { + n += 1 + l + sovParachainTokenInfo(uint64(l)) + } + l = len(m.AssetId) + if l > 0 { + n += 1 + l + sovParachainTokenInfo(uint64(l)) + } + return n +} + +func (m *RemoveParachainIBCTokenInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NativeDenom) + if l > 0 { + n += 1 + l + sovParachainTokenInfo(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RemoveTime) + n += 1 + l + sovParachainTokenInfo(uint64(l)) + return n +} + +func sovParachainTokenInfo(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParachainTokenInfo(x uint64) (n int) { + return sovParachainTokenInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ParachainIBCTokenInfo) 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 ErrIntOverflowParachainTokenInfo + } + 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: ParachainIBCTokenInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ParachainIBCTokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParachainTokenInfo + } + 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 ErrInvalidLengthParachainTokenInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParachainTokenInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IbcDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParachainTokenInfo + } + 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 ErrInvalidLengthParachainTokenInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParachainTokenInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NativeDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParachainTokenInfo + } + 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 ErrInvalidLengthParachainTokenInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParachainTokenInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NativeDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParachainTokenInfo + } + 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 ErrInvalidLengthParachainTokenInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParachainTokenInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParachainTokenInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParachainTokenInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveParachainIBCTokenInfo) 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 ErrIntOverflowParachainTokenInfo + } + 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: RemoveParachainIBCTokenInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveParachainIBCTokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NativeDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParachainTokenInfo + } + 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 ErrInvalidLengthParachainTokenInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParachainTokenInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NativeDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemoveTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParachainTokenInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParachainTokenInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParachainTokenInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.RemoveTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParachainTokenInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParachainTokenInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParachainTokenInfo(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParachainTokenInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParachainTokenInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParachainTokenInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParachainTokenInfo + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParachainTokenInfo + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParachainTokenInfo + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParachainTokenInfo = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParachainTokenInfo = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParachainTokenInfo = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/transfermiddleware/types/params.go b/x/transfermiddleware/types/params.go new file mode 100644 index 000000000..5b252f053 --- /dev/null +++ b/x/transfermiddleware/types/params.go @@ -0,0 +1,40 @@ +package types + +import ( + fmt "fmt" + "time" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +var KeyRemoveParaTokenDuration = []byte("RemoveParaTokenDuration") + +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +func NewParams(removeDuration time.Duration) Params { + return Params{ + Duration: removeDuration, + } +} + +// DefaultParams is the default parameter configuration for the transfermiddleware module. +func DefaultParams() Params { + return NewParams(168 * time.Hour) // 168h (1 week) +} + +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyRemoveParaTokenDuration, &p.Duration, validateTimeDuration), + } +} + +func validateTimeDuration(i interface{}) error { + _, ok := i.(time.Duration) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + return nil +} diff --git a/x/transfermiddleware/types/params.pb.go b/x/transfermiddleware/types/params.pb.go new file mode 100644 index 000000000..bac319c24 --- /dev/null +++ b/x/transfermiddleware/types/params.pb.go @@ -0,0 +1,327 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: centauri/transfermiddleware/v1beta1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params holds parameters for the mint module. +type Params struct { + Duration time.Duration `protobuf:"bytes,1,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_1f53976bc1ed34da, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetDuration() time.Duration { + if m != nil { + return m.Duration + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "centauri.transfermiddleware.v1beta1.Params") +} + +func init() { + proto.RegisterFile("centauri/transfermiddleware/v1beta1/params.proto", fileDescriptor_1f53976bc1ed34da) +} + +var fileDescriptor_1f53976bc1ed34da = []byte{ + // 239 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x48, 0x4e, 0xcd, 0x2b, + 0x49, 0x2c, 0x2d, 0xca, 0xd4, 0x2f, 0x29, 0x4a, 0xcc, 0x2b, 0x4e, 0x4b, 0x2d, 0xca, 0xcd, 0x4c, + 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, + 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x86, 0xe9, + 0xd0, 0xc3, 0xd4, 0xa1, 0x07, 0xd5, 0x21, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xaf, 0x0f, + 0x62, 0x41, 0xb4, 0x4a, 0xc9, 0xa5, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4, 0xea, 0x83, 0x79, 0x49, 0xa5, + 0x69, 0xfa, 0x29, 0xa5, 0x45, 0x89, 0x25, 0x99, 0xf9, 0x79, 0x10, 0x79, 0xa5, 0x22, 0x2e, 0xb6, + 0x00, 0xb0, 0x55, 0x42, 0x19, 0x5c, 0x1c, 0x30, 0x39, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, + 0x49, 0x3d, 0x88, 0x66, 0x3d, 0x98, 0x66, 0x3d, 0x17, 0xa8, 0x02, 0x27, 0xc3, 0x13, 0xf7, 0xe4, + 0x19, 0x5e, 0xdd, 0x93, 0x17, 0x82, 0x69, 0xd1, 0xc9, 0xcf, 0xcd, 0x2c, 0x49, 0xcd, 0x2d, 0x28, + 0xa9, 0xfc, 0x74, 0x4f, 0x9e, 0xbf, 0x32, 0x31, 0x37, 0xc7, 0x4a, 0x09, 0x26, 0xa7, 0x34, 0xe3, + 0xbe, 0x3c, 0x63, 0x10, 0xdc, 0x74, 0x27, 0x93, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, + 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, + 0x63, 0x88, 0x92, 0xaa, 0xc0, 0x16, 0x26, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x57, + 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x85, 0xdf, 0xf3, 0x3f, 0x01, 0x00, 0x00, +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintParams(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) + n += 1 + l + sovParams(uint64(l)) + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/transfermiddleware/types/query.pb.go b/x/transfermiddleware/types/query.pb.go index 8d68990cc..49ac2c3d0 100644 --- a/x/transfermiddleware/types/query.pb.go +++ b/x/transfermiddleware/types/query.pb.go @@ -119,7 +119,8 @@ func (m *QueryEscrowAddressResponse) GetEscrowAddress() string { return "" } -// QueryParaTokenInfoRequest is the request type for the Query/Params RPC method. +// QueryParaTokenInfoRequest is the request type for the Query/Params RPC +// method. type QueryParaTokenInfoRequest struct { NativeDenom string `protobuf:"bytes,1,opt,name=native_denom,json=nativeDenom,proto3" json:"native_denom,omitempty" yaml:"native_denom"` } @@ -164,7 +165,8 @@ func (m *QueryParaTokenInfoRequest) GetNativeDenom() string { return "" } -// QueryParaTokenInfoResponse is the response type for the Query/ParaTokenInfo RPC method. +// QueryParaTokenInfoResponse is the response type for the Query/ParaTokenInfo +// RPC method. type QueryParaTokenInfoResponse struct { IbcDenom string `protobuf:"bytes,1,opt,name=ibc_denom,json=ibcDenom,proto3" json:"ibc_denom,omitempty" yaml:"ibc_denom"` ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` diff --git a/x/transfermiddleware/types/tx.pb.go b/x/transfermiddleware/types/tx.pb.go index d4f731e50..ff5a1ef70 100644 --- a/x/transfermiddleware/types/tx.pb.go +++ b/x/transfermiddleware/types/tx.pb.go @@ -31,7 +31,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgAddParachainInfo represents a message to add new parachain info. type MsgAddParachainIBCTokenInfo struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty" yaml:"authority"` ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` IbcDenom string `protobuf:"bytes,3,opt,name=ibc_denom,json=ibcDenom,proto3" json:"ibc_denom,omitempty" yaml:"ibc_denom"` @@ -143,9 +144,11 @@ func (m *MsgAddParachainIBCTokenInfoResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddParachainIBCTokenInfoResponse proto.InternalMessageInfo -// MsgRemoveParachainIBCTokenInfo represents a message to remove new parachain info. +// MsgRemoveParachainIBCTokenInfo represents a message to remove new parachain +// info. type MsgRemoveParachainIBCTokenInfo struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty" yaml:"authority"` NativeDenom string `protobuf:"bytes,2,opt,name=native_denom,json=nativeDenom,proto3" json:"native_denom,omitempty" yaml:"ibc_denom"` } @@ -237,7 +240,8 @@ var xxx_messageInfo_MsgRemoveParachainIBCTokenInfoResponse proto.InternalMessage // MsgAddRlyAddress represents a message to add new rly address to allow list type MsgAddRlyAddress struct { - // authority is the address that controls the module (defaults to x/gov unless overwritten). + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty" yaml:"authority"` RlyAddress string `protobuf:"bytes,2,opt,name=rly_address,json=rlyAddress,proto3" json:"rly_address,omitempty" yaml:"rly_address"` }