diff --git a/RELEASE.md b/RELEASE.md index 9d8590495..0e89807a5 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,5 @@ Features: -- Signature verification codebase for metamask token send and EIP712 transactions -- Transaction type text updates to use camelcase -- Upgrade genesis script modification to migrate from v0.3.17 to v0.3.45 +- Tokens module refactoring (#664) +- Layer2 improvement (#668) +- Fix storeKeys for layer2 and recovery modules diff --git a/app/ante/ante.go b/app/ante/ante.go index 0daf6ef59..680749a43 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -329,11 +329,11 @@ func (svd ValidateFeeRangeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu feeCoins := feeTx.GetFee() tokensBlackWhite := svd.tk.GetTokenBlackWhites(ctx) for _, feeCoin := range feeCoins { - rate := svd.tk.GetTokenRate(ctx, feeCoin.Denom) + rate := svd.tk.GetTokenInfo(ctx, feeCoin.Denom) if !properties.EnableForeignFeePayments && feeCoin.Denom != defaultDenom { return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("foreign fee payments is disabled by governance")) } - if rate == nil || !rate.FeePayments { + if rate == nil || !rate.FeeEnabled { return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("currency you are trying to use was not whitelisted as fee payment")) } if tokensBlackWhite.IsFrozen(feeCoin.Denom, defaultDenom, properties.EnableTokenBlacklist, properties.EnableTokenWhitelist) { diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index 22617898b..31109cb9a 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" + "cosmossdk.io/math" customante "github.com/KiraCore/sekai/app/ante" "github.com/KiraCore/sekai/types" govtypes "github.com/KiraCore/sekai/x/gov/types" @@ -555,15 +556,19 @@ func (suite *AnteTestSuite) TestPoorNetworkManagementDecorator() { "invalid transaction type on poor network", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { msgs := []sdk.Msg{ - tokenstypes.NewMsgUpsertTokenRate( + tokenstypes.NewMsgUpsertTokenInfo( accounts[4].acc.GetAddress(), + "adr20", "foo", - sdk.NewDec(1), - true, - sdk.ZeroDec(), - sdk.ZeroInt(), - false, - false, + sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), + sdk.ZeroDec(), sdk.ZeroInt(), + false, false, + "FOO", + "Foo", + "", + 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), } return msgs, privs[0:1], accNums[0:1], []uint64{1}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 100)) diff --git a/app/app.go b/app/app.go index 0b4313cfa..229e887a4 100644 --- a/app/app.go +++ b/app/app.go @@ -235,7 +235,7 @@ func NewInitApp( evidencetypes.StoreKey, custodytypes.StoreKey, collectivestypes.ModuleName, - layer2types.ModuleName, + layer2types.StoreKey, consensusparamtypes.StoreKey, ) tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -311,11 +311,12 @@ func NewInitApp( ) app.Layer2Keeper = layer2keeper.NewKeeper( - keys[collectivestypes.StoreKey], appCodec, + keys[layer2types.StoreKey], appCodec, app.BankKeeper, app.CustomStakingKeeper, app.CustomGovKeeper, app.SpendingKeeper, + app.TokensKeeper, ) app.UpgradeKeeper = upgradekeeper.NewKeeper(keys[upgradetypes.StoreKey], appCodec, app.CustomStakingKeeper) @@ -337,7 +338,7 @@ func NewInitApp( app.RecoveryKeeper = recoverykeeper.NewKeeper( appCodec, - keys[slashingtypes.StoreKey], + keys[recoverytypes.StoreKey], app.AccountKeeper, app.BankKeeper, &customStakingKeeper, @@ -346,15 +347,23 @@ func NewInitApp( app.CollectivesKeeper, app.SpendingKeeper, app.CustodyKeeper, + app.TokensKeeper, ) app.DistrKeeper = distributorkeeper.NewKeeper( keys[distributortypes.ModuleName], appCodec, app.AccountKeeper, app.BankKeeper, app.CustomStakingKeeper, app.CustomGovKeeper, - app.MultiStakingKeeper, app.RecoveryKeeper) + app.MultiStakingKeeper, app.RecoveryKeeper, app.TokensKeeper) app.MultiStakingKeeper.SetDistrKeeper(app.DistrKeeper) - app.UbiKeeper = ubikeeper.NewKeeper(keys[ubitypes.ModuleName], appCodec, app.BankKeeper, app.SpendingKeeper, app.DistrKeeper) + app.UbiKeeper = ubikeeper.NewKeeper( + keys[ubitypes.ModuleName], + appCodec, + app.BankKeeper, + app.SpendingKeeper, + app.DistrKeeper, + app.TokensKeeper, + ) proposalRouter := govtypes.NewProposalRouter( []govtypes.ProposalHandler{ @@ -370,8 +379,7 @@ func NewInitApp( customgov.NewApplyResetWholeCouncilorRankProposalHandler(app.CustomGovKeeper), customgov.NewApplyJailCouncilorProposalHandler(app.CustomGovKeeper), customgov.NewApplySetExecutionFeesProposalHandler(app.CustomGovKeeper), - tokens.NewApplyUpsertTokenAliasProposalHandler(app.TokensKeeper), - tokens.NewApplyUpsertTokenRatesProposalHandler(app.TokensKeeper), + tokens.NewApplyUpsertTokenInfosProposalHandler(app.TokensKeeper), tokens.NewApplyWhiteBlackChangeProposalHandler(app.TokensKeeper), customstaking.NewApplyUnjailValidatorProposalHandler(app.CustomStakingKeeper, app.CustomGovKeeper), customslashing.NewApplyResetWholeValidatorRankProposalHandler(app.CustomSlashingKeeper), diff --git a/proto/kira/gov/permission.proto b/proto/kira/gov/permission.proto index 1193f7874..15727b221 100644 --- a/proto/kira/gov/permission.proto +++ b/proto/kira/gov/permission.proto @@ -27,14 +27,11 @@ enum PermValue { // Proposal to whitelist account permission. PERMISSION_VOTE_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL = 5 [(gogoproto.enumvalue_customname) = "PermVoteWhitelistAccountPermissionProposal"]; - // PERMISSION_UPSERT_TOKEN_ALIAS - PERMISSION_UPSERT_TOKEN_ALIAS = 6 [(gogoproto.enumvalue_customname) = "PermUpsertTokenAlias"]; - // PERMISSION_CHANGE_TX_FEE PERMISSION_CHANGE_TX_FEE = 7 [(gogoproto.enumvalue_customname) = "PermChangeTxFee"]; // PERMISSION_UPSERT_TOKEN_RATE - PERMISSION_UPSERT_TOKEN_RATE = 8 [(gogoproto.enumvalue_customname) = "PermUpsertTokenRate"]; + PERMISSION_UPSERT_TOKEN_RATE = 8 [(gogoproto.enumvalue_customname) = "PermUpsertTokenInfo"]; // PERMISSION_UPSERT_ROLE makes possible to add, modify and assign roles. PERMISSION_UPSERT_ROLE = 9 [(gogoproto.enumvalue_customname) = "PermUpsertRole"]; @@ -52,12 +49,6 @@ enum PermValue { // Proposal to set network property. PERMISSION_VOTE_SET_NETWORK_PROPERTY_PROPOSAL = 13 [(gogoproto.enumvalue_customname) = "PermVoteSetNetworkPropertyProposal"]; - // PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL defines the permission needed to create proposals for upsert token Alias. - PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL = 14 [(gogoproto.enumvalue_customname) = "PermCreateUpsertTokenAliasProposal"]; - - // PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL defines the permission needed to vote proposals for upsert token. - PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL = 15 [(gogoproto.enumvalue_customname) = "PermVoteUpsertTokenAliasProposal"]; - // PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES defines the permission needed to create proposals for setting poor network messages PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES = 16 [(gogoproto.enumvalue_customname) = "PermCreateSetPoorNetworkMessagesProposal"]; @@ -65,10 +56,10 @@ enum PermValue { PERMISSION_VOTE_SET_POOR_NETWORK_MESSAGES_PROPOSAL = 17 [(gogoproto.enumvalue_customname) = "PermVoteSetPoorNetworkMessagesProposal"]; // PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL defines the permission needed to create proposals for upsert token rate. - PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL = 18 [(gogoproto.enumvalue_customname) = "PermCreateUpsertTokenRateProposal"]; + PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL = 18 [(gogoproto.enumvalue_customname) = "PermCreateUpsertTokenInfoProposal"]; // PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL defines the permission needed to vote proposals for upsert token rate. - PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL = 19 [(gogoproto.enumvalue_customname) = "PermVoteUpsertTokenRateProposal"]; + PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL = 19 [(gogoproto.enumvalue_customname) = "PermVoteUpsertTokenInfoProposal"]; // PERMISSION_CREATE_UNJAIL_VALIDATOR_PROPOSAL defines the permission needed to create a proposal to unjail a validator. PERMISSION_CREATE_UNJAIL_VALIDATOR_PROPOSAL = 20 [(gogoproto.enumvalue_customname) = "PermCreateUnjailValidatorProposal"]; diff --git a/proto/kira/layer2/layer2.proto b/proto/kira/layer2/layer2.proto index 24d96bf49..53d6cd3d6 100644 --- a/proto/kira/layer2/layer2.proto +++ b/proto/kira/layer2/layer2.proto @@ -44,7 +44,7 @@ message LpPoolConfig { uint64 drip = 3; // time over which tokens should be distributed (can not be modified) } -message IssuranceConfig { +message IssuanceConfig { string deposit = 1; // spending pool id/name or kira address for extra dp deposit string premint = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", @@ -68,7 +68,7 @@ message Dapp { Controllers controllers = 8 [ (gogoproto.nullable) = false ]; // list of dApp owners, who can curate the execution record repeated BinaryInfo bin = 9 [ (gogoproto.nullable) = false ]; // array of files & their details essential for launching the dApp LpPoolConfig pool = 10 [ (gogoproto.nullable) = false ]; // lp pool configuration (can not be modified) - IssuranceConfig issurance = 11 [ (gogoproto.nullable) = false ]; // extra dApp (dp) token issuance configuration + IssuanceConfig issuance = 11 [ (gogoproto.nullable) = false ]; // extra dApp (dp) token issuance configuration uint64 update_time_max = 12; // maximum time the dApp leader has to update his session (can be no more then 86400 - 24h) uint64 executors_min = 13; // minimum number of validators that will be executing the dApp code (default 1) uint64 executors_max = 14; // maximum number of validators that will be executing the dApp code (default 21) @@ -93,6 +93,7 @@ message Dapp { string team_reserve = 24; // team multisig uint64 premint_time = 25; // timestamp for premint bool post_mint_paid = 26; // flag to show post mint paid or not + bool enable_bond_verifiers = 27; // flag to enable verifiers with bonding } message UserDappBond { diff --git a/proto/kira/layer2/mint.proto b/proto/kira/layer2/mint.proto deleted file mode 100644 index 2d966f88e..000000000 --- a/proto/kira/layer2/mint.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; -package kira.layer2; - -option go_package = "github.com/KiraCore/sekai/x/layer2/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; - -message TokenInfo { - string token_type = 1; // Token Type / Compatibility (can NOT be changed or owner defined) - string denom = 2; // full denom, e.g. ap_kirabridge_btc or class identifier (can NOT be changed) - string name = 3; // full name, eg. Bitcoin, (can only be changed by the proposal-upsert-alias) - string symbol = 4; // symbnol, eg. KEX, BTC, (can only be changed by the proposal-upsert-alias) - string icon = 5; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - string description = 6; // 512 chars max, (can be changed by owner or proposal-upsert-alias) - string website = 7; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - string social = 8; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - uint64 decimals = 9; // min 0, max 255, (can NOT be changed) - string cap = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; // maximum supply that can be issued, max 2^256 - 1, (can NOT be INCREASED or decreased below current circulatin supply) - string supply = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; // current circulating supply can NOT be more then CAP - uint64 holders = 12; - string fee = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) - string owner = 14; // owner address or "" if noone should be able to modify most important properties - string metadata = 15; // metadata url or CID - string hash = 16; // hexadecimal metadata checksum -} diff --git a/proto/kira/layer2/query.proto b/proto/kira/layer2/query.proto index 341a7197d..e66e141a5 100644 --- a/proto/kira/layer2/query.proto +++ b/proto/kira/layer2/query.proto @@ -6,7 +6,6 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/api/annotations.proto"; import "kira/layer2/layer2.proto"; -import "kira/layer2/mint.proto"; option go_package = "github.com/KiraCore/sekai/x/layer2/types"; @@ -26,14 +25,6 @@ service Query { rpc TransferDapps(QueryTransferDappsRequest) returns (QueryTransferDappsResponse) { option (google.api.http).get = "/kira/layer2/transfer_dapp"; } - // query list of all token denoms on the network including those created in - // the genesis (ukex, samolean etc..) as well as those in the minting module, - // lp tokens, validator recovery tokens and so on. If the flag with specific - // name is specified provide a detailed information about the token including - // its current circulating supply etc. - rpc GlobalTokens(QueryGlobalTokensRequest) returns (QueryGlobalTokensResponse) { - option (google.api.http).get = "/kira/layer2/global_tokens"; - } } message QueryExecutionRegistrarRequest { @@ -53,8 +44,3 @@ message QueryTransferDappsRequest {} message QueryTransferDappsResponse { repeated XAM XAMs = 1 [ (gogoproto.nullable) = false ]; } - -message QueryGlobalTokensRequest {} -message QueryGlobalTokensResponse { - repeated TokenInfo tokens = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/kira/layer2/tx.proto b/proto/kira/layer2/tx.proto index 92fdbad14..7fc8292df 100644 --- a/proto/kira/layer2/tx.proto +++ b/proto/kira/layer2/tx.proto @@ -237,7 +237,7 @@ message MsgMintCreateFtTx { string description = 6; // 512 chars max, (can be changed by owner or proposal-upsert-alias) string website = 7; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) string social = 8; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - uint64 decimals = 9; // min 0, max 255, (can NOT be changed) + uint32 decimals = 9; // min 0, max 255, (can NOT be changed) string cap = 10 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false @@ -247,8 +247,8 @@ message MsgMintCreateFtTx { (gogoproto.nullable) = false ]; // current circulating supply can NOT be more then CAP uint64 holders = 12; - string fee = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + string fee_rate = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) string owner = 14; // owner address or "" if noone should be able to modify most important properties @@ -265,7 +265,7 @@ message MsgMintCreateNftTx { string description = 6; // 512 chars max, (can be changed by owner or proposal-upsert-alias) string website = 7; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) string social = 8; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - uint64 decimals = 9; // min 0, max 255, (can NOT be changed) + uint32 decimals = 9; // min 0, max 255, (can NOT be changed) string cap = 10 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false @@ -275,8 +275,8 @@ message MsgMintCreateNftTx { (gogoproto.nullable) = false ]; // current circulating supply can NOT be more then CAP uint64 holders = 12; - string fee = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + string fee_rate = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) string owner = 14; // owner address or "" if noone should be able to modify most important properties diff --git a/proto/kira/tokens/alias.proto b/proto/kira/tokens/alias.proto deleted file mode 100644 index be0b4cdbc..000000000 --- a/proto/kira/tokens/alias.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; -package kira.tokens; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/KiraCore/sekai/x/tokens/types"; - -message TokenAlias { - string symbol = 1;// Ticker (eg. ATOM, KEX, BTC) - string name = 2; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 3; // Graphical Symbol (url link to graphics) - uint32 decimals = 4; // Integer number of max decimals - repeated string denoms = 5; // An array of token denoms to be aliased - bool invalidated = 6; // flag that the token is invalidated or not -} - -message MsgUpsertTokenAlias { - string symbol = 1;// Ticker (eg. ATOM, KEX, BTC) - string name = 2; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 3; // Graphical Symbol (url link to graphics) - uint32 decimals = 4; // Integer number of max decimals - repeated string denoms = 5; // An array of token denoms to be aliased - bool invalidated = 6; // flag that the token is invalidated or not - bytes proposer = 7 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", - (gogoproto.moretags) = "yaml:\"proposer\"" - ]; -} diff --git a/proto/kira/tokens/genesis.proto b/proto/kira/tokens/genesis.proto index 785d97e64..785b08796 100644 --- a/proto/kira/tokens/genesis.proto +++ b/proto/kira/tokens/genesis.proto @@ -1,14 +1,13 @@ syntax = "proto3"; package kira.tokens; -import "kira/tokens/alias.proto"; -import "kira/tokens/rate.proto"; +import "gogoproto/gogo.proto"; +import "kira/tokens/token.proto"; import "kira/tokens/freeze.proto"; option go_package = "github.com/KiraCore/sekai/x/tokens/types"; message GenesisState { - repeated kira.tokens.TokenAlias aliases = 1; - repeated kira.tokens.TokenRate rates = 2; - TokensWhiteBlack tokenBlackWhites = 3; + repeated kira.tokens.TokenInfo tokenInfos = 1 [ (gogoproto.nullable) = false ]; + TokensWhiteBlack tokenBlackWhites = 2 [ (gogoproto.nullable) = false ]; } diff --git a/proto/kira/tokens/proposal.proto b/proto/kira/tokens/proposal.proto index fc6608806..8de7e8059 100644 --- a/proto/kira/tokens/proposal.proto +++ b/proto/kira/tokens/proposal.proto @@ -6,40 +6,51 @@ import "cosmos_proto/cosmos.proto"; option go_package = "github.com/KiraCore/sekai/x/tokens/types"; - -message ProposalUpsertTokenAlias { - option (cosmos_proto.implements_interface) = "Content"; - option (gogoproto.equal) = true; - - string symbol = 1; - string name = 2; - string icon = 3; - uint32 decimals = 4; - repeated string denoms = 5; - bool invalidated = 6; -} - -message ProposalUpsertTokenRates { +message ProposalUpsertTokenInfo { option (cosmos_proto.implements_interface) = "Content"; option (gogoproto.equal) = true; string denom = 1; // denomination target - string rate = 2 [ - (gogoproto.moretags) = "yaml:\"rate\"", + string token_type = 2; // Token Type / Compatibility (can NOT be changed or owner defined) + string fee_rate = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // Exchange rate in terms of KEX token - bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment methodß - string stake_cap = 4 [ + (gogoproto.nullable) = false + ]; // Exchange rate in terms of KEX token + bool fee_enabled = 4; // Properties defining if it is enabled or disabled as fee payment method + string supply = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // current circulating supply can NOT be more then CAP + string supply_cap = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // maximum supply that can be issued, max 2^256 - 1, (can NOT be INCREASED or decreased below current circulatin supply) + string stake_cap = 7 [ (gogoproto.moretags) = "yaml:\"stake_cap\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // rewards cap, sum should be lower than 100% - string stake_min = 5 [ + string stake_min = 8 [ (gogoproto.moretags) = "yaml:\"stake_min\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; - bool stake_token = 6; - bool invalidated = 7; + bool stake_enabled = 9; + bool inactive = 10; // flag that the token is inactive or not + string symbol = 11; // Ticker (eg. ATOM, KEX, BTC) + string name = 12; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 13; // Graphical Symbol (url link to graphics) + uint32 decimals = 14; // Integer number of max decimals, min 0, max 255, (can NOT be changed) + string description = 15; // 512 chars max, (can be changed by owner or proposal-upsert-alias) + string website = 16; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + string social = 17; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + uint64 holders = 18; + string minting_fee = 19 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) + string owner = 20; // owner address or "" if noone should be able to modify most important properties + bool owner_edit_disabled = 21; // owner is disabled to edit token info + string nft_metadata = 22; // metadata url or CID + string nft_hash = 23; // hexadecimal metadata checksum } diff --git a/proto/kira/tokens/query.proto b/proto/kira/tokens/query.proto index 1710bf036..82dbbb625 100644 --- a/proto/kira/tokens/query.proto +++ b/proto/kira/tokens/query.proto @@ -1,79 +1,56 @@ syntax = "proto3"; package kira.tokens; -import "kira/tokens/alias.proto"; -import "kira/tokens/rate.proto"; +import "kira/tokens/token.proto"; import "kira/tokens/freeze.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/KiraCore/sekai/x/tokens/types"; // Query defines the gRPC querier service service Query { - // Returns the token alias - rpc GetTokenAlias (TokenAliasRequest) returns (TokenAliasResponse) {} - rpc GetAllTokenAliases (AllTokenAliasesRequest) returns (AllTokenAliasesResponse) { - option (google.api.http).get = "/kira/tokens/aliases"; + // Returns the token infos + rpc GetTokenInfo (TokenInfoRequest) returns (TokenInfoResponse) { + option (google.api.http).get = "/kira/tokens/info"; } - rpc GetTokenAliasesByDenom (TokenAliasesByDenomRequest) returns (TokenAliasesByDenomResponse) {} - // Returns the token rates - rpc GetTokenRate (TokenRateRequest) returns (TokenRateResponse) {} - rpc GetAllTokenRates (AllTokenRatesRequest) returns (AllTokenRatesResponse) { - option (google.api.http).get = "/kira/tokens/rates"; + rpc GetAllTokenInfos (AllTokenInfosRequest) returns (AllTokenInfosResponse) { + option (google.api.http).get = "/kira/tokens/infos"; + } + rpc GetTokenInfosByDenom (TokenInfosByDenomRequest) returns (TokenInfosByDenomResponse) { + option (google.api.http).get = "/kira/tokens/infos_by_denom"; } - rpc GetTokenRatesByDenom (TokenRatesByDenomRequest) returns (TokenRatesByDenomResponse) {} // Returns tokens black/white lists - rpc GetTokenBlackWhites (TokenBlackWhitesRequest) returns (TokenBlackWhitesResponse) {} -} - -message TokenAliasRequest { - string symbol = 1; -} - -message TokenAliasResponse { - kira.tokens.TokenAlias data = 1; -} - -message AllTokenAliasesRequest {} - -message AllTokenAliasesResponse { - repeated kira.tokens.TokenAlias data = 1; - string default_denom = 2; - string bech32_prefix = 3; -} - -message TokenAliasesByDenomRequest { - repeated string denoms = 1; -} - -message TokenAliasesByDenomResponse { - map data = 1; + rpc GetTokenBlackWhites (TokenBlackWhitesRequest) returns (TokenBlackWhitesResponse) { + option (google.api.http).get = "/kira/tokens/black_whites"; + } } -message TokenRateRequest { +message TokenInfoRequest { string denom = 1; } -message TokenRateResponse { - kira.tokens.TokenRate data = 1; +message TokenInfoResponse { + kira.tokens.TokenInfo data = 1; + cosmos.base.v1beta1.Coin supply = 2 [(gogoproto.nullable) = false]; } -message AllTokenRatesRequest {} +message AllTokenInfosRequest {} -message AllTokenRatesResponse { - repeated kira.tokens.TokenRate data = 1; +message AllTokenInfosResponse { + repeated TokenInfoResponse data = 1 [ (gogoproto.nullable) = false ]; } -message TokenRatesByDenomRequest { +message TokenInfosByDenomRequest { repeated string denoms = 1; } -message TokenRatesByDenomResponse { - map data = 1; +message TokenInfosByDenomResponse { + map data = 1 [ (gogoproto.nullable) = false ]; } message TokenBlackWhitesRequest {} message TokenBlackWhitesResponse { - TokensWhiteBlack data = 1; + TokensWhiteBlack data = 1 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/proto/kira/tokens/rate.proto b/proto/kira/tokens/rate.proto deleted file mode 100644 index 6095e616a..000000000 --- a/proto/kira/tokens/rate.proto +++ /dev/null @@ -1,54 +0,0 @@ -syntax = "proto3"; -package kira.tokens; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/KiraCore/sekai/x/tokens/types"; - -message TokenRate { - string denom = 1; // denomination target - string fee_rate = 2 [ - (gogoproto.moretags) = "yaml:\"fee_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // Exchange rate in terms of KEX token - bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment method - string stake_cap = 4 [ - (gogoproto.moretags) = "yaml:\"stake_cap\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // rewards cap, sum should be lower than 100% - string stake_min = 5 [ - (gogoproto.moretags) = "yaml:\"stake_min\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - bool stake_token = 6; - bool invalidated = 7; // flag that the token is invalidated or not -} - -message MsgUpsertTokenRate { - string denom = 1; // denomination target - string rate = 2 [ - (gogoproto.moretags) = "yaml:\"rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // Exchange rate in terms of KEX token - bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment method - string stake_cap = 4 [ - (gogoproto.moretags) = "yaml:\"stake_cap\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // rewards cap, sum should be lower than 100% - string stake_min = 5 [ - (gogoproto.moretags) = "yaml:\"stake_min\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - bool stake_token = 6; - bool invalidated = 7; // flag that the token is invalidated or not - bytes proposer = 8 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", - (gogoproto.moretags) = "yaml:\"proposer\"" - ]; -} diff --git a/proto/kira/tokens/token.proto b/proto/kira/tokens/token.proto new file mode 100644 index 000000000..540903268 --- /dev/null +++ b/proto/kira/tokens/token.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package kira.tokens; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/KiraCore/sekai/x/tokens/types"; + +message TokenInfo { + string denom = 1; // denomination target + string token_type = 2; // Token Type / Compatibility (can NOT be changed or owner defined) + string fee_rate = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // Exchange rate in terms of KEX token + bool fee_enabled = 4; // Properties defining if it is enabled or disabled as fee payment method + string supply = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // current circulating supply can NOT be more then CAP + string supply_cap = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // maximum supply that can be issued, max 2^256 - 1, (can NOT be INCREASED or decreased below current circulatin supply) + string stake_cap = 7 [ + (gogoproto.moretags) = "yaml:\"stake_cap\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // rewards cap, sum should be lower than 100% + string stake_min = 8 [ + (gogoproto.moretags) = "yaml:\"stake_min\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + bool stake_enabled = 9; + bool inactive = 10; // flag that the token is inactive or not + string symbol = 11; // Ticker (eg. ATOM, KEX, BTC) + string name = 12; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 13; // Graphical Symbol (url link to graphics) + uint32 decimals = 14; // Integer number of max decimals, min 0, max 255, (can NOT be changed) + string description = 15; // 512 chars max, (can be changed by owner or proposal-upsert-alias) + string website = 16; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + string social = 17; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + uint64 holders = 18; + string minting_fee = 19 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) + string owner = 20; // owner address or "" if noone should be able to modify most important properties + bool owner_edit_disabled = 21; // owner is disabled to edit token info + string nft_metadata = 22; // metadata url or CID + string nft_hash = 23; // hexadecimal metadata checksum +} diff --git a/proto/kira/tokens/tx.proto b/proto/kira/tokens/tx.proto index ff2509d2a..af74d376a 100644 --- a/proto/kira/tokens/tx.proto +++ b/proto/kira/tokens/tx.proto @@ -3,25 +3,71 @@ package kira.tokens; import "gogoproto/gogo.proto"; -import "kira/tokens/alias.proto"; import "kira/tokens/proposal.proto"; -import "kira/tokens/rate.proto"; +import "kira/tokens/token.proto"; import "kira/tokens/freeze.proto"; option go_package = "github.com/KiraCore/sekai/x/tokens/types"; // Msg defines the tokens Msg service. service Msg { - // UpsertTokenAlias defines a method to upsert token alias - rpc UpsertTokenAlias(MsgUpsertTokenAlias) returns (MsgUpsertTokenAliasResponse); - // UpsertTokenRate defines a method to upsert token rate - rpc UpsertTokenRate(MsgUpsertTokenRate) returns (MsgUpsertTokenRateResponse); - // EthereumTx defines a method to send ethereum transaction - rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse); + // UpsertTokenInfo defines a method to upsert token rate + rpc UpsertTokenInfo(MsgUpsertTokenInfo) returns (MsgUpsertTokenInfoResponse); + // EthereumTx defines a method to send ethereum transaction + rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse); } -message MsgUpsertTokenAliasResponse {} -message MsgUpsertTokenRateResponse {} +message MsgUpsertTokenInfo { + string denom = 1; // denomination target + string token_type = 2; // Token Type / Compatibility (can NOT be changed or owner defined) + string fee_rate = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // Exchange rate in terms of KEX token + bool fee_enabled = 4; // Properties defining if it is enabled or disabled as fee payment method + string supply = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // current circulating supply can NOT be more then CAP + string supply_cap = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // maximum supply that can be issued, max 2^256 - 1, (can NOT be INCREASED or decreased below current circulatin supply) + string stake_cap = 7 [ + (gogoproto.moretags) = "yaml:\"stake_cap\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // rewards cap, sum should be lower than 100% + string stake_min = 8 [ + (gogoproto.moretags) = "yaml:\"stake_min\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + bool stake_enabled = 9; + bool inactive = 10; // flag that the token is inactive or not + string symbol = 11; // Ticker (eg. ATOM, KEX, BTC) + string name = 12; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 13; // Graphical Symbol (url link to graphics) + uint32 decimals = 14; // Integer number of max decimals, min 0, max 255, (can NOT be changed) + string description = 15; // 512 chars max, (can be changed by owner or proposal-upsert-alias) + string website = 16; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + string social = 17; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + uint64 holders = 18; + string minting_fee = 19 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) + string owner = 20; // owner address or "" if noone should be able to modify most important properties + bool owner_edit_disabled = 21; // owner is disabled to edit token info + string nft_metadata = 22; // metadata url or CID + string nft_hash = 23; // hexadecimal metadata checksum + bytes proposer = 24 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.moretags) = "yaml:\"proposer\"" + ]; +} + +message MsgUpsertTokenInfoResponse {} message MsgEthereumTx { string tx_type = 1; diff --git a/scripts/commands/foreign-fee-payments-failure-return.sh b/scripts/commands/foreign-fee-payments-failure-return.sh index 738f0fc50..a9e4fcf2f 100644 --- a/scripts/commands/foreign-fee-payments-failure-return.sh +++ b/scripts/commands/foreign-fee-payments-failure-return.sh @@ -1,7 +1,7 @@ #!/bin/bash # register stake token as 1ukex=100stake -sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenRate --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes +sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes sekaid tx tokens upsert-rate --from validator --keyring-backend=test --denom="stake" --rate="0.01" --fee_payments=true --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes sekaid query tokens rate stake @@ -20,6 +20,6 @@ sekaid query bank balances $(sekaid keys show -a validator --keyring-backend=tes # try upsert-token-alias failure in foreign currency sekaid tx tokens upsert-alias --from validator --keyring-backend=test --expiration=0 --enactment=0 --allowed_vote_types=0,1 --symbol="ETH" --name="Ethereum" --icon="myiconurl" --decimals=6 --denoms="finney" --chain-id=testing --fees=500000stake --home=$HOME/.sekaid --yes # set permission for this execution -sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenAlias --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=10000stake --home=$HOME/.sekaid --yes +sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=10000stake --home=$HOME/.sekaid --yes # try upsert-token-alias success in foreign currency sekaid tx tokens upsert-alias --from validator --keyring-backend=test --expiration=0 --enactment=0 --allowed_vote_types=0,1 --symbol="ETH" --name="Ethereum" --icon="myiconurl" --decimals=6 --denoms="finney" --chain-id=testing --fees=500000stake --home=$HOME/.sekaid --yes \ No newline at end of file diff --git a/scripts/commands/foreign-fee-payments.sh b/scripts/commands/foreign-fee-payments.sh index 2da22c20c..5930f9c18 100644 --- a/scripts/commands/foreign-fee-payments.sh +++ b/scripts/commands/foreign-fee-payments.sh @@ -1,8 +1,8 @@ #!/bin/bash # register stake token as 1ukex=100stake -PermUpsertTokenRate=8 -sekaid tx customgov permission whitelist-permission --from validator --keyring-backend=test --permission=$PermUpsertTokenRate --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes +PermUpsertTokenInfo=8 +sekaid tx customgov permission whitelist-permission --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes sekaid tx tokens upsert-rate --from validator --keyring-backend=test --denom="stake" --rate="0.01" --fee_payments=true --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes sekaid query tokens rate stake # try to spend stake token as fee diff --git a/scripts/commands/governance/poor-network-messages.sh b/scripts/commands/governance/poor-network-messages.sh index 4aa90d753..ff46c394f 100644 --- a/scripts/commands/governance/poor-network-messages.sh +++ b/scripts/commands/governance/poor-network-messages.sh @@ -20,7 +20,7 @@ sekaid tx customgov permission whitelist --from validator --keyring-backend=test # test poor network messages after modifying min_validators section sekaid tx customgov set-network-properties --from validator --min_validators="2" --keyring-backend=test --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes # set permission for upsert token rate -sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenRate --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes +sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes # try running upsert token rate which is not allowed on poor network sekaid tx tokens upsert-rate --from validator --keyring-backend=test --denom="mykex" --rate="1.5" --fee_payments=true --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes # try sending more than allowed amount via bank send diff --git a/scripts/commands/layer2.sh b/scripts/commands/layer2.sh index 4c43209a5..71101f95e 100644 --- a/scripts/commands/layer2.sh +++ b/scripts/commands/layer2.sh @@ -11,7 +11,7 @@ sekaid tx layer2 create-dapp-proposal --dapp-name="l2dex" --denom="ul2d" --dapp- --website="website" --logo="logo" --social="social" --docs="docs" \ --controller-roles="1" --controller-accounts="" --vote-quorum=30 --vote-period=86400 --vote-enactment=1000 \ --bond="1000000ukex" \ - --issurance-config='{"premint":"10000","postmint":"10000","time":"1680044405"}' \ + --issuance-config='{"premint":"10000","postmint":"10000","time":"1680044405"}' \ --lp-pool-config='{"ratio": "1.0", "drip": 86400}' \ --executors-min=1 --executors-max=3 --verifiers-min=1 \ --binary-info='{"name":"layer2dex","hash":"0cc0","source":"github.com","reference":"","type":"exec"}' \ @@ -56,7 +56,7 @@ sekaid tx layer2 proposal-upsert-dapp --title="title" --description="description --website="website" --logo="logo" --social="social" --docs="docs" \ --controller-roles="1" --controller-accounts="" --vote-quorum=30 --vote-period=86400 --vote-enactment=1000 \ --bond="1000000ukex" \ - --issurance-config='{"premint":"10000","postmint":"10000","time":"1680044405"}' \ + --issuance-config='{"premint":"10000","postmint":"10000","time":"1680044405"}' \ --lp-pool-config='{"ratio": "1.0", "drip": 86400}' \ --binary-info='{"name":"layer2dex","hash":"0cc0","source":"github.com","reference":"","type":"exec"}' \ --from=validator --chain-id=testing --fees=100ukex --keyring-backend=test --home=$HOME/.sekaid --yes --broadcast-mode=block diff --git a/scripts/commands/upsert-token-alias.sh b/scripts/commands/upsert-token-alias.sh index b75e88247..da4e69572 100644 --- a/scripts/commands/upsert-token-alias.sh +++ b/scripts/commands/upsert-token-alias.sh @@ -1,6 +1,6 @@ #!/bin/bash -# set PermUpsertTokenAlias permission to validator address -sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenAlias --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes +# set PermUpsertTokenInfo permission to validator address +sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes # run upsert alias sekaid tx tokens upsert-alias --from validator --keyring-backend=test --expiration=0 --enactment=0 --allowed_vote_types=0,1 --symbol="ETH" --name="Ethereum" --icon="myiconurl" --decimals=6 --denoms="finney" --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes \ No newline at end of file diff --git a/scripts/commands/upsert-token-rates.sh b/scripts/commands/upsert-token-rates.sh index ad74e1431..65c21c097 100644 --- a/scripts/commands/upsert-token-rates.sh +++ b/scripts/commands/upsert-token-rates.sh @@ -1,6 +1,6 @@ #!/bin/bash -# set PermUpsertTokenRate permission to validator address -sekaid tx customgov permission whitelist --from=validator --keyring-backend=test --permission=$PermUpsertTokenRate --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes --broadcast-mode=block +# set PermUpsertTokenInfo permission to validator address +sekaid tx customgov permission whitelist --from=validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes --broadcast-mode=block # run upsert rate sekaid tx tokens upsert-rate --from=validator --keyring-backend=test --denom="mykex" --rate="1.5" --fee_payments=true --stake_cap=0.1 --stake_token=true --stake_min=1 --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes --broadcast-mode=block \ No newline at end of file diff --git a/scripts/sekai-env.sh b/scripts/sekai-env.sh index e457a8a96..0dfd59911 100755 --- a/scripts/sekai-env.sh +++ b/scripts/sekai-env.sh @@ -20,14 +20,11 @@ PermWhitelistAccountPermissionProposal=4 # permission to vote on a proposal to whitelist account permission PermVoteWhitelistAccountPermissionProposal=5 -# permission to upsert token alias -PermUpsertTokenAlias=6 - # permission to change transaction fees - execution fee and fee range PermChangeTxFee=7 # permission to upsert token rates -PermUpsertTokenRate=8 +PermUpsertTokenInfo=8 # permission to add, modify and assign roles PermUpsertRole=9 @@ -44,12 +41,6 @@ PermCreateSetNetworkPropertyProposal=12 # permission to vote a proposal to set network property PermVoteSetNetworkPropertyProposal=13 -# permission to create proposals to upsert token alias -PermCreateUpsertTokenAliasProposal=14 - -# permission to vote proposals to upsert token alias -PermVoteUpsertTokenAliasProposal=15 - # permission to create proposals for setting poor network messages PermCreateSetPoorNetworkMessagesProposal=16 @@ -57,10 +48,10 @@ PermCreateSetPoorNetworkMessagesProposal=16 PermVoteSetPoorNetworkMessagesProposal=17 # permission to create proposals to upsert token rate -PermCreateUpsertTokenRateProposal=18 +PermCreateUpsertTokenInfoProposal=18 # permission to vote propsals to upsert token rate -PermVoteUpsertTokenRateProposal=19 +PermVoteUpsertTokenInfoProposal=19 # permission to create a proposal to unjail a validator PermCreateUnjailValidatorProposal=20 @@ -229,8 +220,7 @@ MsgTypeBlacklistRolePermission="blacklist-role-permission" MsgTypeRemoveWhitelistRolePermission="remove-whitelist-role-permission" MsgTypeRemoveBlacklistRolePermission="remove-blacklist-role-permission" MsgTypeClaimValidator="claim-validator" -MsgTypeUpsertTokenAlias="upsert-token-alias" -MsgTypeUpsertTokenRate="upsert-token-rate" +MsgTypeUpsertTokenInfo="upsert-token-rate" ###################################### function IDs ###################################### FuncIDMsgSend=1 @@ -257,8 +247,7 @@ FuncIDMsgBlacklistRolePermission=29 FuncIDMsgRemoveWhitelistRolePermission=30 FuncIDMsgRemoveBlacklistRolePermission=31 FuncIDMsgClaimValidator=32 -FuncIDMsgUpsertTokenAlias=33 -FuncIDMsgUpsertTokenRate=34 +FuncIDMsgUpsertTokenInfo=34 FuncIDMsgActivate=35 FuncIDMsgPause=36 FuncIDMsgUnpause=37 \ No newline at end of file diff --git a/scripts/sekai-utils.sh b/scripts/sekai-utils.sh index 73870b88a..899f5e886 100755 --- a/scripts/sekai-utils.sh +++ b/scripts/sekai-utils.sh @@ -771,16 +771,12 @@ function showValidator() { echo $VAL_STATUS } -function showTokenAliases() { - echo $(sekaid query tokens all-aliases --output=json --home=$SEKAID_HOME 2> /dev/null | jsonParse 2> /dev/null || echo -n "") -} - -function showTokenRates() { +function showTokenInfos() { echo $(sekaid query tokens all-rates --output=json --home=$SEKAID_HOME 2> /dev/null | jsonParse 2> /dev/null || echo -n "") } -# setTokenRate -function setTokenRate() { +# setTokenInfo +function setTokenInfo() { local ACCOUNT=$1 local DENOM=$2 local RATE=$3 diff --git a/scripts/test-local/account-permissions.sh b/scripts/test-local/account-permissions.sh index abc103f00..85b4bd228 100644 --- a/scripts/test-local/account-permissions.sh +++ b/scripts/test-local/account-permissions.sh @@ -18,20 +18,17 @@ declare -a perms=( "PermClaimCouncilor" "PermWhitelistAccountPermissionProposal" "PermVoteWhitelistAccountPermissionProposal" - "PermUpsertTokenAlias" "PermChangeTxFee" - "PermUpsertTokenRate" + "PermUpsertTokenInfo" "PermUpsertRole" "PermCreateUpsertDataRegistryProposal" "PermVoteUpsertDataRegistryProposal" "PermCreateSetNetworkPropertyProposal" "PermVoteSetNetworkPropertyProposal" - "PermCreateUpsertTokenAliasProposal" - "PermVoteUpsertTokenAliasProposal" "PermCreateSetPoorNetworkMessagesProposal" "PermVoteSetPoorNetworkMessagesProposal" - "PermCreateUpsertTokenRateProposal" - "PermVoteUpsertTokenRateProposal" + "PermCreateUpsertTokenInfoProposal" + "PermVoteUpsertTokenInfoProposal" "PermCreateUnjailValidatorProposal" "PermVoteUnjailValidatorProposal" "PermCreateRoleProposal" diff --git a/types/Msg.go b/types/Msg.go index a629adea8..0f29239d8 100644 --- a/types/Msg.go +++ b/types/Msg.go @@ -62,9 +62,8 @@ const ( MsgTypeBasketClaimRewards = "basket_claim_rewards" // tokens module - MsgTypeUpsertTokenAlias = "upsert_token_alias" - MsgTypeUpsertTokenRate = "upsert_token_rate" - MsgTypeEthereumTx = "ethereum_tx" + MsgTypeUpsertTokenInfo = "upsert_token_info" + MsgTypeEthereumTx = "ethereum_tx" // slashing module MsgTypeActivate = "activate" @@ -173,8 +172,7 @@ var MsgFuncIDMapping = map[string]int64{ MsgTypeRemoveWhitelistRolePermission: 30, MsgTypeRemoveBlacklistRolePermission: 31, MsgTypeClaimValidator: 32, - MsgTypeUpsertTokenAlias: 33, - MsgTypeUpsertTokenRate: 34, + MsgTypeUpsertTokenInfo: 34, MsgTypeActivate: 35, MsgTypePause: 36, MsgTypeUnpause: 37, diff --git a/types/Proposal.go b/types/Proposal.go index 0465bece0..10eb5cd56 100644 --- a/types/Proposal.go +++ b/types/Proposal.go @@ -3,8 +3,7 @@ package types const ( ProposalTypeSoftwareUpgrade = "SoftwareUpgrade" ProposalTypeCancelSoftwareUpgrade = "CancelSoftwareUpgrade" - ProposalTypeUpsertTokenAlias = "UpsertTokenAlias" - ProposalTypeUpsertTokenRates = "UpsertTokenRates" + ProposalTypeUpsertTokenInfos = "UpsertTokenInfos" ProposalTypeTokensWhiteBlackChange = "TokensWhiteBlackChange" ProposalTypeUnjailValidator = "UnjailValidator" ProposalTypeResetWholeValidatorRank = "ResetWholeValidatorRank" @@ -50,8 +49,7 @@ const ( var AllProposalTypes []string = []string{ ProposalTypeSoftwareUpgrade, ProposalTypeCancelSoftwareUpgrade, - ProposalTypeUpsertTokenAlias, - ProposalTypeUpsertTokenRates, + ProposalTypeUpsertTokenInfos, ProposalTypeTokensWhiteBlackChange, ProposalTypeUnjailValidator, ProposalTypeResetWholeValidatorRank, diff --git a/types/constants.go b/types/constants.go index bc4b930d2..9adeb98bf 100644 --- a/types/constants.go +++ b/types/constants.go @@ -3,6 +3,6 @@ package types const ( // we set page iteration limit for safety PageIterationLimit = 512 - SekaiVersion = "v0.3.45" + SekaiVersion = "v0.4.0" CosmosVersion = "v0.47.6" ) diff --git a/x/basket/keeper/hooks.go b/x/basket/keeper/hooks.go index d5cc09b06..56d2358eb 100644 --- a/x/basket/keeper/hooks.go +++ b/x/basket/keeper/hooks.go @@ -9,9 +9,9 @@ import ( ) func (k Keeper) AfterUpsertStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool) { - rates := k.tk.GetAllTokenRates(ctx) + rates := k.tk.GetAllTokenInfos(ctx) for _, rate := range rates { - if rate.StakeToken { + if rate.StakeEnabled { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) if err != nil { basket = types.Basket{ @@ -58,9 +58,9 @@ func (k Keeper) AfterUpsertStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, } func (k Keeper) AfterSlashStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool, slash sdk.Dec) { - rates := k.tk.GetAllTokenRates(ctx) + rates := k.tk.GetAllTokenInfos(ctx) for _, rate := range rates { - if rate.StakeToken { + if rate.StakeEnabled { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) if err != nil { continue @@ -81,9 +81,9 @@ func (k Keeper) AfterSlashStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, p } func (k Keeper) AfterSlashProposalRaise(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool) { - rates := k.tk.GetAllTokenRates(ctx) + rates := k.tk.GetAllTokenInfos(ctx) for _, rate := range rates { - if rate.StakeToken { + if rate.StakeEnabled { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) if err != nil { continue diff --git a/x/basket/keeper/keeper.go b/x/basket/keeper/keeper.go index d63e275c9..e3c9a451a 100644 --- a/x/basket/keeper/keeper.go +++ b/x/basket/keeper/keeper.go @@ -4,7 +4,6 @@ import ( "github.com/KiraCore/sekai/x/basket/types" govkeeper "github.com/KiraCore/sekai/x/gov/keeper" govtypes "github.com/KiraCore/sekai/x/gov/types" - tokenskeeper "github.com/KiraCore/sekai/x/tokens/keeper" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,12 +16,12 @@ type Keeper struct { ak types.AccountKeeper bk types.BankKeeper gk govkeeper.Keeper - tk tokenskeeper.Keeper + tk types.TokensKeeper mk types.MultiStakingKeeper } // NewKeeper returns instance of a keeper -func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ak types.AccountKeeper, bk types.BankKeeper, gk govkeeper.Keeper, tk tokenskeeper.Keeper, mk types.MultiStakingKeeper) Keeper { +func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ak types.AccountKeeper, bk types.BankKeeper, gk govkeeper.Keeper, tk types.TokensKeeper, mk types.MultiStakingKeeper) Keeper { return Keeper{ cdc: cdc, storeKey: storeKey, diff --git a/x/basket/keeper/mint_burn_swap.go b/x/basket/keeper/mint_burn_swap.go index c0fd30c7b..f8d6db499 100644 --- a/x/basket/keeper/mint_burn_swap.go +++ b/x/basket/keeper/mint_burn_swap.go @@ -59,7 +59,7 @@ func (k Keeper) MintBasketToken(ctx sdk.Context, msg *types.MsgBasketTokenMint) } basketCoins := sdk.Coins{basketCoin} - err = k.bk.MintCoins(ctx, types.ModuleName, basketCoins) + err = k.tk.MintCoins(ctx, types.ModuleName, basketCoins) if err != nil { return err } @@ -115,7 +115,7 @@ func (k Keeper) BurnBasketToken(ctx sdk.Context, msg *types.MsgBasketTokenBurn) return err } - err = k.bk.BurnCoins(ctx, types.ModuleName, burnCoins) + err = k.tk.BurnCoins(ctx, types.ModuleName, burnCoins) if err != nil { return err } diff --git a/x/basket/types/expected_keepers.go b/x/basket/types/expected_keepers.go index 98ed046fb..dad762467 100644 --- a/x/basket/types/expected_keepers.go +++ b/x/basket/types/expected_keepers.go @@ -3,6 +3,7 @@ package types import ( govtypes "github.com/KiraCore/sekai/x/gov/types" multistakingtypes "github.com/KiraCore/sekai/x/multistaking/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -35,3 +36,11 @@ type MultistakingHooks interface { AfterUpsertStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool) // Must be called when a upsert staking pool AfterSlashStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool, slash sdk.Dec) } + +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo + GetAllTokenInfos(ctx sdk.Context) []tokenstypes.TokenInfo +} diff --git a/x/collectives/keeper/collective.go b/x/collectives/keeper/collective.go index 9af1470d0..f8f447e91 100644 --- a/x/collectives/keeper/collective.go +++ b/x/collectives/keeper/collective.go @@ -122,7 +122,7 @@ func (k Keeper) GetBondsValue(ctx sdk.Context, bonds sdk.Coins) sdk.Dec { bondsValue := sdk.ZeroDec() for _, bond := range bonds { denom := multistakingtypes.GetOriginalDenom(bond.Denom) - rate := k.tk.GetTokenRate(ctx, denom) + rate := k.tk.GetTokenInfo(ctx, denom) if rate == nil { continue } diff --git a/x/collectives/keeper/collective_test.go b/x/collectives/keeper/collective_test.go index 2447e4f31..c70ba1f90 100644 --- a/x/collectives/keeper/collective_test.go +++ b/x/collectives/keeper/collective_test.go @@ -199,7 +199,7 @@ func (suite *KeeperTestSuite) GetBondsValue() { suite.Require().Equal(value, sdk.NewDec(1000_000)) // get bonds value with newly registered token - suite.app.TokensKeeper.UpsertTokenRate(suite.ctx, tokenstypes.TokenRate{ + suite.app.TokensKeeper.UpsertTokenInfo(suite.ctx, tokenstypes.TokenInfo{ Denom: "zzz", FeeRate: sdk.NewDec(10), }) diff --git a/x/collectives/types/expected_keepers.go b/x/collectives/types/expected_keepers.go index ba68ab1f6..630b65e31 100644 --- a/x/collectives/types/expected_keepers.go +++ b/x/collectives/types/expected_keepers.go @@ -29,5 +29,5 @@ type MultiStakingKeeper interface { // TokensKeeper defines expected interface needed to get token rate type TokensKeeper interface { - GetTokenRate(ctx sdk.Context, denom string) *tokenstypes.TokenRate + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo } diff --git a/x/distributor/keeper/distributor.go b/x/distributor/keeper/distributor.go index 80923e296..31448d652 100644 --- a/x/distributor/keeper/distributor.go +++ b/x/distributor/keeper/distributor.go @@ -47,7 +47,7 @@ func (k Keeper) AllocateTokens( inflationCoin := sdk.NewCoin(totalSupply.Denom, inflationRewards) if inflationRewards.IsPositive() { - err := k.bk.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{inflationCoin}) + err := k.tk.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{inflationCoin}) if err != nil { panic(err) } diff --git a/x/distributor/keeper/keeper.go b/x/distributor/keeper/keeper.go index 6ff42eb70..6fd607912 100644 --- a/x/distributor/keeper/keeper.go +++ b/x/distributor/keeper/keeper.go @@ -14,6 +14,7 @@ type Keeper struct { storeKey storetypes.StoreKey ak types.AccountKeeper bk types.BankKeeper + tk types.TokensKeeper sk types.StakingKeeper gk types.CustomGovKeeper mk types.MultiStakingKeeper @@ -21,7 +22,17 @@ type Keeper struct { } // NewKeeper returns instance of a keeper -func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, gk types.CustomGovKeeper, mk types.MultiStakingKeeper, rk types.RecoveryKeeper) Keeper { +func NewKeeper( + storeKey storetypes.StoreKey, + cdc codec.BinaryCodec, + ak types.AccountKeeper, + bk types.BankKeeper, + sk types.StakingKeeper, + gk types.CustomGovKeeper, + mk types.MultiStakingKeeper, + rk types.RecoveryKeeper, + tk types.TokensKeeper, +) Keeper { return Keeper{ cdc: cdc, storeKey: storeKey, @@ -31,6 +42,7 @@ func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ak types.Acc gk: gk, mk: mk, rk: rk, + tk: tk, } } diff --git a/x/distributor/types/expected_keepers.go b/x/distributor/types/expected_keepers.go index f39a1bd89..0dd449d42 100644 --- a/x/distributor/types/expected_keepers.go +++ b/x/distributor/types/expected_keepers.go @@ -5,6 +5,7 @@ import ( multistakingtypes "github.com/KiraCore/sekai/x/multistaking/types" recoverytypes "github.com/KiraCore/sekai/x/recovery/types" stakingtypes "github.com/KiraCore/sekai/x/staking/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -21,6 +22,13 @@ type BankKeeper interface { SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error } +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo +} + type AccountKeeper interface { GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI } diff --git a/x/feeprocessing/keeper/keeper.go b/x/feeprocessing/keeper/keeper.go index d89bc6268..ea6b64e5e 100644 --- a/x/feeprocessing/keeper/keeper.go +++ b/x/feeprocessing/keeper/keeper.go @@ -63,14 +63,14 @@ func (k Keeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule strin filledAmount := sdk.NewDec(0) for _, coin := range amt { - rate := k.tk.GetTokenRate(ctx, coin.Denom) + rate := k.tk.GetTokenInfo(ctx, coin.Denom) if rate != nil { totalAmount = totalAmount.Add(rate.FeeRate.Mul(sdk.NewDecFromInt(coin.Amount))) } } for _, coin := range recipientSentCoins { - rate := k.tk.GetTokenRate(ctx, coin.Denom) + rate := k.tk.GetTokenInfo(ctx, coin.Denom) if rate == nil { continue } diff --git a/x/feeprocessing/keeper/keeper_test.go b/x/feeprocessing/keeper/keeper_test.go index 7fcddd651..743e101a4 100644 --- a/x/feeprocessing/keeper/keeper_test.go +++ b/x/feeprocessing/keeper/keeper_test.go @@ -4,6 +4,7 @@ import ( "bytes" "testing" + "cosmossdk.io/math" simapp "github.com/KiraCore/sekai/app" kiratypes "github.com/KiraCore/sekai/types" govtypes "github.com/KiraCore/sekai/x/gov/types" @@ -43,32 +44,43 @@ func TestNewKeeper_Executions(t *testing.T) { executions := app.FeeProcessingKeeper.GetExecutionsStatus(ctx) require.True(t, len(executions) == 0) - msg1 := tokenstypes.NewMsgUpsertTokenRate( - addr, "ukex", sdk.NewDec(1), true, + msg1 := tokenstypes.NewMsgUpsertTokenInfo( + addr, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg1) executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) require.True(t, len(executions) == 1) - msg2 := tokenstypes.NewMsgUpsertTokenAlias(addr, "KEX", "Kira", "", 10, []string{"ukex"}, false) - app.FeeProcessingKeeper.AddExecutionStart(ctx, msg2) - executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) - require.True(t, len(executions) == 2) - - msg3 := tokenstypes.NewMsgUpsertTokenRate( - addr, "ukex", sdk.NewDec(1), true, + msg3 := tokenstypes.NewMsgUpsertTokenInfo( + addr, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg3) executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) - require.True(t, len(executions) == 3) + require.Len(t, executions, 2) app.FeeProcessingKeeper.SetExecutionStatusSuccess(ctx, msg1) app.FeeProcessingKeeper.SetExecutionStatusSuccess(ctx, msg3) @@ -79,15 +91,15 @@ func TestNewKeeper_Executions(t *testing.T) { successFlaggedCount += 1 } } - require.True(t, successFlaggedCount == 2) + require.Equal(t, successFlaggedCount, int(2)) successFlaggedCount = 0 for _, exec := range executions { - if bytes.Equal(exec.FeePayer, msg1.Proposer) && exec.MsgType == msg2.Type() && exec.Success == true { + if bytes.Equal(exec.FeePayer, msg1.Proposer) && exec.MsgType == msg3.Type() && exec.Success == true { successFlaggedCount += 1 } } - require.True(t, successFlaggedCount == 0) + require.Equal(t, successFlaggedCount, int(2)) } func TestNewKeeper_SendCoinsFromAccountToModule(t *testing.T) { @@ -164,7 +176,7 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr3, coins) app.CustomGovKeeper.SetExecutionFee(ctx, govtypes.ExecutionFee{ - TransactionType: kiratypes.MsgTypeUpsertTokenRate, + TransactionType: kiratypes.MsgTypeUpsertTokenInfo, ExecutionFee: 1000, FailureFee: 100, Timeout: 0, @@ -174,12 +186,20 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { // check failure fee fees := sdk.Coins{sdk.NewInt64Coin("ukex", 1000)} app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr, authtypes.FeeCollectorName, fees) - msg := tokenstypes.NewMsgUpsertTokenRate( - addr, "ukex", sdk.NewDec(1), true, + msg := tokenstypes.NewMsgUpsertTokenInfo( + addr, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg) app.FeeProcessingKeeper.ProcessExecutionFeeReturn(ctx) @@ -206,19 +226,35 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { // check success return when two message types are same but addresses are different app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr2, authtypes.FeeCollectorName, fees) app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr3, authtypes.FeeCollectorName, fees) - msg2 := tokenstypes.NewMsgUpsertTokenRate( - addr2, "ukex", sdk.NewDec(1), true, + msg2 := tokenstypes.NewMsgUpsertTokenInfo( + addr2, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) - msg3 := tokenstypes.NewMsgUpsertTokenRate( - addr3, "ukex", sdk.NewDec(1), true, + msg3 := tokenstypes.NewMsgUpsertTokenInfo( + addr3, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg3) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg2) diff --git a/x/feeprocessing/types/expected_keepers.go b/x/feeprocessing/types/expected_keepers.go index ccedb6e9a..ec29b138b 100644 --- a/x/feeprocessing/types/expected_keepers.go +++ b/x/feeprocessing/types/expected_keepers.go @@ -14,7 +14,7 @@ type BankKeeper interface { // TokensKeeper defines expected interface needed to get token rate type TokensKeeper interface { - GetTokenRate(ctx sdk.Context, denom string) *types.TokenRate + GetTokenInfo(ctx sdk.Context, denom string) *types.TokenInfo } // CustomGovKeeper defines the expected interface contract the tokens module requires diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index 33cf80371..4f6bec68a 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -131,25 +131,19 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { } tokenGenState := tokenstypes.GetGenesisStateFromAppState(clientCtx.Codec, genesis) - tokenGenState.Aliases = []*tokenstypes.TokenAlias{ + tokenGenState.TokenInfos = []tokenstypes.TokenInfo{ { - Symbol: defaultDenom, - Name: defaultDenom, - Icon: "", - Decimals: 6, - Denoms: []string{defaultDenom}, - Invalidated: false, - }, - } - tokenGenState.Rates = []*tokenstypes.TokenRate{ - { - Denom: defaultDenom, - FeeRate: sdk.OneDec(), - FeePayments: true, - StakeCap: sdk.NewDecWithPrec(5, 1), // 0.5 - StakeMin: sdk.OneInt(), - StakeToken: true, - Invalidated: false, + Denom: defaultDenom, + FeeRate: sdk.OneDec(), + FeeEnabled: true, + StakeCap: sdk.NewDecWithPrec(5, 1), // 0.5 + StakeMin: sdk.OneInt(), + StakeEnabled: true, + Inactive: false, + Symbol: defaultDenom, + Name: defaultDenom, + Icon: "", + Decimals: 6, }, } tokenGenState.TokenBlackWhites.Whitelisted = []string{defaultDenom} diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 4ac2091c4..022447bd9 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "cosmossdk.io/math" simapp "github.com/KiraCore/sekai/app" "github.com/KiraCore/sekai/x/gov" "github.com/KiraCore/sekai/x/gov/types" @@ -440,57 +441,6 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { }, blockHeightChange: 3, }, - { - name: "Passed proposal in enactment is applied and removed from enactment list: Set Token Alias", - prepareScenario: func(app *simapp.SekaiApp, ctx sdk.Context) []sdk.AccAddress { - addrs := simapp.AddTestAddrsIncremental(app, ctx, 10, sdk.NewInt(100)) - - actor := types.NewDefaultActor(addrs[0]) - app.CustomGovKeeper.SaveNetworkActor(ctx, actor) - - proposalID := uint64(1234) - proposal, err := types.NewProposal( - proposalID, - "title", - "some desc", - tokenstypes.NewUpsertTokenAliasProposal( - "EUR", - "Euro", - "http://www.google.es", - 12, - []string{ - "eur", - "€", - }, - false, - ), - time.Now(), - time.Now().Add(10*time.Second), - time.Now().Add(20*time.Second), - ctx.BlockHeight()+2, - ctx.BlockHeight()+3, - ) - require.NoError(t, err) - - proposal.Result = types.Enactment - app.CustomGovKeeper.SaveProposal(ctx, proposal) - - app.CustomGovKeeper.AddToEnactmentProposals(ctx, proposal) - - iterator := app.CustomGovKeeper.GetEnactmentProposalsWithFinishedEnactmentEndTimeIterator(ctx, time.Now().Add(25*time.Second)) - requireIteratorCount(t, iterator, 1) - - return addrs - }, - validateScenario: func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context, addrs []sdk.AccAddress) { - iterator := app.CustomGovKeeper.GetEnactmentProposalsWithFinishedEnactmentEndTimeIterator(ctx, time.Now().Add(25*time.Second)) - requireIteratorCount(t, iterator, 0) - - token := app.TokensKeeper.GetTokenAlias(ctx, "EUR") - require.Equal(t, "Euro", token.Name) - }, - blockHeightChange: 3, - }, { name: "Passed proposal in enactment is applied and removed from enactment list: Set Token Rates", prepareScenario: func(app *simapp.SekaiApp, ctx sdk.Context) []sdk.AccAddress { @@ -504,14 +454,22 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { proposalID, "title", "some desc", - tokenstypes.NewUpsertTokenRatesProposal( + tokenstypes.NewUpsertTokenInfosProposal( "btc", + "adr20", sdk.NewDec(1234), false, + sdk.ZeroInt(), + sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "BTC", + "Bitcoin", + "", + 9, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), time.Now(), time.Now().Add(10*time.Second), @@ -535,10 +493,10 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { iterator := app.CustomGovKeeper.GetEnactmentProposalsWithFinishedEnactmentEndTimeIterator(ctx, time.Now().Add(25*time.Second)) requireIteratorCount(t, iterator, 0) - token := app.TokensKeeper.GetTokenRate(ctx, "btc") + token := app.TokensKeeper.GetTokenInfo(ctx, "btc") require.Equal(t, sdk.NewDec(1234), token.FeeRate) require.Equal(t, "btc", token.Denom) - require.Equal(t, false, token.FeePayments) + require.Equal(t, false, token.FeeEnabled) }, blockHeightChange: 3, }, diff --git a/x/gov/client/cli/util_test.go b/x/gov/client/cli/util_test.go index e32bbbf6d..2cc2dd0c0 100644 --- a/x/gov/client/cli/util_test.go +++ b/x/gov/client/cli/util_test.go @@ -205,14 +205,14 @@ func (s IntegrationTestSuite) SetNetworkPropertyProposal(property string, value s.Require().Contains(result.RawLog, "SetNetworkProperty") } -func (s IntegrationTestSuite) UpsertRate(denom string, rate string, flagFeePayments bool) sdk.TxResponse { +func (s IntegrationTestSuite) UpsertRate(denom string, rate string, flagFeeEnabled bool) sdk.TxResponse { val := s.network.Validators[0] clientCtx := val.ClientCtx - cmd := tokenscli.GetTxUpsertTokenRateCmd() + cmd := tokenscli.GetTxUpsertTokenInfoCmd() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", tokenscli.FlagDenom, denom), - fmt.Sprintf("--%s=%s", tokenscli.FlagRate, rate), - fmt.Sprintf("--%s=%s", tokenscli.FlagFeePayments, strconv.FormatBool(flagFeePayments)), + fmt.Sprintf("--%s=%s", tokenscli.FlagFeeRate, rate), + fmt.Sprintf("--%s=%s", tokenscli.FlagFeeEnabled, strconv.FormatBool(flagFeeEnabled)), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 24ca4785c..d3819b6a2 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -53,15 +53,12 @@ func TestSimappExportGenesis(t *testing.T) { 1, 2, 3, - 6, 8, 9, 12, 13, 10, 11, - 14, - 15, 18, 19, 20, @@ -242,13 +239,6 @@ func TestSimappExportGenesis(t *testing.T) { "timeout": "10", "default_parameters": "0" }, - { - "transaction_type": "upsert_token_alias", - "execution_fee": "100", - "failure_fee": "1", - "timeout": "10", - "default_parameters": "0" - }, { "transaction_type": "veto-proposal-type-x", "execution_fee": "100", @@ -341,7 +331,6 @@ func TestExportInitGenesis(t *testing.T) { types.PermSetPermissions, types.PermClaimValidator, types.PermClaimCouncilor, - types.PermUpsertTokenAlias, }, nil), }, StartingProposalId: 1, @@ -451,8 +440,7 @@ func TestExportInitGenesis(t *testing.T) { "whitelist": [ 1, 2, - 3, - 6 + 3 ] }, "2": { diff --git a/x/gov/handler_test.go b/x/gov/handler_test.go index 07260a934..1d39bb8da 100644 --- a/x/gov/handler_test.go +++ b/x/gov/handler_test.go @@ -11,7 +11,6 @@ import ( kiratypes "github.com/KiraCore/sekai/types" "github.com/KiraCore/sekai/x/gov" "github.com/KiraCore/sekai/x/gov/types" - tokenstypes "github.com/KiraCore/sekai/x/tokens/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" @@ -1551,46 +1550,6 @@ func TestHandler_VoteProposal_Errors(t *testing.T) { }, fmt.Errorf("%s: not enough permissions", types.PermVoteSetNetworkPropertyProposal.String()), }, - { - "Voter does not have permission to vote this proposal: UpsertTokenAlias", - types.NewMsgVoteProposal( - 1, voterAddr, types.OptionAbstain, sdk.ZeroDec(), - ), - func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context) { - actor := types.NewNetworkActor( - voterAddr, - []uint64{}, - types.Active, - []types.VoteOption{}, - types.NewPermissions(nil, nil), - 1, - ) - app.CustomGovKeeper.SaveNetworkActor(ctx, actor) - - // Create proposal - proposal, err := types.NewProposal( - 1, - "title", - "some desc", - tokenstypes.NewUpsertTokenAliasProposal( - "eur", - "Euro", - "theIcon", - 12, - []string{}, - false, - ), - ctx.BlockTime(), - ctx.BlockTime().Add(time.Second*20), - ctx.BlockTime().Add(time.Second*30), - ctx.BlockHeight()+2, - ctx.BlockHeight()+3, - ) - require.NoError(t, err) - app.CustomGovKeeper.SaveProposal(ctx, proposal) - }, - fmt.Errorf("%s: not enough permissions", types.PermVoteUpsertTokenAliasProposal.String()), - }, } for _, tt := range tests { diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 0b92d491c..c23d5db09 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -321,9 +321,8 @@ func (k Keeper) ProposerVotersCount(goCtx context.Context, request *types.QueryP types.PermWhitelistAccountPermissionProposal, types.PermCreateUpsertDataRegistryProposal, types.PermCreateSetNetworkPropertyProposal, - types.PermCreateUpsertTokenAliasProposal, types.PermCreateSetPoorNetworkMessagesProposal, - types.PermCreateUpsertTokenRateProposal, + types.PermCreateUpsertTokenInfoProposal, types.PermCreateUnjailValidatorProposal, types.PermCreateRoleProposal, types.PermCreateTokensWhiteBlackChangeProposal, @@ -347,9 +346,8 @@ func (k Keeper) ProposerVotersCount(goCtx context.Context, request *types.QueryP types.PermVoteWhitelistAccountPermissionProposal, types.PermVoteUpsertDataRegistryProposal, types.PermVoteSetNetworkPropertyProposal, - types.PermVoteUpsertTokenAliasProposal, types.PermVoteSetPoorNetworkMessagesProposal, - types.PermVoteUpsertTokenRateProposal, + types.PermVoteUpsertTokenInfoProposal, types.PermVoteUnjailValidatorProposal, types.PermVoteCreateRoleProposal, types.PermVoteTokensWhiteBlackChangeProposal, diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 36e87ed1d..fce155cbf 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -32,18 +32,15 @@ func DefaultGenesis() *GenesisState { PermSetPermissions, PermClaimValidator, PermClaimCouncilor, - PermUpsertTokenAlias, // PermChangeTxFee, // do not give this permission to sudo account - test does not pass - PermUpsertTokenRate, + PermUpsertTokenInfo, PermUpsertRole, PermCreateSetNetworkPropertyProposal, PermVoteSetNetworkPropertyProposal, PermCreateUpsertDataRegistryProposal, PermVoteUpsertDataRegistryProposal, - PermCreateUpsertTokenAliasProposal, - PermVoteUpsertTokenAliasProposal, - PermCreateUpsertTokenRateProposal, - PermVoteUpsertTokenRateProposal, + PermCreateUpsertTokenInfoProposal, + PermVoteUpsertTokenInfoProposal, PermCreateUnjailValidatorProposal, PermVoteUnjailValidatorProposal, PermCreateRoleProposal, @@ -209,13 +206,6 @@ func DefaultGenesis() *GenesisState { Timeout: 10, DefaultParameters: 0, }, - { - TransactionType: kiratypes.MsgTypeUpsertTokenAlias, - ExecutionFee: 100, - FailureFee: 1, - Timeout: 10, - DefaultParameters: 0, - }, { TransactionType: kiratypes.MsgTypeActivate, ExecutionFee: 100, diff --git a/x/gov/types/permission.go b/x/gov/types/permission.go index 054da2402..1bc368097 100644 --- a/x/gov/types/permission.go +++ b/x/gov/types/permission.go @@ -38,12 +38,6 @@ var PermMetadata = []PermInfo{ Module: "gov", Description: "the permission that an actor must have in order to vote a proposal to whitelist account permission", }, - { - Id: int32(PermUpsertTokenAlias), - Name: "PERMISSION_UPSERT_TOKEN_ALIAS", - Module: "tokens", - Description: "the permission to upsert token alias", - }, { Id: int32(PermChangeTxFee), Name: "PERMISSION_CHANGE_TX_FEE", @@ -51,7 +45,7 @@ var PermMetadata = []PermInfo{ Description: "Permission to change tx fee", }, { - Id: int32(PermUpsertTokenRate), + Id: int32(PermUpsertTokenInfo), Name: "PERMISSION_UPSERT_TOKEN_RATE", Module: "tokens", Description: "Permission to upsert token rate", @@ -86,18 +80,6 @@ var PermMetadata = []PermInfo{ Module: "gov", Description: "the permission that an actor must have in order to vote a proposal to set network property.", }, - { - Id: int32(PermCreateUpsertTokenAliasProposal), - Name: "PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL", - Module: "tokens", - Description: "the permission needed to create proposals for upsert token Alias.", - }, - { - Id: int32(PermVoteUpsertTokenAliasProposal), - Name: "PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL", - Module: "tokens", - Description: "the permission needed to vote proposals for upsert token.", - }, { Id: int32(PermCreateSetPoorNetworkMessagesProposal), Name: "PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES", @@ -111,13 +93,13 @@ var PermMetadata = []PermInfo{ Description: "the permission needed to vote proposals to set poor network messages.", }, { - Id: int32(PermCreateUpsertTokenRateProposal), + Id: int32(PermCreateUpsertTokenInfoProposal), Name: "PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL", Module: "tokens", Description: "the permission needed to create proposals for upsert token rate.", }, { - Id: int32(PermVoteUpsertTokenRateProposal), + Id: int32(PermVoteUpsertTokenInfoProposal), Name: "PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL", Module: "tokens", Description: "the permission needed to vote proposals for upsert token rate.", diff --git a/x/gov/types/permission.pb.go b/x/gov/types/permission.pb.go index 2659611e5..4b8a63113 100644 --- a/x/gov/types/permission.pb.go +++ b/x/gov/types/permission.pb.go @@ -37,12 +37,10 @@ const ( // PERMISSION_VOTE_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL defines the permission that an actor must have in order to vote a // Proposal to whitelist account permission. PermVoteWhitelistAccountPermissionProposal PermValue = 5 - // PERMISSION_UPSERT_TOKEN_ALIAS - PermUpsertTokenAlias PermValue = 6 // PERMISSION_CHANGE_TX_FEE PermChangeTxFee PermValue = 7 // PERMISSION_UPSERT_TOKEN_RATE - PermUpsertTokenRate PermValue = 8 + PermUpsertTokenInfo PermValue = 8 // PERMISSION_UPSERT_ROLE makes possible to add, modify and assign roles. PermUpsertRole PermValue = 9 // PERMISSION_CREATE_UPSERT_DATA_REGISTRY_PROPOSAL makes possible to create a proposal to change the Data Registry. @@ -54,18 +52,14 @@ const ( // PERMISSION_VOTE_SET_NETWORK_PROPERTY_PROPOSAL defines the permission that an actor must have in order to vote a // Proposal to set network property. PermVoteSetNetworkPropertyProposal PermValue = 13 - // PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL defines the permission needed to create proposals for upsert token Alias. - PermCreateUpsertTokenAliasProposal PermValue = 14 - // PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL defines the permission needed to vote proposals for upsert token. - PermVoteUpsertTokenAliasProposal PermValue = 15 // PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES defines the permission needed to create proposals for setting poor network messages PermCreateSetPoorNetworkMessagesProposal PermValue = 16 // PERMISSION_VOTE_SET_POOR_NETWORK_MESSAGES_PROPOSAL defines the permission needed to vote proposals to set poor network messages PermVoteSetPoorNetworkMessagesProposal PermValue = 17 // PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL defines the permission needed to create proposals for upsert token rate. - PermCreateUpsertTokenRateProposal PermValue = 18 + PermCreateUpsertTokenInfoProposal PermValue = 18 // PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL defines the permission needed to vote proposals for upsert token rate. - PermVoteUpsertTokenRateProposal PermValue = 19 + PermVoteUpsertTokenInfoProposal PermValue = 19 // PERMISSION_CREATE_UNJAIL_VALIDATOR_PROPOSAL defines the permission needed to create a proposal to unjail a validator. PermCreateUnjailValidatorProposal PermValue = 20 // PERMISSION_VOTE_UNJAIL_VALIDATOR_PROPOSAL defines the permission needed to vote a proposal to unjail a validator. @@ -185,7 +179,6 @@ var PermValue_name = map[int32]string{ 3: "PERMISSION_CLAIM_COUNCILOR", 4: "PERMISSION_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL", 5: "PERMISSION_VOTE_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL", - 6: "PERMISSION_UPSERT_TOKEN_ALIAS", 7: "PERMISSION_CHANGE_TX_FEE", 8: "PERMISSION_UPSERT_TOKEN_RATE", 9: "PERMISSION_UPSERT_ROLE", @@ -193,8 +186,6 @@ var PermValue_name = map[int32]string{ 11: "PERMISSION_VOTE_UPSERT_DATA_REGISTRY_PROPOSAL", 12: "PERMISSION_CREATE_SET_NETWORK_PROPERTY_PROPOSAL", 13: "PERMISSION_VOTE_SET_NETWORK_PROPERTY_PROPOSAL", - 14: "PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL", - 15: "PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL", 16: "PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES", 17: "PERMISSION_VOTE_SET_POOR_NETWORK_MESSAGES_PROPOSAL", 18: "PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL", @@ -258,7 +249,6 @@ var PermValue_value = map[string]int32{ "PERMISSION_CLAIM_COUNCILOR": 3, "PERMISSION_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL": 4, "PERMISSION_VOTE_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL": 5, - "PERMISSION_UPSERT_TOKEN_ALIAS": 6, "PERMISSION_CHANGE_TX_FEE": 7, "PERMISSION_UPSERT_TOKEN_RATE": 8, "PERMISSION_UPSERT_ROLE": 9, @@ -266,8 +256,6 @@ var PermValue_value = map[string]int32{ "PERMISSION_VOTE_UPSERT_DATA_REGISTRY_PROPOSAL": 11, "PERMISSION_CREATE_SET_NETWORK_PROPERTY_PROPOSAL": 12, "PERMISSION_VOTE_SET_NETWORK_PROPERTY_PROPOSAL": 13, - "PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL": 14, - "PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL": 15, "PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES": 16, "PERMISSION_VOTE_SET_POOR_NETWORK_MESSAGES_PROPOSAL": 17, "PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL": 18, @@ -339,111 +327,108 @@ func init() { func init() { proto.RegisterFile("kira/gov/permission.proto", fileDescriptor_214168f8815c1062) } var fileDescriptor_214168f8815c1062 = []byte{ - // 1692 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x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 0xfe, 0x53, 0x4c, 0x4c, - 0xc3, 0x19, 0xcb, 0x46, 0x49, 0xe7, 0xdb, 0x22, 0x31, 0x6b, 0x9e, 0x35, 0x46, 0x60, 0x5d, 0xae, - 0xcc, 0x95, 0x2a, 0xcd, 0x03, 0xae, 0x5c, 0xca, 0x73, 0x12, 0x2f, 0x24, 0xfe, 0x47, 0xd7, 0xe5, - 0x54, 0x59, 0x71, 0xcc, 0x51, 0x8e, 0x64, 0x53, 0xd3, 0x43, 0xd7, 0xe5, 0xf8, 0x7a, 0x35, 0x57, - 0x2a, 0xf3, 0x42, 0xe2, 0xff, 0x81, 0x75, 0x39, 0xed, 0xb4, 0xdb, 0x52, 0x54, 0x4d, 0x4f, 0xfe, - 0x04, 0xee, 0xfa, 0xd6, 0x35, 0x8a, 0x25, 0x09, 0x97, 0x4b, 0xa2, 0xd4, 0xe4, 0x72, 0xce, 0x6a, - 0xbf, 0xd5, 0xcd, 0x9a, 0xc0, 0xd7, 0x78, 0x91, 0x2b, 0x27, 0xce, 0xc1, 0x4d, 0xcb, 0x46, 0xab, - 0x0e, 0xad, 0x71, 0xac, 0x98, 0x44, 0x55, 0x0c, 0x93, 0x6b, 0xb5, 0xb4, 0xd3, 0xae, 0xcf, 0x95, - 0x9a, 0xae, 0xf5, 0x34, 0x43, 0x56, 0x93, 0x0a, 0x78, 0xe0, 0x83, 0x1c, 0xf0, 0x12, 0x8e, 0x29, - 0xf3, 0x09, 0x4c, 0x5b, 0x36, 0xda, 0x74, 0xc3, 0xae, 0x99, 0x24, 0x86, 0xd4, 0x23, 0x30, 0xe7, - 0x03, 0xd5, 0x6b, 0x22, 0x16, 0xa4, 0xa6, 0xc4, 0xef, 0xe3, 0x6a, 0x93, 0x2b, 0x97, 0x38, 0x31, - 0x71, 0x1e, 0xce, 0x5a, 0x36, 0xba, 0xe6, 0x2c, 0xad, 0xf7, 0x0c, 0xa2, 0x9b, 0x92, 0xd6, 0x21, - 0x5d, 0x4e, 0x55, 0x64, 0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31, 0x8f, 0x4f, 0x5f, 0xa6, - 0x5b, 0xda, 0x49, 0x66, 0x5f, 0xd1, 0xe5, 0x9c, 0xa6, 0x93, 0x8c, 0x41, 0x3a, 0xb2, 0x92, 0x79, - 0xeb, 0xfe, 0xe8, 0x60, 0xbe, 0xeb, 0x11, 0xe3, 0xe5, 0x79, 0xf7, 0x07, 0x85, 0x9d, 0x7f, 0x03, - 0x00, 0x00, 0xff, 0xff, 0x97, 0x58, 0x79, 0x11, 0x8d, 0x18, 0x00, 0x00, + // 1647 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x98, 0x5b, 0x77, 0xd3, 0xc6, + 0x16, 0xc7, 0x93, 0x73, 0x38, 0xe7, 0xc0, 0x1c, 0x5a, 0x5c, 0x43, 0x03, 0x0c, 0xe0, 0x4c, 0xee, + 0x37, 0xb0, 0x21, 0x81, 0xb4, 0x94, 0x16, 0x2a, 0xdb, 0xe3, 0xd8, 0xc4, 0xb6, 0xbc, 0x24, 0x39, + 0x86, 0xb4, 0x2c, 0x57, 0x38, 0x83, 0xa3, 0xda, 0xf1, 0xb8, 0x92, 0xc2, 0xa5, 0x9f, 0xa0, 0x4b, + 0x4f, 0x7d, 0xeb, 0x93, 0x9e, 0xfa, 0x65, 0xfa, 0xc8, 0x63, 0x1f, 0xbb, 0xe0, 0x8b, 0x74, 0x49, + 0xb6, 0x35, 0x1a, 0x59, 0xb2, 0x95, 0x3e, 0xe5, 0x62, 0xcf, 0xef, 0xbf, 0xf7, 0x9e, 0xbd, 0x67, + 0xf6, 0x1e, 0x70, 0xbd, 0xa3, 0xe9, 0x6a, 0xa6, 0x4d, 0x5f, 0x67, 0xfa, 0x44, 0x3f, 0xd1, 0x0c, + 0x43, 0xa3, 0xbd, 0x74, 0x5f, 0xa7, 0x26, 0x4d, 0x9e, 0x77, 0x3e, 0x4a, 0xb7, 0xe9, 0x6b, 0x78, + 0xa5, 0x4d, 0xdb, 0xd4, 0xfd, 0x67, 0xc6, 0xf9, 0x6d, 0xf0, 0xf9, 0xe6, 0x6f, 0x69, 0x70, 0xa1, + 0x46, 0xf4, 0x93, 0x03, 0xb5, 0x7b, 0x4a, 0x92, 0x0b, 0xe0, 0x52, 0x0d, 0x4b, 0x95, 0x92, 0x2c, + 0x97, 0xc4, 0x6a, 0xf3, 0x10, 0x4b, 0x62, 0x62, 0x06, 0x5e, 0xb4, 0x6c, 0x74, 0xde, 0xf9, 0xce, + 0x21, 0xd1, 0x69, 0x72, 0x17, 0x40, 0xdf, 0x57, 0x64, 0xac, 0x34, 0xd9, 0x9f, 0x72, 0x62, 0x16, + 0xce, 0x59, 0x36, 0x4a, 0x3a, 0xdf, 0x96, 0x89, 0x59, 0xf3, 0xac, 0x31, 0x02, 0xeb, 0x72, 0x65, + 0xa1, 0x54, 0x69, 0x1e, 0x08, 0xe5, 0x52, 0x5e, 0x50, 0x44, 0x29, 0xf1, 0x2f, 0xb6, 0x2e, 0xd7, + 0x55, 0x35, 0xc7, 0x1c, 0xed, 0x48, 0x35, 0xa9, 0x1e, 0xba, 0x2e, 0x27, 0xd6, 0xab, 0xb9, 0x52, + 0x59, 0x94, 0x12, 0xff, 0x0e, 0xac, 0xcb, 0xd1, 0xd3, 0x5e, 0x4b, 0xeb, 0x52, 0x3d, 0xf9, 0x03, + 0xb8, 0xeb, 0x5b, 0xd7, 0x28, 0x96, 0x14, 0x5c, 0x2e, 0xc9, 0x4a, 0x53, 0xc8, 0x39, 0xab, 0xfd, + 0x56, 0x37, 0x6b, 0x92, 0x58, 0x13, 0x65, 0xa1, 0x9c, 0x38, 0x07, 0x37, 0x2d, 0x1b, 0xad, 0x3a, + 0xb4, 0xc6, 0xb1, 0x66, 0x92, 0xae, 0x66, 0x98, 0x42, 0xab, 0x45, 0x4f, 0x7b, 0x3e, 0x57, 0x6a, + 0x3a, 0xed, 0x53, 0x43, 0xed, 0x26, 0x35, 0xf0, 0xc0, 0x07, 0x39, 0x10, 0x15, 0x1c, 0x53, 0xe6, + 0x3f, 0x30, 0x6d, 0xd9, 0x68, 0xd3, 0x0d, 0x3b, 0x35, 0x49, 0x0c, 0xa9, 0x7b, 0xe0, 0x9a, 0x3f, + 0x08, 0x45, 0xa1, 0xba, 0x87, 0x9b, 0xca, 0xb3, 0x66, 0x01, 0xe3, 0xc4, 0xff, 0xe0, 0x65, 0xcb, + 0x46, 0x97, 0xdc, 0x10, 0x1c, 0xab, 0xbd, 0x36, 0x51, 0xde, 0x16, 0x08, 0x49, 0x3e, 0x04, 0x37, + 0x7d, 0x4b, 0xea, 0x35, 0x19, 0x4b, 0x4a, 0x53, 0x11, 0xf7, 0x71, 0xb5, 0x29, 0x09, 0x0a, 0x4e, + 0x9c, 0x87, 0x57, 0x2d, 0x1b, 0x5d, 0x76, 0x96, 0xd5, 0xfb, 0x06, 0xd1, 0x4d, 0x85, 0x76, 0x48, + 0xaf, 0xd4, 0x7b, 0x45, 0x93, 0x69, 0x30, 0x37, 0xbe, 0x54, 0x12, 0xcb, 0x38, 0x71, 0x01, 0x26, + 0x2d, 0x1b, 0x7d, 0xca, 0x16, 0x49, 0xb4, 0x4b, 0x92, 0x2f, 0x40, 0xc6, 0x6f, 0x9d, 0x84, 0x05, + 0x05, 0x8f, 0x96, 0xe5, 0x05, 0x45, 0x68, 0x4a, 0x78, 0xaf, 0x24, 0x2b, 0xd2, 0x73, 0x16, 0x02, + 0x00, 0xd7, 0x2d, 0x1b, 0x2d, 0xbb, 0x46, 0xeb, 0x44, 0x35, 0xc9, 0x00, 0x97, 0x57, 0x4d, 0x55, + 0x22, 0x6d, 0xcd, 0x30, 0xf5, 0x77, 0x9e, 0xf3, 0xcf, 0xc1, 0x9d, 0x60, 0x9c, 0x27, 0xc3, 0xff, + 0x0f, 0x57, 0x2d, 0x1b, 0x2d, 0x8e, 0xe2, 0x3b, 0x01, 0x1d, 0x6a, 0xb9, 0x93, 0xd3, 0x55, 0xac, + 0x34, 0x44, 0x69, 0xdf, 0x65, 0x62, 0x49, 0xf1, 0xc1, 0x2f, 0x06, 0x2d, 0x97, 0x89, 0x59, 0x25, + 0xe6, 0x1b, 0xaa, 0x77, 0x1c, 0x2c, 0xd1, 0xcd, 0x89, 0x96, 0x4f, 0x86, 0x7f, 0xc2, 0x5b, 0x3e, + 0x01, 0xfd, 0x02, 0x6c, 0x85, 0x5b, 0x5e, 0x13, 0x45, 0xc9, 0x53, 0xa8, 0x60, 0x59, 0x16, 0xf6, + 0xb0, 0x9c, 0x48, 0xc0, 0xdb, 0x96, 0x8d, 0xd6, 0x39, 0xab, 0x6b, 0x94, 0xea, 0x43, 0x7c, 0x85, + 0x18, 0x86, 0xda, 0x26, 0x86, 0x87, 0x7f, 0x09, 0xb6, 0xc3, 0x2c, 0x0f, 0x85, 0x33, 0xf3, 0x3f, + 0x63, 0xf5, 0x33, 0x34, 0x7f, 0x92, 0x46, 0x03, 0xdc, 0x8e, 0x4c, 0x1b, 0x96, 0xa8, 0x8c, 0x9e, + 0x84, 0x2b, 0x96, 0x8d, 0x16, 0x82, 0x39, 0xe3, 0xe5, 0xad, 0x07, 0x96, 0xc1, 0x66, 0x44, 0xc2, + 0x84, 0x61, 0x2f, 0xc3, 0x25, 0xcb, 0x46, 0xf3, 0x7c, 0xb6, 0x8c, 0x43, 0x0f, 0xc2, 0x02, 0x5e, + 0xaf, 0x3e, 0x15, 0x4a, 0x65, 0x76, 0x8e, 0x31, 0xea, 0x95, 0x31, 0x63, 0x7b, 0x3f, 0xaa, 0x5a, + 0xd7, 0x3b, 0xd7, 0x3c, 0xae, 0x04, 0x36, 0xc6, 0x8c, 0x8d, 0xa4, 0x7e, 0x1e, 0xb0, 0x35, 0x82, + 0x59, 0x00, 0xab, 0xe3, 0xb6, 0x0e, 0x7f, 0x38, 0x75, 0xcc, 0x80, 0x73, 0x10, 0x5a, 0x36, 0x9a, + 0x63, 0x66, 0x3a, 0x05, 0xed, 0x71, 0x8a, 0x60, 0x39, 0x68, 0x5b, 0x28, 0xe5, 0x2a, 0x4c, 0x59, + 0x36, 0x82, 0x23, 0xb3, 0x42, 0x48, 0xaf, 0xc0, 0xfd, 0x71, 0x8b, 0xdc, 0xdd, 0x90, 0x07, 0x87, + 0x66, 0x33, 0x5b, 0x16, 0x72, 0xfb, 0xa3, 0xa3, 0xcd, 0x23, 0x5f, 0x0b, 0xe6, 0xad, 0xbb, 0x31, + 0x86, 0x7b, 0x64, 0x66, 0xbb, 0x6a, 0xab, 0x33, 0x38, 0xf2, 0x26, 0xe5, 0x6d, 0x0c, 0x95, 0xeb, + 0x7c, 0xde, 0x4e, 0xd1, 0x38, 0xe6, 0xce, 0xfd, 0x51, 0x40, 0xb0, 0x53, 0x1f, 0x8d, 0xa2, 0x13, + 0x17, 0xb6, 0x71, 0x92, 0x50, 0xdd, 0x67, 0x32, 0x10, 0xde, 0xb1, 0x6c, 0xb4, 0xe1, 0x0b, 0x36, + 0x31, 0x88, 0xd9, 0x38, 0xa6, 0x5d, 0xe2, 0xed, 0xa1, 0xa4, 0xf6, 0x3a, 0x9e, 0xd2, 0x11, 0xd8, + 0x09, 0x7a, 0x13, 0x47, 0xe7, 0x06, 0xdc, 0xb2, 0x6c, 0xb4, 0x36, 0x72, 0x67, 0x9a, 0x4a, 0x68, + 0x66, 0xcb, 0x62, 0x41, 0x69, 0x08, 0x92, 0x53, 0x39, 0x7b, 0x92, 0x90, 0xf7, 0x05, 0xeb, 0x66, + 0x30, 0xb3, 0x65, 0xfa, 0xca, 0x7c, 0xa3, 0xea, 0xa4, 0xde, 0x6f, 0xeb, 0xea, 0x11, 0x8b, 0x53, + 0x85, 0xcb, 0x9e, 0x68, 0xe0, 0x2d, 0x3e, 0xa9, 0xa3, 0x70, 0x7c, 0xa1, 0x38, 0x51, 0x08, 0x34, + 0x11, 0xbe, 0xbb, 0x36, 0x91, 0x62, 0x4c, 0x99, 0x98, 0x7c, 0x4b, 0xc1, 0xee, 0xd7, 0x64, 0x93, + 0x6b, 0x12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, 0x7e, 0x4c, 0xcd, 0x1c, 0xae, 0xb4, 0x35, 0xf3, + 0xf8, 0xf4, 0x65, 0xba, 0x45, 0x4f, 0x32, 0xfb, 0x9a, 0xae, 0xe6, 0xa8, 0x4e, 0x32, 0x06, 0xe9, + 0xa8, 0x5a, 0xe6, 0xad, 0xfb, 0x0a, 0x6f, 0xbe, 0xeb, 0x13, 0xe3, 0xe5, 0x7f, 0xdd, 0x17, 0xf6, + 0x9d, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x90, 0x74, 0x83, 0x9e, 0x17, 0x00, 0x00, } diff --git a/x/layer2/client/cli/query.go b/x/layer2/client/cli/query.go index 2011d12eb..b3e231811 100644 --- a/x/layer2/client/cli/query.go +++ b/x/layer2/client/cli/query.go @@ -21,7 +21,6 @@ func NewQueryCmd() *cobra.Command { GetCmdQueryExecutionRegistrar(), GetCmdQueryAllDapps(), GetCmdQueryTransferDapp(), - GetCmdQueryGlobalTokens(), ) return queryCmd @@ -97,26 +96,3 @@ func GetCmdQueryTransferDapp() *cobra.Command { return cmd } - -func GetCmdQueryGlobalTokens() *cobra.Command { - cmd := &cobra.Command{ - Use: "global-tokens", - Short: "Queries global tokens", - Args: cobra.MinimumNArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GlobalTokens(context.Background(), &types.QueryGlobalTokensRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/layer2/client/cli/tx.go b/x/layer2/client/cli/tx.go index eda425249..0f5671441 100644 --- a/x/layer2/client/cli/tx.go +++ b/x/layer2/client/cli/tx.go @@ -15,31 +15,32 @@ import ( ) const ( - FlagTitle = "title" - FlagDescription = "description" - FlagDappName = "dapp-name" - FlagDappDescription = "dapp-description" - FlagDenom = "denom" - FlagWebsite = "website" - FlagLogo = "logo" - FlagSocial = "social" - FlagDocs = "docs" - FlagControllerRoles = "controller-roles" - FlagControllerAccounts = "controller-accounts" - FlagBinaryInfo = "binary-info" - FlagLpPoolConfig = "lp-pool-config" - FlagIssuranceConfig = "issurance-config" - FlagUpdateTimeMax = "update-time-max" - FlagExecutorsMin = "executors-min" - FlagExecutorsMax = "executors-max" - FlagVerifiersMin = "verifiers-min" - FlagDappStatus = "dapp-status" - FlagBond = "bond" - FlagVoteQuorum = "vote-quorum" - FlagVotePeriod = "vote-period" - FlagVoteEnactment = "vote-enactment" - FlagAddr = "addr" - FlagAmount = "amount" + FlagTitle = "title" + FlagDescription = "description" + FlagDappName = "dapp-name" + FlagDappDescription = "dapp-description" + FlagDenom = "denom" + FlagWebsite = "website" + FlagLogo = "logo" + FlagSocial = "social" + FlagDocs = "docs" + FlagControllerRoles = "controller-roles" + FlagControllerAccounts = "controller-accounts" + FlagBinaryInfo = "binary-info" + FlagLpPoolConfig = "lp-pool-config" + FlagIssuanceConfig = "issuance-config" + FlagUpdateTimeMax = "update-time-max" + FlagExecutorsMin = "executors-min" + FlagExecutorsMax = "executors-max" + FlagVerifiersMin = "verifiers-min" + FlagDappStatus = "dapp-status" + FlagBond = "bond" + FlagVoteQuorum = "vote-quorum" + FlagVotePeriod = "vote-period" + FlagVoteEnactment = "vote-enactment" + FlagAddr = "addr" + FlagAmount = "amount" + FlagEnableBondVerifiers = "enable_bond_verifiers" ) // NewTxCmd returns a root CLI command handler for all x/bank transaction commands. @@ -157,14 +158,14 @@ func GetTxCreateDappProposalCmd() *cobra.Command { return fmt.Errorf("invalid controller role/accounts: %w", err) } - issuranceStr, err := cmd.Flags().GetString(FlagIssuranceConfig) + issuanceStr, err := cmd.Flags().GetString(FlagIssuanceConfig) if err != nil { - return fmt.Errorf("invalid issurance config: %w", err) + return fmt.Errorf("invalid issuance config: %w", err) } - issurance := types.IssuranceConfig{} - err = clientCtx.Codec.UnmarshalJSON([]byte(issuranceStr), &issurance) + issuance := types.IssuanceConfig{} + err = clientCtx.Codec.UnmarshalJSON([]byte(issuanceStr), &issuance) if err != nil { - return fmt.Errorf("invalid issurance config: %w", err) + return fmt.Errorf("invalid issuance config: %w", err) } lpPoolConfigStr, err := cmd.Flags().GetString(FlagLpPoolConfig) @@ -208,6 +209,10 @@ func GetTxCreateDappProposalCmd() *cobra.Command { if err != nil { return fmt.Errorf("invalid verifiersMin: %w", err) } + enableBondVerifiers, err := cmd.Flags().GetBool(FlagEnableBondVerifiers) + if err != nil { + return fmt.Errorf("invalid enable bond verifiers: %w", err) + } msg := &types.MsgCreateDappProposal{ Sender: clientCtx.GetFromAddress().String(), @@ -226,17 +231,18 @@ func GetTxCreateDappProposalCmd() *cobra.Command { Addresses: ctrlAccounts, }, }, - Bin: []types.BinaryInfo{binaryInfo}, - Pool: lpPoolConfig, - Issurance: issurance, - UpdateTimeMax: updateMaxTime, - ExecutorsMin: executorsMin, - ExecutorsMax: executorsMax, - VerifiersMin: verifiersMin, - Status: types.DappStatus(types.SessionStatus_value[statusStr]), - VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), - VotePeriod: votePeriod, - VoteEnactment: voteEnactment, + Bin: []types.BinaryInfo{binaryInfo}, + Pool: lpPoolConfig, + Issuance: issuance, + UpdateTimeMax: updateMaxTime, + ExecutorsMin: executorsMin, + ExecutorsMax: executorsMax, + VerifiersMin: verifiersMin, + Status: types.DappStatus(types.SessionStatus_value[statusStr]), + VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), + VotePeriod: votePeriod, + VoteEnactment: voteEnactment, + EnableBondVerifiers: enableBondVerifiers, }, } @@ -265,7 +271,7 @@ func GetTxCreateDappProposalCmd() *cobra.Command { cmd.Flags().Uint64(FlagVoteEnactment, 0, "vote enactment of the dapp") cmd.Flags().String(FlagControllerRoles, "", "controller roles on the dapp.") cmd.Flags().String(FlagControllerAccounts, "", "controller accounts on the dapp.") - cmd.Flags().String(FlagIssuranceConfig, "{}", "dapp issurance config.") + cmd.Flags().String(FlagIssuanceConfig, "{}", "dapp issuance config.") cmd.Flags().String(FlagLpPoolConfig, "{}", "dapp lp config.") cmd.Flags().String(FlagBinaryInfo, "{}", "dapp binary info.") cmd.Flags().String(FlagDappStatus, "{}", "dapp status.") @@ -273,6 +279,7 @@ func GetTxCreateDappProposalCmd() *cobra.Command { cmd.Flags().Uint64(FlagExecutorsMin, 0, "dapp executors min") cmd.Flags().Uint64(FlagExecutorsMax, 0, "dapp executors max") cmd.Flags().Uint64(FlagVerifiersMin, 0, "dapp verifiers min") + cmd.Flags().Bool(FlagEnableBondVerifiers, true, "enable verifiers with bonding") return cmd } @@ -728,14 +735,14 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { return fmt.Errorf("invalid controller role/accounts: %w", err) } - issuranceStr, err := cmd.Flags().GetString(FlagIssuranceConfig) + issuanceStr, err := cmd.Flags().GetString(FlagIssuanceConfig) if err != nil { - return fmt.Errorf("invalid issurance config: %w", err) + return fmt.Errorf("invalid issuance config: %w", err) } - issurance := types.IssuranceConfig{} - err = clientCtx.Codec.UnmarshalJSON([]byte(issuranceStr), &issurance) + issuance := types.IssuanceConfig{} + err = clientCtx.Codec.UnmarshalJSON([]byte(issuanceStr), &issuance) if err != nil { - return fmt.Errorf("invalid issurance config: %w", err) + return fmt.Errorf("invalid issuance config: %w", err) } lpPoolConfigStr, err := cmd.Flags().GetString(FlagLpPoolConfig) @@ -791,6 +798,10 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { if err != nil { return fmt.Errorf("invalid vote period: %w", err) } + enableBondVerifiers, err := cmd.Flags().GetBool(FlagEnableBondVerifiers) + if err != nil { + return fmt.Errorf("invalid enable bond verifiers: %w", err) + } msg, err := govtypes.NewMsgSubmitProposal( clientCtx.FromAddress, @@ -812,17 +823,18 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { Addresses: ctrlAccounts, }, }, - Bin: []types.BinaryInfo{binaryInfo}, - Pool: lpPoolConfig, - Issurance: issurance, - UpdateTimeMax: updateMaxTime, - ExecutorsMin: executorsMin, - ExecutorsMax: executorsMax, - VerifiersMin: verifiersMin, - Status: types.DappStatus(types.SessionStatus_value[statusStr]), - VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), - VotePeriod: votePeriod, - VoteEnactment: voteEnactment, + Bin: []types.BinaryInfo{binaryInfo}, + Pool: lpPoolConfig, + Issuance: issuance, + UpdateTimeMax: updateMaxTime, + ExecutorsMin: executorsMin, + ExecutorsMax: executorsMax, + VerifiersMin: verifiersMin, + Status: types.DappStatus(types.SessionStatus_value[statusStr]), + VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), + VotePeriod: votePeriod, + VoteEnactment: voteEnactment, + EnableBondVerifiers: enableBondVerifiers, }, }, ) @@ -852,7 +864,7 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { cmd.Flags().Uint64(FlagVoteEnactment, 0, "vote enactment of the dapp") cmd.Flags().String(FlagControllerRoles, "", "controller roles on the dapp.") cmd.Flags().String(FlagControllerAccounts, "", "controller accounts on the dapp.") - cmd.Flags().String(FlagIssuranceConfig, "{}", "dapp issurance config.") + cmd.Flags().String(FlagIssuanceConfig, "{}", "dapp issuance config.") cmd.Flags().String(FlagLpPoolConfig, "{}", "dapp lp config.") cmd.Flags().String(FlagBinaryInfo, "{}", "dapp binary info.") cmd.Flags().String(FlagDappStatus, "{}", "dapp status.") @@ -860,6 +872,7 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { cmd.Flags().Uint64(FlagExecutorsMin, 0, "dapp executors min") cmd.Flags().Uint64(FlagExecutorsMax, 0, "dapp executors max") cmd.Flags().Uint64(FlagVerifiersMin, 0, "dapp verifiers min") + cmd.Flags().Bool(FlagEnableBondVerifiers, true, "enable verifiers with bonding") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) @@ -1181,9 +1194,9 @@ func GetTxMintCreateFtTxCmd() *cobra.Command { return fmt.Errorf("invalid supply") } - fee, ok := sdk.NewIntFromString(args[10]) - if !ok { - return fmt.Errorf("invalid fee") + feeRate, err := sdk.NewDecFromStr(args[10]) + if err != nil { + return err } msg := &types.MsgMintCreateFtTx{ @@ -1195,10 +1208,10 @@ func GetTxMintCreateFtTxCmd() *cobra.Command { Description: args[4], Website: args[5], Social: args[6], - Decimals: uint64(decimals), + Decimals: uint32(decimals), Cap: cap, Supply: supply, - Fee: fee, + FeeRate: feeRate, Owner: args[11], } @@ -1244,9 +1257,9 @@ func GetTxMintCreateNftTxCmd() *cobra.Command { return fmt.Errorf("invalid supply") } - fee, ok := sdk.NewIntFromString(args[10]) - if !ok { - return fmt.Errorf("invalid fee") + feeRate, err := sdk.NewDecFromStr(args[10]) + if err != nil { + return err } msg := &types.MsgMintCreateNftTx{ @@ -1258,10 +1271,10 @@ func GetTxMintCreateNftTxCmd() *cobra.Command { Description: args[4], Website: args[5], Social: args[6], - Decimals: uint64(decimals), + Decimals: uint32(decimals), Cap: cap, Supply: supply, - Fee: fee, + FeeRate: feeRate, Owner: args[11], Metadata: args[12], Hash: args[13], diff --git a/x/layer2/keeper/abci.go b/x/layer2/keeper/abci.go index 1a93287e3..7bb672699 100644 --- a/x/layer2/keeper/abci.go +++ b/x/layer2/keeper/abci.go @@ -22,11 +22,11 @@ func (k Keeper) EndBlocker(ctx sdk.Context) { } if dapp.PremintTime+dapp.Pool.Drip < uint64(ctx.BlockTime().Unix()) && - dapp.Issurance.Postmint.IsPositive() && + dapp.Issuance.Postmint.IsPositive() && dapp.Status == types.Active { teamReserve := sdk.MustAccAddressFromBech32(dapp.TeamReserve) dappBondLpToken := dapp.LpToken() - premintCoin := sdk.NewCoin(dappBondLpToken, dapp.Issurance.Premint) + premintCoin := sdk.NewCoin(dappBondLpToken, dapp.Issuance.Premint) err := k.bk.SendCoinsFromModuleToAccount(ctx, types.ModuleName, teamReserve, sdk.Coins{premintCoin}) if err != nil { panic(err) @@ -127,7 +127,7 @@ func (k Keeper) FinishDappBootstrap(ctx sdk.Context, dapp types.Dapp) { drip = 1 } rate := sdk.NewDecFromInt(spendingPoolDeposit).Quo(sdk.NewDec(int64(drip))) - err = k.bk.MintCoins(ctx, types.ModuleName, sdk.Coins{sdk.NewCoin(dappBondLpToken, totalSupply)}) + err = k.tk.MintCoins(ctx, types.ModuleName, sdk.Coins{sdk.NewCoin(dappBondLpToken, totalSupply)}) if err != nil { panic(err) } @@ -187,9 +187,9 @@ func (k Keeper) FinishDappBootstrap(ctx sdk.Context, dapp types.Dapp) { } // send premint amount to team reserve - if dapp.Issurance.Premint.IsPositive() { + if dapp.Issuance.Premint.IsPositive() { teamReserve := sdk.MustAccAddressFromBech32(dapp.TeamReserve) - premintCoin := sdk.NewCoin(dappBondLpToken, dapp.Issurance.Premint) + premintCoin := sdk.NewCoin(dappBondLpToken, dapp.Issuance.Premint) err = k.bk.SendCoinsFromModuleToAccount(ctx, types.ModuleName, teamReserve, sdk.Coins{premintCoin}) if err != nil { panic(err) diff --git a/x/layer2/keeper/dapp_test.go b/x/layer2/keeper/dapp_test.go index 253bb7480..ec98d642f 100644 --- a/x/layer2/keeper/dapp_test.go +++ b/x/layer2/keeper/dapp_test.go @@ -36,7 +36,7 @@ func (suite *KeeperTestSuite) TestDappSetGetDelete() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -82,7 +82,7 @@ func (suite *KeeperTestSuite) TestDappSetGetDelete() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), diff --git a/x/layer2/keeper/grpc_query.go b/x/layer2/keeper/grpc_query.go index d9258839c..8cbf6d948 100644 --- a/x/layer2/keeper/grpc_query.go +++ b/x/layer2/keeper/grpc_query.go @@ -34,11 +34,3 @@ func (k Keeper) TransferDapps(goCtx context.Context, request *types.QueryTransfe XAMs: k.GetXAMs(ctx), }, nil } - -func (k Keeper) GlobalTokens(goCtx context.Context, request *types.QueryGlobalTokensRequest) (*types.QueryGlobalTokensResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - return &types.QueryGlobalTokensResponse{ - Tokens: k.GetTokenInfos(ctx), - }, nil -} diff --git a/x/layer2/keeper/keeper.go b/x/layer2/keeper/keeper.go index 935541102..e4fc315e8 100644 --- a/x/layer2/keeper/keeper.go +++ b/x/layer2/keeper/keeper.go @@ -17,9 +17,16 @@ type Keeper struct { sk types.StakingKeeper gk govkeeper.Keeper spk types.SpendingKeeper + tk types.TokensKeeper } -func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, bk types.BankKeeper, sk types.StakingKeeper, gk govkeeper.Keeper, spk types.SpendingKeeper) Keeper { +func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, + bk types.BankKeeper, + sk types.StakingKeeper, + gk govkeeper.Keeper, + spk types.SpendingKeeper, + tk types.TokensKeeper, +) Keeper { return Keeper{ cdc: cdc, storeKey: storeKey, @@ -27,6 +34,7 @@ func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, bk types.Ban sk: sk, gk: gk, spk: spk, + tk: tk, } } diff --git a/x/layer2/keeper/lp_swap_redeem_convert.go b/x/layer2/keeper/lp_swap_redeem_convert.go index 01d94fa96..a54560266 100644 --- a/x/layer2/keeper/lp_swap_redeem_convert.go +++ b/x/layer2/keeper/lp_swap_redeem_convert.go @@ -22,7 +22,7 @@ func (k Keeper) OnCollectFee(ctx sdk.Context, fee sdk.Coins) error { // - `25%` will be split between **ACTIVE** dApp executors, and verifiers (fisherman). // Additionally, the premint and postmint tokens can be used to incentivize operators before // dApp starts to generate revenue. - err := k.bk.BurnCoins(ctx, types.ModuleName, fee) + err := k.tk.BurnCoins(ctx, types.ModuleName, fee) if err != nil { return err } diff --git a/x/layer2/keeper/lp_swap_redeem_convert_test.go b/x/layer2/keeper/lp_swap_redeem_convert_test.go index debb6d1da..708994593 100644 --- a/x/layer2/keeper/lp_swap_redeem_convert_test.go +++ b/x/layer2/keeper/lp_swap_redeem_convert_test.go @@ -38,7 +38,7 @@ func (suite *KeeperTestSuite) TestLpTokenPrice() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -112,7 +112,7 @@ func (suite *KeeperTestSuite) TestRedeemDappPoolTx() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -134,14 +134,14 @@ func (suite *KeeperTestSuite) TestRedeemDappPoolTx() { lpToken := dapp.LpToken() lpCoins := sdk.Coins{sdk.NewInt64Coin(lpToken, 10000)} - err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, lpCoins) + err := suite.app.TokensKeeper.MintCoins(suite.ctx, minttypes.ModuleName, lpCoins) suite.Require().NoError(err) addr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, addr, lpCoins) suite.Require().NoError(err) - err = suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, sdk.Coins{dapp.TotalBond}) + err = suite.app.TokensKeeper.MintCoins(suite.ctx, types.ModuleName, sdk.Coins{dapp.TotalBond}) suite.Require().NoError(err) price := suite.app.Layer2Keeper.LpTokenPrice(suite.ctx, dapp) @@ -187,7 +187,7 @@ func (suite *KeeperTestSuite) TestConvertDappPoolTx() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -233,7 +233,7 @@ func (suite *KeeperTestSuite) TestConvertDappPoolTx() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -262,17 +262,17 @@ func (suite *KeeperTestSuite) TestConvertDappPoolTx() { lpToken1 := dapp1.LpToken() lpCoins1 := sdk.Coins{sdk.NewInt64Coin(lpToken1, 10000)} - err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, lpCoins1) + err := suite.app.TokensKeeper.MintCoins(suite.ctx, minttypes.ModuleName, lpCoins1) suite.Require().NoError(err) err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, addr, lpCoins1) suite.Require().NoError(err) lpToken2 := dapp2.LpToken() lpCoins2 := sdk.Coins{sdk.NewInt64Coin(lpToken2, 10000)} - err = suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, lpCoins2) + err = suite.app.TokensKeeper.MintCoins(suite.ctx, types.ModuleName, lpCoins2) suite.Require().NoError(err) - err = suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, sdk.Coins{dapp1.TotalBond}) + err = suite.app.TokensKeeper.MintCoins(suite.ctx, types.ModuleName, sdk.Coins{dapp1.TotalBond}) suite.Require().NoError(err) price := suite.app.Layer2Keeper.LpTokenPrice(suite.ctx, dapp1) diff --git a/x/layer2/keeper/msg_server.go b/x/layer2/keeper/msg_server.go index 036e26a66..16db385c5 100644 --- a/x/layer2/keeper/msg_server.go +++ b/x/layer2/keeper/msg_server.go @@ -5,6 +5,7 @@ import ( govtypes "github.com/KiraCore/sekai/x/gov/types" "github.com/KiraCore/sekai/x/layer2/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -141,6 +142,10 @@ func (k msgServer) JoinDappVerifierWithBond(goCtx context.Context, msg *types.Ms ctx := sdk.UnwrapSDKContext(goCtx) dapp := k.keeper.GetDapp(ctx, msg.DappName) + if !dapp.EnableBondVerifiers { + return nil, types.ErrDappNotAllowsBondVerifiers + } + operator := k.keeper.GetDappOperator(ctx, msg.DappName, msg.Sender) if operator.DappName != "" && operator.Verifier { return nil, types.ErrAlreadyADappVerifier @@ -688,19 +693,19 @@ func (k msgServer) MintCreateFtTx(goCtx context.Context, msg *types.MsgMintCreat return nil, err } - err = k.keeper.bk.BurnCoins(ctx, types.ModuleName, sdk.Coins{fee}) + err = k.keeper.tk.BurnCoins(ctx, types.ModuleName, sdk.Coins{fee}) if err != nil { return nil, err } denom := "ku/" + msg.DenomSuffix - info := k.keeper.GetTokenInfo(ctx, denom) + info := k.keeper.tk.GetTokenInfo(ctx, denom) if info.Denom != "" { return nil, types.ErrTokenAlreadyRegistered } - k.keeper.SetTokenInfo(ctx, types.TokenInfo{ + err = k.keeper.tk.UpsertTokenInfo(ctx, tokenstypes.TokenInfo{ TokenType: "adr20", Denom: denom, Name: msg.Name, @@ -710,14 +715,17 @@ func (k msgServer) MintCreateFtTx(goCtx context.Context, msg *types.MsgMintCreat Website: msg.Website, Social: msg.Social, Decimals: msg.Decimals, - Cap: msg.Cap, + SupplyCap: msg.Cap, Supply: msg.Supply, Holders: msg.Holders, - Fee: msg.Fee, + FeeRate: msg.FeeRate, Owner: msg.Owner, - Metadata: "", - Hash: "", + NftMetadata: "", + NftHash: "", }) + if err != nil { + return nil, err + } return &types.MsgMintCreateFtTxResponse{}, nil } @@ -732,18 +740,18 @@ func (k msgServer) MintCreateNftTx(goCtx context.Context, msg *types.MsgMintCrea return nil, err } - err = k.keeper.bk.BurnCoins(ctx, types.ModuleName, sdk.Coins{fee}) + err = k.keeper.tk.BurnCoins(ctx, types.ModuleName, sdk.Coins{fee}) if err != nil { return nil, err } denom := "ku/" + msg.DenomSuffix - info := k.keeper.GetTokenInfo(ctx, denom) + info := k.keeper.tk.GetTokenInfo(ctx, denom) if info.Denom != "" { return nil, types.ErrTokenAlreadyRegistered } - k.keeper.SetTokenInfo(ctx, types.TokenInfo{ + err = k.keeper.tk.UpsertTokenInfo(ctx, tokenstypes.TokenInfo{ TokenType: "adr43", Denom: denom, Name: msg.Name, @@ -752,15 +760,18 @@ func (k msgServer) MintCreateNftTx(goCtx context.Context, msg *types.MsgMintCrea Description: msg.Description, Website: msg.Website, Social: msg.Social, - Decimals: msg.Decimals, - Cap: msg.Cap, + Decimals: 0, + SupplyCap: msg.Cap, Supply: msg.Supply, Holders: msg.Holders, - Fee: msg.Fee, + FeeRate: msg.FeeRate, Owner: msg.Owner, - Metadata: msg.Metadata, - Hash: msg.Hash, + NftMetadata: msg.Metadata, + NftHash: msg.Hash, }) + if err != nil { + return nil, err + } return &types.MsgMintCreateNftTxResponse{}, nil } @@ -768,13 +779,13 @@ func (k msgServer) MintCreateNftTx(goCtx context.Context, msg *types.MsgMintCrea func (k msgServer) MintIssueTx(goCtx context.Context, msg *types.MsgMintIssueTx) (*types.MsgMintIssueTxResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) sender := sdk.MustAccAddressFromBech32(msg.Sender) - tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) + tokenInfo := k.keeper.tk.GetTokenInfo(ctx, msg.Denom) if tokenInfo.Denom == "" { return nil, types.ErrTokenNotRegistered } if msg.Sender != tokenInfo.Owner { - fee := msg.Amount.Mul(tokenInfo.Fee).Quo(Pow10(tokenInfo.Decimals)) + fee := tokenInfo.FeeRate.MulInt(msg.Amount).TruncateInt() feeCoins := sdk.Coins{sdk.NewCoin(k.keeper.DefaultDenom(ctx), fee)} if fee.IsPositive() { if tokenInfo.Owner == "" { @@ -795,7 +806,7 @@ func (k msgServer) MintIssueTx(goCtx context.Context, msg *types.MsgMintIssueTx) } mintCoin := sdk.NewCoin(msg.Denom, msg.Amount) - err := k.keeper.bk.MintCoins(ctx, types.ModuleName, sdk.Coins{mintCoin}) + err := k.keeper.tk.MintCoins(ctx, types.ModuleName, sdk.Coins{mintCoin}) if err != nil { return nil, err } @@ -805,19 +816,13 @@ func (k msgServer) MintIssueTx(goCtx context.Context, msg *types.MsgMintIssueTx) return nil, err } - tokenInfo.Supply = tokenInfo.Supply.Add(msg.Amount) - if tokenInfo.Supply.GT(tokenInfo.Cap) { - return nil, types.ErrCannotExceedTokenCap - } - k.keeper.SetTokenInfo(ctx, tokenInfo) - return &types.MsgMintIssueTxResponse{}, nil } func (k msgServer) MintBurnTx(goCtx context.Context, msg *types.MsgMintBurnTx) (*types.MsgMintBurnTxResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) sender := sdk.MustAccAddressFromBech32(msg.Sender) - tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) + tokenInfo := k.keeper.tk.GetTokenInfo(ctx, msg.Denom) if tokenInfo.Denom == "" { return nil, types.ErrTokenNotRegistered } @@ -828,13 +833,10 @@ func (k msgServer) MintBurnTx(goCtx context.Context, msg *types.MsgMintBurnTx) ( return nil, err } - err = k.keeper.bk.BurnCoins(ctx, types.ModuleName, sdk.Coins{burnCoin}) + err = k.keeper.tk.BurnCoins(ctx, types.ModuleName, sdk.Coins{burnCoin}) if err != nil { return nil, err } - tokenInfo.Supply = tokenInfo.Supply.Sub(msg.Amount) - k.keeper.SetTokenInfo(ctx, tokenInfo) - return &types.MsgMintBurnTxResponse{}, nil } diff --git a/x/layer2/keeper/msg_server_test.go b/x/layer2/keeper/msg_server_test.go index 400b7e518..6b7542fed 100644 --- a/x/layer2/keeper/msg_server_test.go +++ b/x/layer2/keeper/msg_server_test.go @@ -61,7 +61,7 @@ func (suite *KeeperTestSuite) TestCreateDappProposal() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -139,7 +139,7 @@ func (suite *KeeperTestSuite) TestBondDappProposal() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -226,7 +226,7 @@ func (suite *KeeperTestSuite) TestReclaimDappBondProposal() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), diff --git a/x/layer2/keeper/token_mint.go b/x/layer2/keeper/token_mint.go deleted file mode 100644 index 3051fb84d..000000000 --- a/x/layer2/keeper/token_mint.go +++ /dev/null @@ -1,52 +0,0 @@ -package keeper - -import ( - "github.com/KiraCore/sekai/x/layer2/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func Pow10(decimal uint64) sdk.Int { - res := sdk.OneInt() - for i := 0; i < int(decimal); i++ { - res = res.Mul(sdk.NewInt(10)) - } - return res -} - -func (k Keeper) SetTokenInfo(ctx sdk.Context, info types.TokenInfo) { - bz := k.cdc.MustMarshal(&info) - store := ctx.KVStore(k.storeKey) - store.Set(types.TokenInfoKey(info.Denom), bz) -} - -func (k Keeper) DeleteTokenInfo(ctx sdk.Context, denom string) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.TokenInfoKey(denom)) -} - -func (k Keeper) GetTokenInfo(ctx sdk.Context, denom string) types.TokenInfo { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.TokenInfoKey(denom)) - if bz == nil { - return types.TokenInfo{} - } - - info := types.TokenInfo{} - k.cdc.MustUnmarshal(bz, &info) - return info -} - -func (k Keeper) GetTokenInfos(ctx sdk.Context) []types.TokenInfo { - store := ctx.KVStore(k.storeKey) - - infos := []types.TokenInfo{} - it := sdk.KVStorePrefixIterator(store, types.PrefixTokenInfoKey) - defer it.Close() - - for ; it.Valid(); it.Next() { - info := types.TokenInfo{} - k.cdc.MustUnmarshal(it.Value(), &info) - infos = append(infos, info) - } - return infos -} diff --git a/x/layer2/keeper/token_mint_test.go b/x/layer2/keeper/token_mint_test.go deleted file mode 100644 index c5adccc10..000000000 --- a/x/layer2/keeper/token_mint_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package keeper_test - -import ( - "github.com/KiraCore/sekai/x/layer2/keeper" - "github.com/KiraCore/sekai/x/layer2/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (suite *KeeperTestSuite) TestTokenInfoSetGetDelete() { - infos := []types.TokenInfo{ - { - TokenType: "adr20", - Denom: "ku/bridgebtc", - Name: "Bridge BTC", - Symbol: "BTC", - Icon: "", - Description: "", - Website: "", - Social: "", - Decimals: 8, - Cap: sdk.NewInt(1000_000_000), - Supply: sdk.ZeroInt(), - Holders: 0, - Fee: sdk.ZeroInt(), - Owner: "kira15ky9du8a2wlstz6fpx3p4mqpjyrm5cgqzp4f3d", - }, - { - TokenType: "adr43", - Denom: "ku/punk", - Name: "Bridge PUNK", - Symbol: "PUNK", - Icon: "", - Description: "", - Website: "", - Social: "", - Decimals: 0, - Cap: sdk.NewInt(1000_000_000), - Supply: sdk.ZeroInt(), - Holders: 0, - Fee: sdk.ZeroInt(), - Owner: "kira15ky9du8a2wlstz6fpx3p4mqpjyrm5cgqzp4f3d", - Hash: "", - Metadata: "", - }, - } - - for _, info := range infos { - suite.app.Layer2Keeper.SetTokenInfo(suite.ctx, info) - } - - for _, info := range infos { - c := suite.app.Layer2Keeper.GetTokenInfo(suite.ctx, info.Denom) - suite.Require().Equal(c, info) - } - - allInfos := suite.app.Layer2Keeper.GetTokenInfos(suite.ctx) - suite.Require().Len(allInfos, 2) - - suite.app.Layer2Keeper.DeleteTokenInfo(suite.ctx, infos[0].Denom) - - allInfos = suite.app.Layer2Keeper.GetTokenInfos(suite.ctx) - suite.Require().Len(allInfos, 1) -} - -func (suite *KeeperTestSuite) TestPow10() { - suite.Require().Equal(keeper.Pow10(0), sdk.NewInt(1)) - suite.Require().Equal(keeper.Pow10(1), sdk.NewInt(10)) - suite.Require().Equal(keeper.Pow10(2), sdk.NewInt(100)) - suite.Require().Equal(keeper.Pow10(3), sdk.NewInt(1000)) -} diff --git a/x/layer2/proposal_handler.go b/x/layer2/proposal_handler.go index 59dfd07d0..388752670 100644 --- a/x/layer2/proposal_handler.go +++ b/x/layer2/proposal_handler.go @@ -169,7 +169,7 @@ func (a ApplyUpsertDappProposalHandler) Apply(ctx sdk.Context, proposalID uint64 dapp.Controllers = p.Dapp.Controllers dapp.Bin = p.Dapp.Bin dapp.Pool = p.Dapp.Pool - dapp.Issurance = p.Dapp.Issurance + dapp.Issuance = p.Dapp.Issuance dapp.UpdateTimeMax = p.Dapp.UpdateTimeMax dapp.ExecutorsMin = p.Dapp.ExecutorsMin dapp.ExecutorsMax = p.Dapp.ExecutorsMax @@ -180,6 +180,10 @@ func (a ApplyUpsertDappProposalHandler) Apply(ctx sdk.Context, proposalID uint64 dapp.VoteQuorum = p.Dapp.VoteQuorum dapp.VotePeriod = p.Dapp.VotePeriod dapp.VoteEnactment = p.Dapp.VoteEnactment + if dapp.EnableBondVerifiers && !p.Dapp.EnableBondVerifiers { + return types.ErrCanNotDisableBondedVerifiers + } + dapp.EnableBondVerifiers = p.Dapp.EnableBondVerifiers a.keeper.SetDapp(ctx, p.Dapp) return nil diff --git a/x/layer2/types/errors.go b/x/layer2/types/errors.go index 60dd25d05..6af32f8c5 100644 --- a/x/layer2/types/errors.go +++ b/x/layer2/types/errors.go @@ -34,7 +34,6 @@ var ( ErrInvalidLpToken = errors.Register(ModuleName, 26, "invalid lp token") ErrOperationExceedsSlippage = errors.Register(ModuleName, 27, "operation exceeds slippage") ErrTokenNotRegistered = errors.Register(ModuleName, 28, "token not registered") - ErrCannotExceedTokenCap = errors.Register(ModuleName, 29, "cannot exceed token cap") ErrTokenAlreadyRegistered = errors.Register(ModuleName, 30, "token already registered") ErrNotAbleToMintCoinsWithoutFee = errors.Register(ModuleName, 31, "not able to mint coins without fee") ErrInvalidBridgeDepositMessage = errors.Register(ModuleName, 32, "invalid bridge deposit message") @@ -42,4 +41,6 @@ var ( ErrNegativeBridgeBalance = errors.Register(ModuleName, 34, "negative bridge balance") ErrInvalidBridgeSourceAccount = errors.Register(ModuleName, 35, "invalid bridge source account") ErrInvalidDappVersion = errors.Register(ModuleName, 36, "invalid dapp version") + ErrDappNotAllowsBondVerifiers = errors.Register(ModuleName, 37, "dapp does not allow bond verifiers") + ErrCanNotDisableBondedVerifiers = errors.Register(ModuleName, 38, "cannot disable bond verifiers once enabled") ) diff --git a/x/layer2/types/expected_keepers.go b/x/layer2/types/expected_keepers.go index bfba900d8..2878a66f3 100644 --- a/x/layer2/types/expected_keepers.go +++ b/x/layer2/types/expected_keepers.go @@ -4,6 +4,7 @@ import ( govtypes "github.com/KiraCore/sekai/x/gov/types" spendingtypes "github.com/KiraCore/sekai/x/spending/types" stakingtypes "github.com/KiraCore/sekai/x/staking/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -29,3 +30,11 @@ type SpendingKeeper interface { CreateSpendingPool(ctx sdk.Context, pool spendingtypes.SpendingPool) error DepositSpendingPoolFromModule(ctx sdk.Context, moduleName, poolName string, amount sdk.Coins) error } + +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo + UpsertTokenInfo(ctx sdk.Context, rate tokenstypes.TokenInfo) error +} diff --git a/x/layer2/types/keys.go b/x/layer2/types/keys.go index 3a59a2876..ed073c9cc 100644 --- a/x/layer2/types/keys.go +++ b/x/layer2/types/keys.go @@ -11,6 +11,8 @@ const ( RouterKey = ModuleName // QuerierRoute is the querier route for the layer2 module QuerierRoute = ModuleName + // StoreKey is the store key string for layer2 module + StoreKey = ModuleName ) // constants diff --git a/x/layer2/types/layer2.go b/x/layer2/types/layer2.go index 22abd610d..2afbe4ca0 100644 --- a/x/layer2/types/layer2.go +++ b/x/layer2/types/layer2.go @@ -15,7 +15,7 @@ func (dapp Dapp) GetSpendingPoolLpDeposit() sdk.Int { func (dapp Dapp) GetLpTokenSupply() sdk.Int { spendingPoolDeposit := dapp.GetSpendingPoolLpDeposit() - totalSupply := spendingPoolDeposit.Add(dapp.Issurance.Postmint).Add(dapp.Issurance.Premint) + totalSupply := spendingPoolDeposit.Add(dapp.Issuance.Postmint).Add(dapp.Issuance.Premint) return totalSupply } diff --git a/x/layer2/types/layer2.pb.go b/x/layer2/types/layer2.pb.go index 9f00317da..764835d93 100644 --- a/x/layer2/types/layer2.pb.go +++ b/x/layer2/types/layer2.pb.go @@ -364,25 +364,25 @@ func (m *LpPoolConfig) GetDrip() uint64 { return 0 } -type IssuranceConfig struct { +type IssuanceConfig struct { Deposit string `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit,omitempty"` Premint github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=premint,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premint"` Postmint github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=postmint,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"postmint"` Time uint64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` } -func (m *IssuranceConfig) Reset() { *m = IssuranceConfig{} } -func (m *IssuranceConfig) String() string { return proto.CompactTextString(m) } -func (*IssuranceConfig) ProtoMessage() {} -func (*IssuranceConfig) Descriptor() ([]byte, []int) { +func (m *IssuanceConfig) Reset() { *m = IssuanceConfig{} } +func (m *IssuanceConfig) String() string { return proto.CompactTextString(m) } +func (*IssuanceConfig) ProtoMessage() {} +func (*IssuanceConfig) Descriptor() ([]byte, []int) { return fileDescriptor_4070283bbe72a11a, []int{4} } -func (m *IssuranceConfig) XXX_Unmarshal(b []byte) error { +func (m *IssuanceConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *IssuranceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *IssuanceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_IssuranceConfig.Marshal(b, m, deterministic) + return xxx_messageInfo_IssuanceConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -392,26 +392,26 @@ func (m *IssuranceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *IssuranceConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_IssuranceConfig.Merge(m, src) +func (m *IssuanceConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_IssuanceConfig.Merge(m, src) } -func (m *IssuranceConfig) XXX_Size() int { +func (m *IssuanceConfig) XXX_Size() int { return m.Size() } -func (m *IssuranceConfig) XXX_DiscardUnknown() { - xxx_messageInfo_IssuranceConfig.DiscardUnknown(m) +func (m *IssuanceConfig) XXX_DiscardUnknown() { + xxx_messageInfo_IssuanceConfig.DiscardUnknown(m) } -var xxx_messageInfo_IssuranceConfig proto.InternalMessageInfo +var xxx_messageInfo_IssuanceConfig proto.InternalMessageInfo -func (m *IssuranceConfig) GetDeposit() string { +func (m *IssuanceConfig) GetDeposit() string { if m != nil { return m.Deposit } return "" } -func (m *IssuranceConfig) GetTime() uint64 { +func (m *IssuanceConfig) GetTime() uint64 { if m != nil { return m.Time } @@ -419,32 +419,33 @@ func (m *IssuranceConfig) GetTime() uint64 { } type Dapp struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Website string `protobuf:"bytes,4,opt,name=website,proto3" json:"website,omitempty"` - Logo string `protobuf:"bytes,5,opt,name=logo,proto3" json:"logo,omitempty"` - Social string `protobuf:"bytes,6,opt,name=social,proto3" json:"social,omitempty"` - Docs string `protobuf:"bytes,7,opt,name=docs,proto3" json:"docs,omitempty"` - Controllers Controllers `protobuf:"bytes,8,opt,name=controllers,proto3" json:"controllers"` - Bin []BinaryInfo `protobuf:"bytes,9,rep,name=bin,proto3" json:"bin"` - Pool LpPoolConfig `protobuf:"bytes,10,opt,name=pool,proto3" json:"pool"` - Issurance IssuranceConfig `protobuf:"bytes,11,opt,name=issurance,proto3" json:"issurance"` - UpdateTimeMax uint64 `protobuf:"varint,12,opt,name=update_time_max,json=updateTimeMax,proto3" json:"update_time_max,omitempty"` - ExecutorsMin uint64 `protobuf:"varint,13,opt,name=executors_min,json=executorsMin,proto3" json:"executors_min,omitempty"` - ExecutorsMax uint64 `protobuf:"varint,14,opt,name=executors_max,json=executorsMax,proto3" json:"executors_max,omitempty"` - VerifiersMin uint64 `protobuf:"varint,15,opt,name=verifiers_min,json=verifiersMin,proto3" json:"verifiers_min,omitempty"` - TotalBond github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,16,opt,name=total_bond,json=totalBond,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"total_bond"` - CreationTime uint64 `protobuf:"varint,17,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` - Status DappStatus `protobuf:"varint,18,opt,name=status,proto3,enum=kira.layer2.DappStatus" json:"status,omitempty"` - VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,19,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` - VotePeriod uint64 `protobuf:"varint,20,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` - VoteEnactment uint64 `protobuf:"varint,21,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` - LiquidationStart uint64 `protobuf:"varint,22,opt,name=liquidation_start,json=liquidationStart,proto3" json:"liquidation_start,omitempty"` - PoolFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,23,opt,name=pool_fee,json=poolFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"pool_fee"` - TeamReserve string `protobuf:"bytes,24,opt,name=team_reserve,json=teamReserve,proto3" json:"team_reserve,omitempty"` - PremintTime uint64 `protobuf:"varint,25,opt,name=premint_time,json=premintTime,proto3" json:"premint_time,omitempty"` - PostMintPaid bool `protobuf:"varint,26,opt,name=post_mint_paid,json=postMintPaid,proto3" json:"post_mint_paid,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Website string `protobuf:"bytes,4,opt,name=website,proto3" json:"website,omitempty"` + Logo string `protobuf:"bytes,5,opt,name=logo,proto3" json:"logo,omitempty"` + Social string `protobuf:"bytes,6,opt,name=social,proto3" json:"social,omitempty"` + Docs string `protobuf:"bytes,7,opt,name=docs,proto3" json:"docs,omitempty"` + Controllers Controllers `protobuf:"bytes,8,opt,name=controllers,proto3" json:"controllers"` + Bin []BinaryInfo `protobuf:"bytes,9,rep,name=bin,proto3" json:"bin"` + Pool LpPoolConfig `protobuf:"bytes,10,opt,name=pool,proto3" json:"pool"` + Issuance IssuanceConfig `protobuf:"bytes,11,opt,name=issuance,proto3" json:"issuance"` + UpdateTimeMax uint64 `protobuf:"varint,12,opt,name=update_time_max,json=updateTimeMax,proto3" json:"update_time_max,omitempty"` + ExecutorsMin uint64 `protobuf:"varint,13,opt,name=executors_min,json=executorsMin,proto3" json:"executors_min,omitempty"` + ExecutorsMax uint64 `protobuf:"varint,14,opt,name=executors_max,json=executorsMax,proto3" json:"executors_max,omitempty"` + VerifiersMin uint64 `protobuf:"varint,15,opt,name=verifiers_min,json=verifiersMin,proto3" json:"verifiers_min,omitempty"` + TotalBond github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,16,opt,name=total_bond,json=totalBond,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"total_bond"` + CreationTime uint64 `protobuf:"varint,17,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` + Status DappStatus `protobuf:"varint,18,opt,name=status,proto3,enum=kira.layer2.DappStatus" json:"status,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,19,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` + VotePeriod uint64 `protobuf:"varint,20,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` + VoteEnactment uint64 `protobuf:"varint,21,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` + LiquidationStart uint64 `protobuf:"varint,22,opt,name=liquidation_start,json=liquidationStart,proto3" json:"liquidation_start,omitempty"` + PoolFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,23,opt,name=pool_fee,json=poolFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"pool_fee"` + TeamReserve string `protobuf:"bytes,24,opt,name=team_reserve,json=teamReserve,proto3" json:"team_reserve,omitempty"` + PremintTime uint64 `protobuf:"varint,25,opt,name=premint_time,json=premintTime,proto3" json:"premint_time,omitempty"` + PostMintPaid bool `protobuf:"varint,26,opt,name=post_mint_paid,json=postMintPaid,proto3" json:"post_mint_paid,omitempty"` + EnableBondVerifiers bool `protobuf:"varint,27,opt,name=enable_bond_verifiers,json=enableBondVerifiers,proto3" json:"enable_bond_verifiers,omitempty"` } func (m *Dapp) Reset() { *m = Dapp{} } @@ -550,11 +551,11 @@ func (m *Dapp) GetPool() LpPoolConfig { return LpPoolConfig{} } -func (m *Dapp) GetIssurance() IssuranceConfig { +func (m *Dapp) GetIssuance() IssuanceConfig { if m != nil { - return m.Issurance + return m.Issuance } - return IssuranceConfig{} + return IssuanceConfig{} } func (m *Dapp) GetUpdateTimeMax() uint64 { @@ -641,6 +642,13 @@ func (m *Dapp) GetPostMintPaid() bool { return false } +func (m *Dapp) GetEnableBondVerifiers() bool { + if m != nil { + return m.EnableBondVerifiers + } + return false +} + type UserDappBond struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` DappName string `protobuf:"bytes,2,opt,name=dapp_name,json=dappName,proto3" json:"dapp_name,omitempty"` @@ -1636,7 +1644,7 @@ func init() { proto.RegisterType((*Controllers)(nil), "kira.layer2.Controllers") proto.RegisterType((*BinaryInfo)(nil), "kira.layer2.BinaryInfo") proto.RegisterType((*LpPoolConfig)(nil), "kira.layer2.LpPoolConfig") - proto.RegisterType((*IssuranceConfig)(nil), "kira.layer2.IssuranceConfig") + proto.RegisterType((*IssuanceConfig)(nil), "kira.layer2.IssuanceConfig") proto.RegisterType((*Dapp)(nil), "kira.layer2.Dapp") proto.RegisterType((*UserDappBond)(nil), "kira.layer2.UserDappBond") proto.RegisterType((*DappOperator)(nil), "kira.layer2.DappOperator") @@ -1657,144 +1665,145 @@ func init() { func init() { proto.RegisterFile("kira/layer2/layer2.proto", fileDescriptor_4070283bbe72a11a) } var fileDescriptor_4070283bbe72a11a = []byte{ - // 2181 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4b, 0x6f, 0x1b, 0xc9, - 0x11, 0xd6, 0x88, 0x94, 0x44, 0x35, 0xf5, 0xa0, 0xdb, 0x5a, 0xef, 0x98, 0xbb, 0x91, 0x19, 0x26, - 0xbb, 0x96, 0xbd, 0x89, 0x18, 0xd8, 0x40, 0x80, 0xec, 0x6e, 0x90, 0xa5, 0x24, 0x7a, 0x45, 0xc7, - 0x7a, 0x64, 0x24, 0x05, 0x42, 0x2e, 0x44, 0x73, 0xa6, 0x45, 0x35, 0x34, 0x33, 0x3d, 0xea, 0x1e, - 0xca, 0xd4, 0x25, 0x87, 0x3c, 0x80, 0x44, 0xb9, 0xe4, 0x1c, 0x40, 0xa7, 0x5c, 0xf2, 0x3b, 0x72, - 0x08, 0xf6, 0xe8, 0x4b, 0x80, 0x20, 0x87, 0x45, 0x60, 0x5f, 0xf2, 0x38, 0xe4, 0x2f, 0x04, 0x55, - 0xdd, 0x33, 0x7c, 0x44, 0x89, 0xbd, 0x3e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a7, 0x52, 0xe9, 0x4e, - 0x24, 0x62, 0x77, 0x11, 0x51, 0x0b, 0xb9, 0x70, 0x47, 0xc4, 0x13, 0x20, 0x36, 0x70, 0x97, 0x26, - 0x41, 0x46, 0xd3, 0x05, 0x57, 0xe2, 0x44, 0x70, 0xab, 0x69, 0xd9, 0x80, 0x72, 0x21, 0x68, 0xda, - 0x25, 0x24, 0x95, 0x29, 0x0b, 0x3b, 0x5d, 0x19, 0x07, 0x6e, 0x05, 0x33, 0xb2, 0x61, 0x33, 0xf2, - 0xfe, 0x1b, 0x64, 0xe4, 0xa6, 0x14, 0xb1, 0x37, 0x8f, 0x2a, 0x36, 0x64, 0x1c, 0xc0, 0xa6, 0xbe, - 0xe2, 0x70, 0x21, 0x63, 0x74, 0xd4, 0xbd, 0x65, 0x36, 0xcd, 0x84, 0xe0, 0x26, 0x6d, 0x90, 0x59, - 0x9d, 0xb2, 0xb4, 0xaf, 0x5d, 0x5a, 0x73, 0xd6, 0x96, 0x26, 0xc2, 0x06, 0xe9, 0x7b, 0x80, 0xcb, - 0x9e, 0x85, 0xd1, 0x3d, 0x52, 0xbe, 0x90, 0x29, 0xef, 0x9c, 0xf7, 0xa5, 0xea, 0x47, 0xee, 0xed, - 0xb7, 0xaa, 0x13, 0x04, 0x54, 0xfc, 0x08, 0x35, 0xd0, 0x7b, 0x56, 0x61, 0xc2, 0x95, 0x90, 0x81, - 0xbb, 0x82, 0x46, 0x22, 0x60, 0x1f, 0x25, 0xf4, 0x03, 0xb2, 0x84, 0x00, 0x1e, 0x33, 0x3f, 0x8d, - 0x78, 0x9c, 0xba, 0xef, 0x98, 0x68, 0x81, 0xb4, 0x95, 0x09, 0xe9, 0x47, 0xe4, 0x56, 0x28, 0xce, - 0xfb, 0x22, 0x30, 0x1e, 0xeb, 0x94, 0xa9, 0xd4, 0xbd, 0x83, 0xc8, 0xca, 0xc8, 0xc2, 0x01, 0xc8, - 0x69, 0x1b, 0xee, 0xbe, 0x0c, 0x3b, 0x27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72, - 0x53, 0x20, 0xec, 0x11, 0x64, 0x81, 0xc8, 0x18, 0xf5, 0xef, 0x91, 0xf2, 0xc8, 0x69, 0xff, 0x0f, - 0xcb, 0x6e, 0x7c, 0x07, 0xd4, 0xff, 0xe9, 0x10, 0x72, 0xdc, 0xdc, 0xf1, 0xf8, 0x79, 0x9f, 0xeb, - 0x94, 0x7e, 0x4c, 0xe6, 0x8c, 0xc3, 0xe6, 0x99, 0xfb, 0x26, 0x66, 0x64, 0x04, 0x2c, 0x8c, 0xf8, - 0x3c, 0xec, 0x80, 0x5b, 0x36, 0xb3, 0x89, 0x11, 0xe1, 0xeb, 0xe4, 0x03, 0xb2, 0x64, 0x01, 0x36, - 0x85, 0x6c, 0x82, 0x2f, 0x1a, 0x69, 0x76, 0xb0, 0x70, 0x50, 0x5c, 0xa7, 0x46, 0x8b, 0x79, 0xe6, - 0x94, 0x40, 0x80, 0x3a, 0x1e, 0x90, 0x0a, 0x2e, 0x76, 0x79, 0xcc, 0x4f, 0x84, 0x2f, 0x98, 0x32, - 0x15, 0xb3, 0xe8, 0x2d, 0x83, 0x7c, 0x63, 0x28, 0xa6, 0x15, 0x52, 0x80, 0x1b, 0x66, 0xde, 0x23, - 0x30, 0xc4, 0x27, 0x39, 0x3a, 0xab, 0x13, 0x19, 0x6b, 0x8e, 0x08, 0x11, 0xd8, 0x63, 0x82, 0x21, - 0x48, 0x84, 0xf2, 0xad, 0xed, 0x30, 0x04, 0x89, 0x56, 0xbe, 0xb5, 0x14, 0x86, 0x20, 0x09, 0x94, - 0x6f, 0x2d, 0x83, 0xa1, 0x61, 0x45, 0xd6, 0x0e, 0x18, 0x1a, 0x96, 0xd9, 0x1b, 0x59, 0x91, 0x61, - 0x45, 0xf8, 0xe5, 0x47, 0x56, 0x54, 0xff, 0xb9, 0x43, 0x0a, 0xc7, 0xcd, 0x1d, 0x28, 0x07, 0x8a, - 0x9f, 0x9b, 0x7e, 0xcd, 0x98, 0x32, 0xa7, 0xf8, 0xb9,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 0xf3, 0xc5, 0xcb, 0x55, 0xe7, 0xc5, 0xcb, 0x55, 0xe7, 0x6f, 0x2f, 0x57, 0x9d, 0xdf, 0xbe, - 0x5a, 0x9d, 0x7a, 0xf1, 0x6a, 0x75, 0xea, 0x2f, 0xaf, 0x56, 0xa7, 0x7e, 0xb2, 0x36, 0x52, 0xd1, - 0x7f, 0x28, 0x14, 0xdb, 0x94, 0x8a, 0x37, 0x34, 0x3f, 0x63, 0xa2, 0x31, 0xc8, 0xfe, 0x43, 0xc4, - 0xba, 0xde, 0x9d, 0xc5, 0x86, 0xe9, 0xf1, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x08, 0xa2, 0xbc, - 0xd5, 0x5f, 0x14, 0x00, 0x00, + // 2204 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0xcb, 0x6f, 0x1b, 0xbb, + 0xf5, 0xf6, 0x58, 0xb2, 0x2d, 0x53, 0x7e, 0x28, 0x8c, 0x6f, 0xee, 0x44, 0xf9, 0xfd, 0x1c, 0x55, + 0xed, 0xbd, 0x71, 0x72, 0x5b, 0xab, 0x48, 0x80, 0x02, 0xbd, 0x0f, 0xb4, 0xb2, 0xad, 0x5c, 0x2b, + 0x8d, 0x1f, 0x1d, 0xdb, 0x17, 0x46, 0x37, 0x02, 0x35, 0x43, 0xcb, 0x84, 0x67, 0x86, 0x63, 0x72, + 0xe4, 0xc8, 0x9b, 0x02, 0x7d, 0x01, 0xad, 0xbb, 0xe9, 0xba, 0x80, 0x57, 0xdd, 0xf4, 0xef, 0xe8, + 0xa2, 0xb8, 0xcb, 0xbb, 0xe8, 0xa2, 0xe8, 0xe2, 0xa2, 0x48, 0x36, 0x7d, 0x2c, 0xfa, 0x2f, 0x14, + 0xe7, 0x90, 0x33, 0x7a, 0xd4, 0x6d, 0x72, 0xb3, 0x12, 0xf9, 0xf1, 0xfb, 0x0e, 0x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, 0x8c, 0xd2, 0x9e, 0x9a, 0x5d, 0x9c, 0x1d, 0xa3, 0x3d, 0x1d, + 0xd9, 0xc4, 0x8d, 0xa7, 0xbf, 0x7f, 0xb9, 0xea, 0x7c, 0xfe, 0x72, 0xd5, 0xf9, 0xe2, 0xe5, 0xaa, + 0xf3, 0xd7, 0x97, 0xab, 0xce, 0x6f, 0x5e, 0xad, 0x4e, 0x7d, 0xf1, 0x6a, 0x75, 0xea, 0xcf, 0xaf, + 0x56, 0xa7, 0x7e, 0xb4, 0x36, 0x52, 0xd1, 0x7f, 0x20, 0x14, 0xdb, 0x94, 0x8a, 0x37, 0x34, 0x3f, + 0x63, 0xa2, 0x31, 0xc8, 0xfe, 0x73, 0xc4, 0xba, 0xde, 0x9d, 0xc5, 0x0b, 0xd3, 0x93, 0x7f, 0x07, + 0x00, 0x00, 0xff, 0xff, 0x6c, 0x92, 0x52, 0xfa, 0x8f, 0x14, 0x00, 0x00, } func (this *AccountRange) Equal(that interface{}) bool { @@ -1927,14 +1936,14 @@ func (this *LpPoolConfig) Equal(that interface{}) bool { } return true } -func (this *IssuranceConfig) Equal(that interface{}) bool { +func (this *IssuanceConfig) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*IssuranceConfig) + that1, ok := that.(*IssuanceConfig) if !ok { - that2, ok := that.(IssuranceConfig) + that2, ok := that.(IssuanceConfig) if ok { that1 = &that2 } else { @@ -2014,7 +2023,7 @@ func (this *Dapp) Equal(that interface{}) bool { if !this.Pool.Equal(&that1.Pool) { return false } - if !this.Issurance.Equal(&that1.Issurance) { + if !this.Issuance.Equal(&that1.Issuance) { return false } if this.UpdateTimeMax != that1.UpdateTimeMax { @@ -2062,6 +2071,9 @@ func (this *Dapp) Equal(that interface{}) bool { if this.PostMintPaid != that1.PostMintPaid { return false } + if this.EnableBondVerifiers != that1.EnableBondVerifiers { + return false + } return true } func (this *UserDappBond) Equal(that interface{}) bool { @@ -2773,7 +2785,7 @@ func (m *LpPoolConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *IssuranceConfig) Marshal() (dAtA []byte, err error) { +func (m *IssuanceConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2783,12 +2795,12 @@ func (m *IssuranceConfig) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IssuranceConfig) MarshalTo(dAtA []byte) (int, error) { +func (m *IssuanceConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *IssuranceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IssuanceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2848,6 +2860,18 @@ func (m *Dapp) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.EnableBondVerifiers { + i-- + if m.EnableBondVerifiers { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd8 + } if m.PostMintPaid { i-- if m.PostMintPaid { @@ -2968,7 +2992,7 @@ func (m *Dapp) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x60 } { - size, err := m.Issurance.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Issuance.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3953,7 +3977,7 @@ func (m *LpPoolConfig) Size() (n int) { return n } -func (m *IssuranceConfig) Size() (n int) { +func (m *IssuanceConfig) Size() (n int) { if m == nil { return 0 } @@ -4017,7 +4041,7 @@ func (m *Dapp) Size() (n int) { } l = m.Pool.Size() n += 1 + l + sovLayer2(uint64(l)) - l = m.Issurance.Size() + l = m.Issuance.Size() n += 1 + l + sovLayer2(uint64(l)) if m.UpdateTimeMax != 0 { n += 1 + sovLayer2(uint64(m.UpdateTimeMax)) @@ -4062,6 +4086,9 @@ func (m *Dapp) Size() (n int) { if m.PostMintPaid { n += 3 } + if m.EnableBondVerifiers { + n += 3 + } return n } @@ -5041,7 +5068,7 @@ func (m *LpPoolConfig) Unmarshal(dAtA []byte) error { } return nil } -func (m *IssuranceConfig) Unmarshal(dAtA []byte) error { +func (m *IssuanceConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5064,10 +5091,10 @@ func (m *IssuranceConfig) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: IssuranceConfig: wiretype end group for non-group") + return fmt.Errorf("proto: IssuanceConfig: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: IssuranceConfig: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IssuanceConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5565,7 +5592,7 @@ func (m *Dapp) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Issurance", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Issuance", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5592,7 +5619,7 @@ func (m *Dapp) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Issurance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Issuance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5940,6 +5967,26 @@ func (m *Dapp) Unmarshal(dAtA []byte) error { } } m.PostMintPaid = bool(v != 0) + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableBondVerifiers", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLayer2 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableBondVerifiers = bool(v != 0) default: iNdEx = preIndex skippy, err := skipLayer2(dAtA[iNdEx:]) diff --git a/x/layer2/types/mint.pb.go b/x/layer2/types/mint.pb.go deleted file mode 100644 index 4375f49db..000000000 --- a/x/layer2/types/mint.pb.go +++ /dev/null @@ -1,1126 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: kira/layer2/mint.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - _ "github.com/cosmos/gogoproto/types" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// 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 - -type TokenInfo struct { - TokenType string `protobuf:"bytes,1,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Symbol string `protobuf:"bytes,4,opt,name=symbol,proto3" json:"symbol,omitempty"` - Icon string `protobuf:"bytes,5,opt,name=icon,proto3" json:"icon,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - Website string `protobuf:"bytes,7,opt,name=website,proto3" json:"website,omitempty"` - Social string `protobuf:"bytes,8,opt,name=social,proto3" json:"social,omitempty"` - Decimals uint64 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` - Cap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=cap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"cap"` - Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` - Holders uint64 `protobuf:"varint,12,opt,name=holders,proto3" json:"holders,omitempty"` - Fee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,13,opt,name=fee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee"` - Owner string `protobuf:"bytes,14,opt,name=owner,proto3" json:"owner,omitempty"` - Metadata string `protobuf:"bytes,15,opt,name=metadata,proto3" json:"metadata,omitempty"` - Hash string `protobuf:"bytes,16,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *TokenInfo) Reset() { *m = TokenInfo{} } -func (m *TokenInfo) String() string { return proto.CompactTextString(m) } -func (*TokenInfo) ProtoMessage() {} -func (*TokenInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_066d1ba7ae573fa3, []int{0} -} -func (m *TokenInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenInfo.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 *TokenInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenInfo.Merge(m, src) -} -func (m *TokenInfo) XXX_Size() int { - return m.Size() -} -func (m *TokenInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TokenInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenInfo proto.InternalMessageInfo - -func (m *TokenInfo) GetTokenType() string { - if m != nil { - return m.TokenType - } - return "" -} - -func (m *TokenInfo) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *TokenInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *TokenInfo) GetSymbol() string { - if m != nil { - return m.Symbol - } - return "" -} - -func (m *TokenInfo) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *TokenInfo) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *TokenInfo) GetWebsite() string { - if m != nil { - return m.Website - } - return "" -} - -func (m *TokenInfo) GetSocial() string { - if m != nil { - return m.Social - } - return "" -} - -func (m *TokenInfo) GetDecimals() uint64 { - if m != nil { - return m.Decimals - } - return 0 -} - -func (m *TokenInfo) GetHolders() uint64 { - if m != nil { - return m.Holders - } - return 0 -} - -func (m *TokenInfo) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *TokenInfo) GetMetadata() string { - if m != nil { - return m.Metadata - } - return "" -} - -func (m *TokenInfo) GetHash() string { - if m != nil { - return m.Hash - } - return "" -} - -func init() { - proto.RegisterType((*TokenInfo)(nil), "kira.layer2.TokenInfo") -} - -func init() { proto.RegisterFile("kira/layer2/mint.proto", fileDescriptor_066d1ba7ae573fa3) } - -var fileDescriptor_066d1ba7ae573fa3 = []byte{ - // 429 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xcf, 0x6a, 0xdb, 0x40, - 0x10, 0xc6, 0xad, 0xc6, 0x71, 0xe2, 0x75, 0xff, 0xb1, 0x84, 0x30, 0x18, 0x2a, 0x9b, 0x1e, 0x8a, - 0x2f, 0xf5, 0x42, 0xfb, 0x02, 0x25, 0x85, 0x40, 0xe8, 0xcd, 0xe4, 0xd4, 0x4b, 0x59, 0x49, 0x63, - 0x79, 0xb1, 0x76, 0x47, 0x68, 0xd7, 0xa4, 0x7a, 0x8b, 0x3e, 0x40, 0x1f, 0xa0, 0x8f, 0x92, 0x63, - 0x8e, 0xa5, 0x87, 0x50, 0xec, 0x17, 0x09, 0x3b, 0xb2, 0x43, 0xce, 0x39, 0x69, 0x7e, 0xdf, 0xcc, - 0x68, 0xbf, 0xdd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, 0x7a, 0xff, 0xee, 0x27, 0x1f, - 0x4a, 0x13, 0x56, 0x9b, 0x6c, 0x9e, 0x93, 0x55, 0x39, 0x79, 0x4b, 0x7e, 0xff, 0xf9, 0xe8, 0x8b, - 0xb5, 0x8a, 0xcf, 0xe1, 0xe7, 0x57, 0x2e, 0x2c, 0x62, 0xab, 0xbc, 0x14, 0x03, 0xbf, 0xa9, 0xeb, - 0xaa, 0x85, 0xd1, 0xb3, 0x7e, 0xb2, 0xef, 0x8e, 0xf7, 0x5a, 0x51, 0x55, 0x60, 0xe3, 0xe1, 0x25, - 0x9b, 0x3c, 0x60, 0xf4, 0xb8, 0x44, 0x84, 0x57, 0xcf, 0xf3, 0xb8, 0x44, 0x9e, 0x15, 0xdd, 0x38, - 0x6c, 0xe0, 0x75, 0x37, 0x2b, 0x86, 0xf8, 0x2e, 0x16, 0x83, 0x2e, 0x74, 0xd0, 0xf0, 0x86, 0x13, - 0x8f, 0x1c, 0x67, 0xb3, 0xd2, 0x7e, 0x05, 0x6f, 0xbb, 0xd9, 0xc4, 0xf8, 0xe2, 0xf2, 0xcf, 0x36, - 0x4d, 0x6e, 0xb7, 0x69, 0x72, 0xb7, 0x4d, 0x93, 0xff, 0xdb, 0x34, 0xf9, 0xb5, 0x4b, 0x7b, 0x77, - 0xbb, 0xb4, 0xf7, 0x77, 0x97, 0xf6, 0xbe, 0xcf, 0x9e, 0x18, 0xfa, 0x66, 0x1a, 0xfd, 0x95, 0x1a, - 0x54, 0x1e, 0xd7, 0xda, 0xa8, 0x9f, 0x87, 0x7d, 0x65, 0x5b, 0xd9, 0x80, 0xb7, 0xed, 0xf3, 0x43, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0x35, 0x96, 0x68, 0xcb, 0x02, 0x00, 0x00, -} - -func (this *TokenInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TokenInfo) - if !ok { - that2, ok := that.(TokenInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TokenType != that1.TokenType { - return false - } - if this.Denom != that1.Denom { - return false - } - if this.Name != that1.Name { - return false - } - if this.Symbol != that1.Symbol { - return false - } - if this.Icon != that1.Icon { - return false - } - if this.Description != that1.Description { - return false - } - if this.Website != that1.Website { - return false - } - if this.Social != that1.Social { - return false - } - if this.Decimals != that1.Decimals { - return false - } - if !this.Cap.Equal(that1.Cap) { - return false - } - if !this.Supply.Equal(that1.Supply) { - return false - } - if this.Holders != that1.Holders { - return false - } - if !this.Fee.Equal(that1.Fee) { - return false - } - if this.Owner != that1.Owner { - return false - } - if this.Metadata != that1.Metadata { - return false - } - if this.Hash != that1.Hash { - return false - } - return true -} -func (m *TokenInfo) 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 *TokenInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintMint(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintMint(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x7a - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintMint(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0x72 - } - { - size := m.Fee.Size() - i -= size - if _, err := m.Fee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - if m.Holders != 0 { - i = encodeVarintMint(dAtA, i, uint64(m.Holders)) - i-- - dAtA[i] = 0x60 - } - { - size := m.Supply.Size() - i -= size - if _, err := m.Supply.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - { - size := m.Cap.Size() - i -= size - if _, err := m.Cap.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - if m.Decimals != 0 { - i = encodeVarintMint(dAtA, i, uint64(m.Decimals)) - i-- - dAtA[i] = 0x48 - } - if len(m.Social) > 0 { - i -= len(m.Social) - copy(dAtA[i:], m.Social) - i = encodeVarintMint(dAtA, i, uint64(len(m.Social))) - i-- - dAtA[i] = 0x42 - } - if len(m.Website) > 0 { - i -= len(m.Website) - copy(dAtA[i:], m.Website) - i = encodeVarintMint(dAtA, i, uint64(len(m.Website))) - i-- - dAtA[i] = 0x3a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintMint(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x32 - } - if len(m.Icon) > 0 { - i -= len(m.Icon) - copy(dAtA[i:], m.Icon) - i = encodeVarintMint(dAtA, i, uint64(len(m.Icon))) - i-- - dAtA[i] = 0x2a - } - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintMint(dAtA, i, uint64(len(m.Symbol))) - i-- - dAtA[i] = 0x22 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintMint(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintMint(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x12 - } - if len(m.TokenType) > 0 { - i -= len(m.TokenType) - copy(dAtA[i:], m.TokenType) - i = encodeVarintMint(dAtA, i, uint64(len(m.TokenType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintMint(dAtA []byte, offset int, v uint64) int { - offset -= sovMint(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TokenInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TokenType) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Icon) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Website) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Social) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - if m.Decimals != 0 { - n += 1 + sovMint(uint64(m.Decimals)) - } - l = m.Cap.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.Supply.Size() - n += 1 + l + sovMint(uint64(l)) - if m.Holders != 0 { - n += 1 + sovMint(uint64(m.Holders)) - } - l = m.Fee.Size() - n += 1 + l + sovMint(uint64(l)) - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Hash) - if l > 0 { - n += 2 + l + sovMint(uint64(l)) - } - return n -} - -func sovMint(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMint(x uint64) (n int) { - return sovMint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TokenInfo) 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 ErrIntOverflowMint - } - 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: TokenInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TokenType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Icon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Website = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Social", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Social = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - 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 ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decimals |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cap", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Cap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Holders", wireType) - } - m.Holders = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Holders |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMint(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, ErrIntOverflowMint - } - 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, ErrIntOverflowMint - } - 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, ErrIntOverflowMint - } - 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, ErrInvalidLengthMint - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMint - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMint - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthMint = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMint = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMint = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/layer2/types/query.pb.go b/x/layer2/types/query.pb.go index 98b835ba8..bc2337adf 100644 --- a/x/layer2/types/query.pb.go +++ b/x/layer2/types/query.pb.go @@ -287,86 +287,6 @@ func (m *QueryTransferDappsResponse) GetXAMs() []XAM { return nil } -type QueryGlobalTokensRequest struct { -} - -func (m *QueryGlobalTokensRequest) Reset() { *m = QueryGlobalTokensRequest{} } -func (m *QueryGlobalTokensRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGlobalTokensRequest) ProtoMessage() {} -func (*QueryGlobalTokensRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b9c14366296fd7f4, []int{6} -} -func (m *QueryGlobalTokensRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGlobalTokensRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGlobalTokensRequest.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 *QueryGlobalTokensRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGlobalTokensRequest.Merge(m, src) -} -func (m *QueryGlobalTokensRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGlobalTokensRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGlobalTokensRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGlobalTokensRequest proto.InternalMessageInfo - -type QueryGlobalTokensResponse struct { - Tokens []TokenInfo `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens"` -} - -func (m *QueryGlobalTokensResponse) Reset() { *m = QueryGlobalTokensResponse{} } -func (m *QueryGlobalTokensResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGlobalTokensResponse) ProtoMessage() {} -func (*QueryGlobalTokensResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b9c14366296fd7f4, []int{7} -} -func (m *QueryGlobalTokensResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGlobalTokensResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGlobalTokensResponse.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 *QueryGlobalTokensResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGlobalTokensResponse.Merge(m, src) -} -func (m *QueryGlobalTokensResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGlobalTokensResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGlobalTokensResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGlobalTokensResponse proto.InternalMessageInfo - -func (m *QueryGlobalTokensResponse) GetTokens() []TokenInfo { - if m != nil { - return m.Tokens - } - return nil -} - func init() { proto.RegisterType((*QueryExecutionRegistrarRequest)(nil), "kira.layer2.QueryExecutionRegistrarRequest") proto.RegisterType((*QueryExecutionRegistrarResponse)(nil), "kira.layer2.QueryExecutionRegistrarResponse") @@ -374,51 +294,45 @@ func init() { proto.RegisterType((*QueryAllDappsResponse)(nil), "kira.layer2.QueryAllDappsResponse") proto.RegisterType((*QueryTransferDappsRequest)(nil), "kira.layer2.QueryTransferDappsRequest") proto.RegisterType((*QueryTransferDappsResponse)(nil), "kira.layer2.QueryTransferDappsResponse") - proto.RegisterType((*QueryGlobalTokensRequest)(nil), "kira.layer2.QueryGlobalTokensRequest") - proto.RegisterType((*QueryGlobalTokensResponse)(nil), "kira.layer2.QueryGlobalTokensResponse") } func init() { proto.RegisterFile("kira/layer2/query.proto", fileDescriptor_b9c14366296fd7f4) } var fileDescriptor_b9c14366296fd7f4 = []byte{ - // 590 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4f, 0x6f, 0xd3, 0x30, - 0x1c, 0x6d, 0x46, 0x37, 0x81, 0x07, 0x12, 0x98, 0x51, 0xb2, 0x30, 0xa5, 0x23, 0xd2, 0xc6, 0x34, - 0x58, 0xad, 0x15, 0xb8, 0xd3, 0xf2, 0x5f, 0x68, 0x12, 0xab, 0x76, 0x98, 0xb8, 0x54, 0x4e, 0xe7, - 0x06, 0xab, 0xa9, 0x9d, 0xda, 0x2e, 0x5a, 0x85, 0x38, 0x80, 0xf8, 0x00, 0x48, 0xdc, 0xf8, 0x00, - 0x1c, 0xf9, 0x1c, 0x3b, 0x4e, 0xe2, 0xc2, 0x09, 0xa1, 0x96, 0x0f, 0x82, 0xe2, 0xb8, 0x23, 0x59, - 0x42, 0xc7, 0xa9, 0xee, 0xef, 0xbd, 0xdf, 0x7b, 0xcf, 0xfe, 0xfd, 0x14, 0x70, 0xbd, 0x47, 0x05, - 0x46, 0x21, 0x1e, 0x11, 0x51, 0x47, 0x83, 0x21, 0x11, 0xa3, 0x5a, 0x24, 0xb8, 0xe2, 0x70, 0x31, - 0x06, 0x6a, 0x09, 0xe0, 0x6c, 0x76, 0xb8, 0xec, 0x73, 0x89, 0x7c, 0x2c, 0x49, 0xc2, 0x42, 0x6f, - 0xb6, 0x7d, 0xa2, 0xf0, 0x36, 0x8a, 0x70, 0x40, 0x19, 0x56, 0x94, 0xb3, 0xa4, 0xd1, 0x59, 0x0a, - 0x78, 0xc0, 0xf5, 0x11, 0xc5, 0x27, 0x53, 0x5d, 0x0e, 0x38, 0x0f, 0x42, 0x82, 0xf4, 0x3f, 0x7f, - 0xd8, 0x45, 0x98, 0x19, 0x27, 0x67, 0xc5, 0x40, 0x38, 0xa2, 0x08, 0x33, 0xc6, 0x95, 0x56, 0x93, - 0x06, 0xb5, 0xd3, 0x01, 0x93, 0x1f, 0x83, 0x54, 0xd2, 0x48, 0x9f, 0x32, 0x95, 0xd4, 0xbd, 0x07, - 0xc0, 0xdd, 0x8d, 0x23, 0x3e, 0x3e, 0x24, 0x9d, 0x61, 0x2c, 0xd5, 0x22, 0x01, 0x95, 0x4a, 0x60, - 0xd1, 0x22, 0x83, 0x21, 0x91, 0x0a, 0xba, 0x00, 0xd0, 0x03, 0xc2, 0x14, 0xed, 0x52, 0x22, 0x6c, - 0x6b, 0xd5, 0xda, 0xb8, 0xd0, 0x4a, 0x55, 0xbc, 0x2f, 0x16, 0xa8, 0xfe, 0x53, 0x42, 0x46, 0x9c, - 0x49, 0x02, 0xd7, 0x40, 0xf9, 0x00, 0x47, 0x91, 0xee, 0x5e, 0xac, 0x5f, 0xa9, 0xa5, 0x9e, 0xab, - 0xf6, 0x08, 0x47, 0x51, 0x4b, 0xc3, 0xf0, 0x25, 0xb8, 0x4a, 0xa6, 0x22, 0x6d, 0x31, 0x55, 0xb1, - 0xe7, 0x74, 0x57, 0x35, 0xd3, 0x55, 0x60, 0x06, 0x49, 0xae, 0xe6, 0x55, 0xc0, 0x92, 0xce, 0xd6, - 0x08, 0xc3, 0xd8, 0x47, 0x9a, 0x4b, 0x79, 0x4f, 0xc0, 0xb5, 0x53, 0x75, 0x93, 0x74, 0x0b, 0xcc, - 0xc7, 0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9, 0x08, 0x2b, 0xd0, 0xc9, 0x44, 0x50, 0x86, 0xab, 0x73, - 0xc0, 0xf7, 0x16, 0xb8, 0x98, 0x9e, 0x3d, 0x5c, 0xcb, 0xab, 0x17, 0xec, 0x8d, 0xb3, 0x7e, 0x16, - 0x6d, 0x66, 0x86, 0x40, 0x53, 0xdb, 0xc9, 0xc2, 0x34, 0x9b, 0x47, 0x63, 0xd7, 0x3a, 0x1e, 0xbb, - 0xd6, 0xaf, 0xb1, 0x6b, 0x7d, 0x9a, 0xb8, 0xa5, 0xe3, 0x89, 0x5b, 0xfa, 0x31, 0x71, 0x4b, 0xaf, - 0x36, 0x02, 0xaa, 0x5e, 0x0f, 0xfd, 0x5a, 0x87, 0xf7, 0xd1, 0x0b, 0x2a, 0xf0, 0x43, 0x2e, 0x08, - 0x92, 0xa4, 0x87, 0x29, 0x3a, 0x3c, 0xb9, 0xcf, 0x28, 0x22, 0xd2, 0x5f, 0xd0, 0x1f, 0xa4, 0xbb, - 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xae, 0x94, 0x53, 0xc9, 0x65, 0x05, 0x00, 0x00, + // 520 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x37, 0xed, 0x56, 0x74, 0x8a, 0xa0, 0x63, 0xad, 0x69, 0x2c, 0xd9, 0x1a, 0x50, 0x4b, + 0xb5, 0x19, 0xba, 0xe2, 0xdd, 0x5d, 0xff, 0x20, 0x48, 0x41, 0x83, 0x87, 0xe2, 0xa5, 0x4c, 0xb6, + 0xef, 0xc6, 0xa1, 0x69, 0x66, 0x76, 0x66, 0x22, 0x5d, 0xc4, 0x8b, 0xf8, 0x01, 0x04, 0x6f, 0x7e, + 0x00, 0x0f, 0x7e, 0x92, 0x1e, 0x0b, 0x5e, 0x3c, 0x89, 0xec, 0xfa, 0x41, 0x24, 0x93, 0x59, 0xdd, + 0x74, 0x63, 0xed, 0x69, 0xb3, 0xef, 0xfb, 0xbc, 0xcf, 0xf3, 0xcb, 0xbc, 0x13, 0x74, 0x6d, 0x9f, + 0x49, 0x4a, 0x52, 0x3a, 0x04, 0xd9, 0x26, 0x83, 0x1c, 0xe4, 0x30, 0x14, 0x92, 0x6b, 0x8e, 0x17, + 0x8b, 0x46, 0x58, 0x36, 0xbc, 0x8d, 0x1e, 0x57, 0x07, 0x5c, 0x91, 0x98, 0x2a, 0x28, 0x55, 0xe4, + 0xcd, 0x56, 0x0c, 0x9a, 0x6e, 0x11, 0x41, 0x13, 0x96, 0x51, 0xcd, 0x78, 0x56, 0x0e, 0x7a, 0x4b, + 0x09, 0x4f, 0xb8, 0x79, 0x24, 0xc5, 0x93, 0xad, 0xae, 0x24, 0x9c, 0x27, 0x29, 0x10, 0xf3, 0x2f, + 0xce, 0xfb, 0x84, 0x66, 0x36, 0xc9, 0x5b, 0xb5, 0x2d, 0x2a, 0x18, 0xa1, 0x59, 0xc6, 0xb5, 0x71, + 0x53, 0xb6, 0xeb, 0x4e, 0x03, 0x96, 0x3f, 0x65, 0x27, 0x78, 0x80, 0xfc, 0x17, 0x05, 0xca, 0xe3, + 0x43, 0xe8, 0xe5, 0xc5, 0x48, 0x04, 0x09, 0x53, 0x5a, 0x52, 0x19, 0xc1, 0x20, 0x07, 0xa5, 0xb1, + 0x8f, 0x10, 0xdb, 0x83, 0x4c, 0xb3, 0x3e, 0x03, 0xe9, 0x3a, 0x6b, 0xce, 0xfa, 0x85, 0x68, 0xaa, + 0x12, 0x7c, 0x76, 0x50, 0xeb, 0x9f, 0x16, 0x4a, 0xf0, 0x4c, 0x01, 0xbe, 0x89, 0x9a, 0x7b, 0x54, + 0x08, 0x33, 0xbd, 0xd8, 0xbe, 0x1c, 0x4e, 0x1d, 0x4b, 0xf8, 0x88, 0x0a, 0x11, 0x99, 0x36, 0x7e, + 0x8e, 0xae, 0xc0, 0xc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10, 0x56, 0xb1, 0x57, 0x41, 0xd0, + 0x56, 0x6b, 0x38, 0xba, 0xdd, 0xa3, 0x91, 0xef, 0x1c, 0x8f, 0x7c, 0xe7, 0xe7, 0xc8, 0x77, 0x3e, + 0x8e, 0xfd, 0xc6, 0xf1, 0xd8, 0x6f, 0x7c, 0x1f, 0xfb, 0x8d, 0x57, 0xeb, 0x09, 0xd3, 0xaf, 0xf3, + 0x38, 0xec, 0xf1, 0x03, 0xf2, 0x8c, 0x49, 0xfa, 0x90, 0x4b, 0x20, 0x0a, 0xf6, 0x29, 0x23, 0x87, + 0x7f, 0xbc, 0x86, 0x02, 0x54, 0x7c, 0xce, 0x7c, 0x9d, 0xf7, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, + 0xeb, 0xc1, 0xe4, 0xa8, 0x5a, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -441,12 +355,6 @@ type QueryClient interface { // query XAMs’ records by either account address, account index, xid or // transaction hash in which cross-app transaction was added to the ABR. TransferDapps(ctx context.Context, in *QueryTransferDappsRequest, opts ...grpc.CallOption) (*QueryTransferDappsResponse, error) - // query list of all token denoms on the network including those created in - // the genesis (ukex, samolean etc..) as well as those in the minting module, - // lp tokens, validator recovery tokens and so on. If the flag with specific - // name is specified provide a detailed information about the token including - // its current circulating supply etc. - GlobalTokens(ctx context.Context, in *QueryGlobalTokensRequest, opts ...grpc.CallOption) (*QueryGlobalTokensResponse, error) } type queryClient struct { @@ -484,15 +392,6 @@ func (c *queryClient) TransferDapps(ctx context.Context, in *QueryTransferDappsR return out, nil } -func (c *queryClient) GlobalTokens(ctx context.Context, in *QueryGlobalTokensRequest, opts ...grpc.CallOption) (*QueryGlobalTokensResponse, error) { - out := new(QueryGlobalTokensResponse) - err := c.cc.Invoke(ctx, "/kira.layer2.Query/GlobalTokens", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // query info of a specific application by dApp ID or name @@ -503,12 +402,6 @@ type QueryServer interface { // query XAMs’ records by either account address, account index, xid or // transaction hash in which cross-app transaction was added to the ABR. TransferDapps(context.Context, *QueryTransferDappsRequest) (*QueryTransferDappsResponse, error) - // query list of all token denoms on the network including those created in - // the genesis (ukex, samolean etc..) as well as those in the minting module, - // lp tokens, validator recovery tokens and so on. If the flag with specific - // name is specified provide a detailed information about the token including - // its current circulating supply etc. - GlobalTokens(context.Context, *QueryGlobalTokensRequest) (*QueryGlobalTokensResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -524,9 +417,6 @@ func (*UnimplementedQueryServer) AllDapps(ctx context.Context, req *QueryAllDapp func (*UnimplementedQueryServer) TransferDapps(ctx context.Context, req *QueryTransferDappsRequest) (*QueryTransferDappsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TransferDapps not implemented") } -func (*UnimplementedQueryServer) GlobalTokens(ctx context.Context, req *QueryGlobalTokensRequest) (*QueryGlobalTokensResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GlobalTokens not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -586,24 +476,6 @@ func _Query_TransferDapps_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Query_GlobalTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGlobalTokensRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GlobalTokens(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.layer2.Query/GlobalTokens", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GlobalTokens(ctx, req.(*QueryGlobalTokensRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "kira.layer2.Query", HandlerType: (*QueryServer)(nil), @@ -620,10 +492,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "TransferDapps", Handler: _Query_TransferDapps_Handler, }, - { - MethodName: "GlobalTokens", - Handler: _Query_GlobalTokens_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "kira/layer2/query.proto", @@ -826,66 +694,6 @@ func (m *QueryTransferDappsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryGlobalTokensRequest) 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 *QueryGlobalTokensRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGlobalTokensRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryGlobalTokensResponse) 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 *QueryGlobalTokensResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGlobalTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tokens) > 0 { - for iNdEx := len(m.Tokens) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -975,30 +783,6 @@ func (m *QueryTransferDappsResponse) Size() (n int) { return n } -func (m *QueryGlobalTokensRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryGlobalTokensResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Tokens) > 0 { - for _, e := range m.Tokens { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1477,140 +1261,6 @@ func (m *QueryTransferDappsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGlobalTokensRequest) 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 ErrIntOverflowQuery - } - 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: QueryGlobalTokensRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGlobalTokensRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGlobalTokensResponse) 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 ErrIntOverflowQuery - } - 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: QueryGlobalTokensResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGlobalTokensResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tokens = append(m.Tokens, TokenInfo{}) - if err := m.Tokens[len(m.Tokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/layer2/types/query.pb.gw.go b/x/layer2/types/query.pb.gw.go index 9e159d901..3c7530a48 100644 --- a/x/layer2/types/query.pb.gw.go +++ b/x/layer2/types/query.pb.gw.go @@ -123,24 +123,6 @@ func local_request_Query_TransferDapps_0(ctx context.Context, marshaler runtime. } -func request_Query_GlobalTokens_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGlobalTokensRequest - var metadata runtime.ServerMetadata - - msg, err := client.GlobalTokens(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GlobalTokens_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGlobalTokensRequest - var metadata runtime.ServerMetadata - - msg, err := server.GlobalTokens(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -216,29 +198,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_GlobalTokens_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GlobalTokens_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GlobalTokens_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -340,26 +299,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_GlobalTokens_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GlobalTokens_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GlobalTokens_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -369,8 +308,6 @@ var ( pattern_Query_AllDapps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "layer2", "all_dapps"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_TransferDapps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "layer2", "transfer_dapp"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_GlobalTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "layer2", "global_tokens"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -379,6 +316,4 @@ var ( forward_Query_AllDapps_0 = runtime.ForwardResponseMessage forward_Query_TransferDapps_0 = runtime.ForwardResponseMessage - - forward_Query_GlobalTokens_0 = runtime.ForwardResponseMessage ) diff --git a/x/layer2/types/tx.pb.go b/x/layer2/types/tx.pb.go index 660c15d45..619cd45ee 100644 --- a/x/layer2/types/tx.pb.go +++ b/x/layer2/types/tx.pb.go @@ -1759,11 +1759,11 @@ type MsgMintCreateFtTx struct { Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` Website string `protobuf:"bytes,7,opt,name=website,proto3" json:"website,omitempty"` Social string `protobuf:"bytes,8,opt,name=social,proto3" json:"social,omitempty"` - Decimals uint64 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` + Decimals uint32 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` Cap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=cap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"cap"` Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` Holders uint64 `protobuf:"varint,12,opt,name=holders,proto3" json:"holders,omitempty"` - Fee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,13,opt,name=fee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` Owner string `protobuf:"bytes,14,opt,name=owner,proto3" json:"owner,omitempty"` } @@ -1856,7 +1856,7 @@ func (m *MsgMintCreateFtTx) GetSocial() string { return "" } -func (m *MsgMintCreateFtTx) GetDecimals() uint64 { +func (m *MsgMintCreateFtTx) GetDecimals() uint32 { if m != nil { return m.Decimals } @@ -1923,11 +1923,11 @@ type MsgMintCreateNftTx struct { Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` Website string `protobuf:"bytes,7,opt,name=website,proto3" json:"website,omitempty"` Social string `protobuf:"bytes,8,opt,name=social,proto3" json:"social,omitempty"` - Decimals uint64 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` + Decimals uint32 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` Cap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=cap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"cap"` Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` Holders uint64 `protobuf:"varint,12,opt,name=holders,proto3" json:"holders,omitempty"` - Fee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,13,opt,name=fee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` Owner string `protobuf:"bytes,14,opt,name=owner,proto3" json:"owner,omitempty"` Metadata string `protobuf:"bytes,15,opt,name=metadata,proto3" json:"metadata,omitempty"` Hash string `protobuf:"bytes,16,opt,name=hash,proto3" json:"hash,omitempty"` @@ -2022,7 +2022,7 @@ func (m *MsgMintCreateNftTx) GetSocial() string { return "" } -func (m *MsgMintCreateNftTx) GetDecimals() uint64 { +func (m *MsgMintCreateNftTx) GetDecimals() uint32 { if m != nil { return m.Decimals } @@ -2332,107 +2332,108 @@ func init() { func init() { proto.RegisterFile("kira/layer2/tx.proto", fileDescriptor_c30a928a62b31d6d) } var fileDescriptor_c30a928a62b31d6d = []byte{ - // 1591 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xdd, 0x6f, 0x1b, 0xc5, - 0x16, 0x8f, 0x1b, 0x27, 0x4d, 0x8e, 0x9b, 0x34, 0xdd, 0x9b, 0xa6, 0xdb, 0x4d, 0xe3, 0xb8, 0xce, - 0x6d, 0x9b, 0x7b, 0xaf, 0xae, 0x8d, 0xc2, 0x13, 0x12, 0x12, 0xe4, 0x13, 0x5a, 0xea, 0x52, 0x6d, - 0x53, 0xa8, 0x40, 0xc2, 0x9a, 0xac, 0xc7, 0x9b, 0x6d, 0xd6, 0x3b, 0xcb, 0xce, 0x3a, 0x71, 0xfe, - 0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f, 0xa3, 0x82, 0xff, 0x45, 0x01, 0x66, 0x24, 0x6b, 0xa3, 0x1b, 0x78, - 0x7f, 0x16, 0xfa, 0xea, 0x15, 0xfe, 0x1e, 0xf3, 0x12, 0x46, 0x04, 0x70, 0xed, 0x87, 0x39, 0x18, - 0x6f, 0x50, 0x5b, 0x6b, 0x81, 0x96, 0xf1, 0x5a, 0x53, 0x8d, 0x5d, 0x17, 0x99, 0xcf, 0x25, 0xc6, - 0x7f, 0x07, 0xcb, 0x44, 0xde, 0xb4, 0xcf, 0x60, 0x2e, 0xf5, 0x9c, 0x52, 0x49, 0xea, 0x27, 0x25, - 0x8c, 0xd5, 0x41, 0x12, 0xca, 0x3e, 0x85, 0x2b, 0x79, 0xaf, 0x1f, 0xb7, 0x92, 0x46, 0x72, 0x04, - 0x8d, 0xfa, 0x19, 0x05, 0x95, 0xd3, 0x43, 0xd0, 0x73, 0x1f, 0x2d, 0x52, 0xd0, 0xf3, 0x24, 0x8d, - 0x37, 0xce, 0x2a, 0xa9, 0xfc, 0xee, 0xc0, 0x94, 0x7a, 0x99, 0xd0, 0x93, 0xda, 0x11, 0xc7, 0xa8, - 0xe4, 0x71, 0xfa, 0x37, 0x25, 0xf5, 0x0a, 0x51, 0x49, 0x27, 0x21, 0x2e, 0x91, 0xde, 0x94, 0xbc, - 0x29, 0x5f, 0x7b, 0x04, 0xb3, 0x89, 0x09, 0xbf, 0x9c, 0xd4, 0x8d, 0xf3, 0x8d, 0x9b, 0xa7, 0xf3, - 0x95, 0x65, 0x04, 0x97, 0xd2, 0x03, 0xf4, 0xf5, 0x54, 0x3d, 0x26, 0x45, 0x8c, 0xff, 0x0c, 0x14, - 0x51, 0x2e, 0x3e, 0x84, 0x52, 0xff, 0x44, 0xb8, 0x98, 0xd4, 0xec, 0x63, 0x1a, 0x2b, 0xa7, 0x30, - 0x95, 0xc1, 0x87, 0x30, 0x13, 0x1f, 0x32, 0x97, 0x92, 0x5a, 0x31, 0xb6, 0x71, 0xe3, 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 0xf4, 0xa4, 0x5c, 0x78, 0x76, 0x52, 0x2e, 0xfc, 0x7a, 0x52, 0x2e, 0x7c, - 0xfd, 0xa2, 0x3c, 0xf6, 0xec, 0x45, 0x79, 0xec, 0xa7, 0x17, 0xe5, 0xb1, 0x4f, 0x56, 0xfb, 0xfa, - 0x93, 0x0f, 0x9c, 0x00, 0x6d, 0x92, 0x00, 0xd7, 0x29, 0x3e, 0x40, 0x4e, 0xbd, 0xa7, 0xfe, 0x41, - 0xc5, 0xba, 0x94, 0xbd, 0x49, 0xfe, 0xaa, 0xf1, 0xe6, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0x78, - 0xfc, 0x9a, 0xb8, 0xbc, 0x1a, 0x00, 0x00, + // 1603 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4b, 0x6f, 0x1b, 0x47, + 0x12, 0x16, 0x2d, 0xea, 0x55, 0xb4, 0x64, 0x79, 0x56, 0x96, 0xc7, 0x23, 0x8b, 0xa2, 0xa9, 0xb5, + 0xcd, 0xdd, 0xc5, 0x92, 0x0b, 0xed, 0x69, 0x81, 0x05, 0x12, 0x3d, 0x13, 0x3b, 0xa6, 0x63, 0x8c, + 0xe5, 0xc4, 0x48, 0x80, 0x10, 0xad, 0x61, 0x73, 0x34, 0xd6, 0x70, 0x7a, 0x32, 0xdd, 0x94, 0xa8, + 0x73, 0x90, 0x63, 0x90, 0x9c, 0x72, 0x77, 0x4e, 0xf9, 0x01, 0x41, 0x7e, 0x42, 0xe0, 0xa3, 0x8f, + 0x41, 0x02, 0x18, 0x81, 0xfc, 0x47, 0x82, 0xee, 0xe9, 0x69, 0x73, 0x5e, 0x92, 0x4c, 0x3a, 0x48, + 0x80, 0xe4, 0x24, 0x56, 0xd7, 0xeb, 0xab, 0xea, 0x9a, 0xee, 0xaa, 0x16, 0x2c, 0x1c, 0x38, 0x01, + 0x6a, 0xb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a, 0x53, 0xb0, 0x93, + 0x12, 0x69, 0xd8, 0x79, 0x53, 0x1d, 0xb7, 0x9f, 0x9a, 0xe8, 0x52, 0xf6, 0x93, 0x12, 0x69, 0xfb, + 0x79, 0xd3, 0x14, 0x3f, 0x70, 0xf2, 0x46, 0xa9, 0xd4, 0x81, 0x93, 0x23, 0x98, 0x3e, 0x70, 0xce, + 0x98, 0x97, 0x34, 0x1f, 0x16, 0x73, 0x86, 0xa5, 0x5b, 0xe9, 0xfd, 0xcc, 0x92, 0x33, 0xea, 0xe7, + 0x93, 0x1b, 0xfc, 0x84, 0x13, 0x53, 0x48, 0x39, 0x33, 0x45, 0x8a, 0x9f, 0xfe, 0x84, 0xb3, 0xe7, + 0x0a, 0xfe, 0x09, 0xa7, 0x47, 0x9c, 0xd4, 0x27, 0x9c, 0x12, 0x49, 0x7f, 0xc2, 0xb9, 0xa3, 0x0b, + 0x07, 0x9f, 0x18, 0x5b, 0x52, 0xe0, 0xe3, 0xfc, 0x34, 0xf8, 0xec, 0x8e, 0x57, 0xfb, 0x18, 0x2e, + 0x25, 0xbb, 0xdd, 0x95, 0x7c, 0x55, 0x21, 0x60, 0xdc, 0x3e, 0x43, 0x60, 0xf0, 0xe4, 0x19, 0xec, + 0x7a, 0x96, 0xb2, 0xf4, 0x24, 0x33, 0x7d, 0xf2, 0x64, 0xf4, 0x22, 0xda, 0x3d, 0x80, 0x81, 0x3e, + 0xc4, 0xc8, 0x52, 0x09, 0x79, 0x46, 0x35, 0x9f, 0xa7, 0x26, 0xc8, 0x9d, 0x6f, 0x4f, 0xca, 0x85, + 0x67, 0x27, 0xe5, 0xc2, 0xf3, 0x93, 0x72, 0xe1, 0x97, 0x93, 0x72, 0xe1, 0xab, 0x97, 0xe5, 0xb1, + 0xe7, 0x2f, 0xcb, 0x63, 0x3f, 0xbe, 0x2c, 0x8f, 0x7d, 0x54, 0x1b, 0xe8, 0x4f, 0xde, 0x73, 0x02, + 0xb4, 0x49, 0x02, 0xdc, 0xa0, 0xf8, 0x00, 0x39, 0x8d, 0xbe, 0xfa, 0x97, 0x15, 0xef, 0x52, 0xf6, + 0x26, 0xc5, 0x3b, 0xc7, 0x7f, 0x7f, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x6e, 0xed, 0xf0, 0xf6, 0xce, + 0x1a, 0x00, 0x00, } func (this *MsgCreateDappProposal) Equal(that interface{}) bool { @@ -3429,7 +3430,7 @@ func (this *MsgMintCreateFtTx) Equal(that interface{}) bool { if this.Holders != that1.Holders { return false } - if !this.Fee.Equal(that1.Fee) { + if !this.FeeRate.Equal(that1.FeeRate) { return false } if this.Owner != that1.Owner { @@ -3513,7 +3514,7 @@ func (this *MsgMintCreateNftTx) Equal(that interface{}) bool { if this.Holders != that1.Holders { return false } - if !this.Fee.Equal(that1.Fee) { + if !this.FeeRate.Equal(that1.FeeRate) { return false } if this.Owner != that1.Owner { @@ -5789,9 +5790,9 @@ func (m *MsgMintCreateFtTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x72 } { - size := m.Fee.Size() + size := m.FeeRate.Size() i -= size - if _, err := m.Fee.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintTx(dAtA, i, uint64(size)) @@ -5954,9 +5955,9 @@ func (m *MsgMintCreateNftTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x72 } { - size := m.Fee.Size() + size := m.FeeRate.Size() i -= size - if _, err := m.Fee.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintTx(dAtA, i, uint64(size)) @@ -6815,7 +6816,7 @@ func (m *MsgMintCreateFtTx) Size() (n int) { if m.Holders != 0 { n += 1 + sovTx(uint64(m.Holders)) } - l = m.Fee.Size() + l = m.FeeRate.Size() n += 1 + l + sovTx(uint64(l)) l = len(m.Owner) if l > 0 { @@ -6881,7 +6882,7 @@ func (m *MsgMintCreateNftTx) Size() (n int) { if m.Holders != 0 { n += 1 + sovTx(uint64(m.Holders)) } - l = m.Fee.Size() + l = m.FeeRate.Size() n += 1 + l + sovTx(uint64(l)) l = len(m.Owner) if l > 0 { @@ -10889,7 +10890,7 @@ func (m *MsgMintCreateFtTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Decimals |= uint64(b&0x7F) << shift + m.Decimals |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -10983,7 +10984,7 @@ func (m *MsgMintCreateFtTx) Unmarshal(dAtA []byte) error { } case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11011,7 +11012,7 @@ func (m *MsgMintCreateFtTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -11417,7 +11418,7 @@ func (m *MsgMintCreateNftTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Decimals |= uint64(b&0x7F) << shift + m.Decimals |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -11511,7 +11512,7 @@ func (m *MsgMintCreateNftTx) Unmarshal(dAtA []byte) error { } case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11539,7 +11540,7 @@ func (m *MsgMintCreateNftTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/multistaking/keeper/delegation.go b/x/multistaking/keeper/delegation.go index cdeb0237e..b31804002 100644 --- a/x/multistaking/keeper/delegation.go +++ b/x/multistaking/keeper/delegation.go @@ -166,7 +166,7 @@ func (k Keeper) IncreasePoolRewards(ctx sdk.Context, pool types.StakingPool, rew delegators := k.GetPoolDelegators(ctx, pool.Id) for _, shareToken := range pool.TotalShareTokens { nativeDenom := types.GetNativeDenom(pool.Id, shareToken.Denom) - rate := k.tokenKeeper.GetTokenRate(ctx, nativeDenom) + rate := k.tokenKeeper.GetTokenInfo(ctx, nativeDenom) if rate == nil { continue } @@ -216,8 +216,8 @@ func (k Keeper) IncreasePoolRewards(ctx sdk.Context, pool types.StakingPool, rew k.RemoveDelegatorRewards(ctx, delegator) } else { for _, reward := range rewards { - rate := k.tokenKeeper.GetTokenRate(ctx, reward.Denom) - if rate.StakeToken && reward.Amount.GTE(rate.StakeMin) && isWithinArray(reward.Denom, compoundInfo.CompoundDenoms) { + rate := k.tokenKeeper.GetTokenInfo(ctx, reward.Denom) + if rate.StakeEnabled && reward.Amount.GTE(rate.StakeMin) && isWithinArray(reward.Denom, compoundInfo.CompoundDenoms) { autoCompoundRewards = autoCompoundRewards.Add(reward) } } @@ -320,8 +320,8 @@ func (k Keeper) Delegate(ctx sdk.Context, msg *types.MsgDelegate) error { } for _, amount := range msg.Amounts { - rate := k.tokenKeeper.GetTokenRate(ctx, amount.Denom) - if !rate.StakeToken { + rate := k.tokenKeeper.GetTokenInfo(ctx, amount.Denom) + if !rate.StakeEnabled { return types.ErrNotAllowedStakingToken } if amount.Amount.LT(rate.StakeMin) { @@ -334,7 +334,7 @@ func (k Keeper) Delegate(ctx sdk.Context, msg *types.MsgDelegate) error { pool.TotalShareTokens = sdk.Coins(pool.TotalShareTokens).Add(poolCoins...) k.SetStakingPool(ctx, pool) - err = k.bankKeeper.MintCoins(ctx, minttypes.ModuleName, poolCoins) + err = k.tokenKeeper.MintCoins(ctx, minttypes.ModuleName, poolCoins) if err != nil { return err } @@ -400,7 +400,7 @@ func (k Keeper) GetPoolDelegationValue(ctx sdk.Context, pool types.StakingPool, delegationValue := sdk.ZeroInt() balances := k.bankKeeper.GetAllBalances(ctx, delegator) for _, stakingToken := range pool.TotalStakingTokens { - rate := k.tokenKeeper.GetTokenRate(ctx, stakingToken.Denom) + rate := k.tokenKeeper.GetTokenInfo(ctx, stakingToken.Denom) if rate == nil { continue } @@ -414,7 +414,7 @@ func (k Keeper) GetPoolDelegationValue(ctx sdk.Context, pool types.StakingPool, func (k Keeper) GetCoinsValue(ctx sdk.Context, coins sdk.Coins) sdk.Int { delegationValue := sdk.ZeroInt() for _, coin := range coins { - rate := k.tokenKeeper.GetTokenRate(ctx, coin.Denom) + rate := k.tokenKeeper.GetTokenInfo(ctx, coin.Denom) if rate == nil { continue } @@ -448,7 +448,7 @@ func (k Keeper) RegisterDelegator(ctx sdk.Context, delegator sdk.AccAddress) { } for _, stakingToken := range pool.TotalStakingTokens { - rate := k.tokenKeeper.GetTokenRate(ctx, stakingToken.Denom) + rate := k.tokenKeeper.GetTokenInfo(ctx, stakingToken.Denom) shareToken := types.GetShareDenom(pool.Id, stakingToken.Denom) balance := balances.AmountOf(shareToken) if balance.GTE(rate.StakeMin) { @@ -468,7 +468,7 @@ func (k Keeper) UnregisterNotEnoughStakeDelegator(ctx sdk.Context, pool types.St balances := k.bankKeeper.GetAllBalances(ctx, delegator) for _, shareToken := range pool.TotalShareTokens { nativeDenom := types.GetNativeDenom(pool.Id, shareToken.Denom) - rate := k.tokenKeeper.GetTokenRate(ctx, nativeDenom) + rate := k.tokenKeeper.GetTokenInfo(ctx, nativeDenom) if rate == nil { continue } diff --git a/x/multistaking/types/expected_keepers.go b/x/multistaking/types/expected_keepers.go index 752358b67..a517871d5 100644 --- a/x/multistaking/types/expected_keepers.go +++ b/x/multistaking/types/expected_keepers.go @@ -32,7 +32,8 @@ type BankKeeper interface { SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error } -// TokensKeeper defines expected interface needed to get token rate +// TokensKeeper defines expected interface needed from tokens keeper type TokensKeeper interface { - GetTokenRate(ctx sdk.Context, denom string) *tokenstypes.TokenRate + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo } diff --git a/x/recovery/keeper/keeper.go b/x/recovery/keeper/keeper.go index 8fa2c2092..de2b1b9cd 100644 --- a/x/recovery/keeper/keeper.go +++ b/x/recovery/keeper/keeper.go @@ -23,6 +23,7 @@ type Keeper struct { ck types.CollectivesKeeper spk types.SpendingKeeper custodyk types.CustodyKeeper + tk types.TokensKeeper } // NewKeeper creates a recovery keeper @@ -35,6 +36,7 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, ck types.CollectivesKeeper, spk types.SpendingKeeper, custodyk types.CustodyKeeper, + tk types.TokensKeeper, ) Keeper { return Keeper{ @@ -48,6 +50,7 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, ck: ck, spk: spk, custodyk: custodyk, + tk: tk, } } diff --git a/x/recovery/keeper/msg_server.go b/x/recovery/keeper/msg_server.go index 9dc0d4b34..23c8d4020 100644 --- a/x/recovery/keeper/msg_server.go +++ b/x/recovery/keeper/msg_server.go @@ -550,7 +550,7 @@ func (k msgServer) IssueRecoveryTokens(goCtx context.Context, msg *types.MsgIssu // issue 10'000'000 tokens recoveryTokenAmount := sdk.NewInt(10_000_000).Mul(sdk.NewInt(1000_000)) recoveryCoins := sdk.NewCoins(sdk.NewCoin(denom, recoveryTokenAmount)) - err = k.bk.MintCoins(ctx, types.ModuleName, recoveryCoins) + err = k.tk.MintCoins(ctx, types.ModuleName, recoveryCoins) if err != nil { return nil, err } @@ -608,7 +608,7 @@ func (k msgServer) BurnRecoveryTokens(goCtx context.Context, msg *types.MsgBurnR return nil, err } - err = k.bk.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(msg.RrCoin)) + err = k.tk.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(msg.RrCoin)) if err != nil { return nil, err } diff --git a/x/recovery/types/expected_keepers.go b/x/recovery/types/expected_keepers.go index eb8b01d2c..fd049b989 100644 --- a/x/recovery/types/expected_keepers.go +++ b/x/recovery/types/expected_keepers.go @@ -7,6 +7,7 @@ import ( multistakingtypes "github.com/KiraCore/sekai/x/multistaking/types" spendingtypes "github.com/KiraCore/sekai/x/spending/types" stakingtypes "github.com/KiraCore/sekai/x/staking/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" auth "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -127,3 +128,10 @@ type CustodyKeeper interface { GetCustodyPoolByAddress(ctx sdk.Context, address sdk.AccAddress) *custodytypes.TransactionPool DropCustodyPool(ctx sdk.Context, addr sdk.AccAddress) } + +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo +} diff --git a/x/spending/types/events.go b/x/spending/types/events.go index 8815e01aa..c64725871 100644 --- a/x/spending/types/events.go +++ b/x/spending/types/events.go @@ -2,7 +2,5 @@ package types // tokens module events const ( - EventTypeUpsertTokenAlias = "upsert_token_alias" - AttributeKeyDescription = "proposal_id" ) diff --git a/x/staking/client/cli/tx.go b/x/staking/client/cli/tx.go index 9f2f8a7b9..2e10f2213 100644 --- a/x/staking/client/cli/tx.go +++ b/x/staking/client/cli/tx.go @@ -70,7 +70,7 @@ func GetTxClaimValidatorCmd() *cobra.Command { return cmd } -// GetTxProposalUnjailValidatorCmd implement cli command for MsgUpsertTokenAlias +// GetTxProposalUnjailValidatorCmd implement cli command for UnjailValidator func GetTxProposalUnjailValidatorCmd() *cobra.Command { cmd := &cobra.Command{ Use: "unjail-validator [val_addr] [reference]", diff --git a/x/tokens/client/cli/cli_test.go b/x/tokens/client/cli/cli_test.go index bd127c7c2..999c2fac9 100644 --- a/x/tokens/client/cli/cli_test.go +++ b/x/tokens/client/cli/cli_test.go @@ -66,58 +66,22 @@ func (s *IntegrationTestSuite) TearDownSuite() { s.network.Cleanup() } -func (s *IntegrationTestSuite) TestUpsertTokenAliasAndQuery() { +func (s *IntegrationTestSuite) TestUpsertTokenInfoAndQuery() { val := s.network.Validators[0] clientCtx := val.ClientCtx - s.WhitelistPermissions(val.Address, govtypes.PermUpsertTokenAlias) + s.WhitelistPermissions(val.Address, govtypes.PermUpsertTokenInfo) - cmd := cli.GetTxUpsertTokenAliasCmd() - _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=%s", cli.FlagSymbol, "ETH"), - fmt.Sprintf("--%s=%s", cli.FlagName, "Ethereum"), - fmt.Sprintf("--%s=%s", cli.FlagIcon, "myiconurl"), - fmt.Sprintf("--%s=%d", cli.FlagDecimals, 6), - fmt.Sprintf("--%s=%s", cli.FlagDenoms, "finney"), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.DefaultDenom, sdk.NewInt(100))).String()), - }) - s.Require().NoError(err) - - height, err := s.network.LatestHeight() - s.Require().NoError(err) - - _, err = s.network.WaitForHeight(height + 2) - s.Require().NoError(err) - - cmd = cli.GetCmdQueryTokenAlias() - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{"ETH"}) - s.Require().NoError(err) - - var tokenAlias tokenstypes.TokenAlias - clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &tokenAlias) - - s.Require().Equal(tokenAlias.Symbol, "ETH") - s.Require().Equal(tokenAlias.Name, "Ethereum") - s.Require().Equal(tokenAlias.Icon, "myiconurl") - s.Require().Equal(tokenAlias.Decimals, uint32(6)) - s.Require().Equal(tokenAlias.Denoms, []string{"finney"}) -} - -func (s *IntegrationTestSuite) TestUpsertTokenRateAndQuery() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - s.WhitelistPermissions(val.Address, govtypes.PermUpsertTokenRate) - - cmd := cli.GetTxUpsertTokenRateCmd() + cmd := cli.GetTxUpsertTokenInfoCmd() _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=%s", cli.FlagDescription, "some desc"), fmt.Sprintf("--%s=%s", cli.FlagDenom, "ubtc"), - fmt.Sprintf("--%s=%f", cli.FlagRate, 0.00001), - fmt.Sprintf("--%s=%s", cli.FlagFeePayments, "true"), + fmt.Sprintf("--%s=%s", cli.FlagSupply, "0"), + fmt.Sprintf("--%s=%s", cli.FlagSupplyCap, "0"), + fmt.Sprintf("--%s=%f", cli.FlagFeeRate, 0.00001), + fmt.Sprintf("--%s=%d", cli.FlagMintingFee, 2), + fmt.Sprintf("--%s=%s", cli.FlagFeeEnabled, "true"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.DefaultDenom, sdk.NewInt(100))).String()), @@ -130,7 +94,7 @@ func (s *IntegrationTestSuite) TestUpsertTokenRateAndQuery() { _, err = s.network.WaitForHeight(height + 2) s.Require().NoError(err) - cmd = cli.GetCmdQueryTokenRate() + cmd = cli.GetCmdQueryTokenInfo() _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{"ubtc"}) s.Require().NoError(err) @@ -151,18 +115,24 @@ func (s *IntegrationTestSuite) TestGetCmdQueryTokenBlackWhites() { s.Require().Equal(blackWhites.Data.Whitelisted, []string{"ukex"}) } -func (s IntegrationTestSuite) TestCreateProposalUpsertTokenRates() { +func (s IntegrationTestSuite) TestCreateProposalUpsertTokenInfo() { // Query permissions for role Validator val := s.network.Validators[0] clientCtx := val.ClientCtx - cmd := cli.GetTxProposalUpsertTokenRatesCmd() + cmd := cli.GetTxProposalUpsertTokenInfoCmd() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", cli.FlagDenom, "ubtc"), - fmt.Sprintf("--%s=%f", cli.FlagRate, 0.00001), + fmt.Sprintf("--%s=%f", cli.FlagFeeRate, 0.00001), fmt.Sprintf("--%s=%s", cli.FlagTitle, "title"), fmt.Sprintf("--%s=%s", cli.FlagDescription, "some desc"), - fmt.Sprintf("--%s=%s", cli.FlagFeePayments, "true"), + fmt.Sprintf("--%s=%s", cli.FlagFeeEnabled, "true"), + fmt.Sprintf("--%s=%s", cli.FlagDecimals, "6"), + fmt.Sprintf("--%s=%s", cli.FlagStakeCap, "0.3"), + fmt.Sprintf("--%s=%s", cli.FlagTokenRate, "1"), + fmt.Sprintf("--%s=%s", cli.FlagSupply, "0"), + fmt.Sprintf("--%s=%s", cli.FlagSupplyCap, "0"), + fmt.Sprintf("--%s=%s", cli.FlagMintingFee, "1"), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), @@ -185,43 +155,6 @@ func (s IntegrationTestSuite) TestCreateProposalUpsertTokenRates() { fmt.Printf("%s", out.String()) } -func (s IntegrationTestSuite) TestCreateProposalUpsertTokenAlias() { - // Query permissions for role Validator - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - cmd := cli.GetTxProposalUpsertTokenAliasCmd() - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ - fmt.Sprintf("--%s=%s", cli.FlagSymbol, "ETH"), - fmt.Sprintf("--%s=%s", cli.FlagName, "Ethereum"), - fmt.Sprintf("--%s=%s", cli.FlagTitle, "title"), - fmt.Sprintf("--%s=%s", cli.FlagDescription, "some desc"), - fmt.Sprintf("--%s=%s", cli.FlagIcon, "myiconurl"), - fmt.Sprintf("--%s=%d", cli.FlagDecimals, 6), - fmt.Sprintf("--%s=%s", cli.FlagDenoms, "finney"), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.DefaultDenom, sdk.NewInt(100))).String()), - }) - s.Require().NoError(err) - fmt.Printf("%s", out.String()) - - // Vote Proposal - out.Reset() - cmd = customgovcli.GetTxVoteProposal() - out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ - fmt.Sprintf("%d", 1), // Proposal ID - fmt.Sprintf("%d", govtypes.OptionYes), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.DefaultDenom, sdk.NewInt(100))).String()), - }) - s.Require().NoError(err) - fmt.Printf("%s", out.String()) -} - func (s IntegrationTestSuite) TestTxProposalTokensBlackWhiteChangeCmd() { // Query permissions for role Validator val := s.network.Validators[0] @@ -259,57 +192,29 @@ func (s IntegrationTestSuite) TestTxProposalTokensBlackWhiteChangeCmd() { fmt.Printf("%s", out.String()) } -func (s *IntegrationTestSuite) TestGetCmdQueryAllTokenAliases() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - cmd := cli.GetCmdQueryAllTokenAliases() - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{}) - s.Require().NoError(err) - - var resp tokenstypes.AllTokenAliasesResponse - clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &resp) - - s.Require().Greater(len(resp.Data), 0) -} - -func (s *IntegrationTestSuite) TestGetCmdQueryTokenAliasesByDenom() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - cmd := cli.GetCmdQueryTokenAliasesByDenom() - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{"ukex", "mkex"}) - s.Require().NoError(err) - - var resp tokenstypes.TokenAliasesByDenomResponse - clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &resp) - - s.Require().Greater(len(resp.Data), 0) -} - -func (s *IntegrationTestSuite) TestGetCmdQueryAllTokenRates() { +func (s *IntegrationTestSuite) TestGetCmdQueryAllTokenInfos() { val := s.network.Validators[0] clientCtx := val.ClientCtx - cmd := cli.GetCmdQueryAllTokenRates() + cmd := cli.GetCmdQueryAllTokenInfos() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{}) s.Require().NoError(err) - var resp tokenstypes.AllTokenRatesResponse + var resp tokenstypes.AllTokenInfosResponse clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &resp) s.Require().Greater(len(resp.Data), 0) } -func (s *IntegrationTestSuite) TestGetCmdQueryTokenRatesByDenom() { +func (s *IntegrationTestSuite) TestGetCmdQueryTokenInfosByDenom() { val := s.network.Validators[0] clientCtx := val.ClientCtx - cmd := cli.GetCmdQueryTokenRatesByDenom() + cmd := cli.GetCmdQueryTokenInfosByDenom() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{"ukex"}) s.Require().NoError(err) - var resp tokenstypes.TokenRatesByDenomResponse + var resp tokenstypes.TokenInfosByDenomResponse clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &resp) s.Require().Greater(len(resp.Data), 0) diff --git a/x/tokens/client/cli/query.go b/x/tokens/client/cli/query.go index fd8abf426..5637d6d9f 100644 --- a/x/tokens/client/cli/query.go +++ b/x/tokens/client/cli/query.go @@ -20,104 +20,17 @@ func NewQueryCmd() *cobra.Command { Short: "query commands for the tokens module", } queryCmd.AddCommand( - GetCmdQueryTokenAlias(), - GetCmdQueryAllTokenAliases(), - GetCmdQueryTokenAliasesByDenom(), - GetCmdQueryTokenRate(), - GetCmdQueryAllTokenRates(), - GetCmdQueryTokenRatesByDenom(), + GetCmdQueryTokenInfo(), + GetCmdQueryAllTokenInfos(), + GetCmdQueryTokenInfosByDenom(), GetCmdQueryTokenBlackWhites(), ) return queryCmd } -// GetCmdQueryTokenAlias the query token alias command. -func GetCmdQueryTokenAlias() *cobra.Command { - cmd := &cobra.Command{ - Use: "alias ", - Short: "Get the token alias by symbol", - Args: cobra.MinimumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - params := &types.TokenAliasRequest{Symbol: args[0]} - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetTokenAlias(context.Background(), params) - if err != nil { - return err - } - - if res.Data == nil { - return fmt.Errorf("%s symbol does not exist", params.Symbol) - } - - return clientCtx.PrintProto(res.Data) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryAllTokenAliases the query all token aliases command. -func GetCmdQueryAllTokenAliases() *cobra.Command { - cmd := &cobra.Command{ - Use: "all-aliases", - Short: "Get all token aliases", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - params := &types.AllTokenAliasesRequest{} - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetAllTokenAliases(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryTokenAliasesByDenom the query token aliases by denom command. -func GetCmdQueryTokenAliasesByDenom() *cobra.Command { - cmd := &cobra.Command{ - Use: "aliases-by-denom [aliases]", - Short: "Get token aliases by denom", - Args: cobra.MinimumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - denoms := strings.Split(args[0], ",") - params := &types.TokenAliasesByDenomRequest{ - Denoms: denoms, - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetTokenAliasesByDenom(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryTokenRate the query token rate command. -func GetCmdQueryTokenRate() *cobra.Command { +// GetCmdQueryTokenInfo the query token rate command. +func GetCmdQueryTokenInfo() *cobra.Command { cmd := &cobra.Command{ Use: "rate ", Short: "Get the token rate by denom", @@ -125,10 +38,10 @@ func GetCmdQueryTokenRate() *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) - params := &types.TokenRateRequest{Denom: args[0]} + params := &types.TokenInfoRequest{Denom: args[0]} queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetTokenRate(context.Background(), params) + res, err := queryClient.GetTokenInfo(context.Background(), params) if err != nil { return err } @@ -146,18 +59,18 @@ func GetCmdQueryTokenRate() *cobra.Command { return cmd } -// GetCmdQueryAllTokenRates the query all token rates command. -func GetCmdQueryAllTokenRates() *cobra.Command { +// GetCmdQueryAllTokenInfos the query all token rates command. +func GetCmdQueryAllTokenInfos() *cobra.Command { cmd := &cobra.Command{ Use: "all-rates", Short: "Get all token rates", RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) - params := &types.AllTokenRatesRequest{} + params := &types.AllTokenInfosRequest{} queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetAllTokenRates(context.Background(), params) + res, err := queryClient.GetAllTokenInfos(context.Background(), params) if err != nil { return err } @@ -171,8 +84,8 @@ func GetCmdQueryAllTokenRates() *cobra.Command { return cmd } -// GetCmdQueryTokenRatesByDenom the query token aliases by denom command. -func GetCmdQueryTokenRatesByDenom() *cobra.Command { +// GetCmdQueryTokenInfosByDenom the query token aliases by denom command. +func GetCmdQueryTokenInfosByDenom() *cobra.Command { cmd := &cobra.Command{ Use: "rates-by-denom", Short: "Get token rates by denom", @@ -181,12 +94,12 @@ func GetCmdQueryTokenRatesByDenom() *cobra.Command { clientCtx := client.GetClientContextFromCmd(cmd) denoms := strings.Split(args[0], ",") - params := &types.TokenRatesByDenomRequest{ + params := &types.TokenInfosByDenomRequest{ Denoms: denoms, } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetTokenRatesByDenom(context.Background(), params) + res, err := queryClient.GetTokenInfosByDenom(context.Background(), params) if err != nil { return err } diff --git a/x/tokens/client/cli/tx.go b/x/tokens/client/cli/tx.go index dd0787e0b..475cfc59d 100644 --- a/x/tokens/client/cli/tx.go +++ b/x/tokens/client/cli/tx.go @@ -2,7 +2,6 @@ package cli import ( "fmt" - "strings" appparams "github.com/KiraCore/sekai/app/params" govtypes "github.com/KiraCore/sekai/x/gov/types" @@ -16,23 +15,34 @@ import ( // flags for tokens module txs const ( - FlagSymbol = "symbol" - FlagName = "name" - FlagIcon = "icon" - FlagDecimals = "decimals" - FlagDenoms = "denoms" - FlagDenom = "denom" - FlagRate = "rate" - FlagStakeCap = "stake_cap" - FlagStakeToken = "stake_token" - FlagStakeMin = "stake_min" - FlagFeePayments = "fee_payments" - FlagIsBlacklist = "is_blacklist" - FlagIsAdd = "is_add" - FlagTokens = "tokens" - FlagTitle = "title" - FlagDescription = "description" - FlagInvalidated = "invalidated" + FlagSymbol = "symbol" + FlagName = "name" + FlagIcon = "icon" + FlagDecimals = "decimals" + FlagDenoms = "denoms" + FlagDenom = "denom" + FlagFeeRate = "fee_rate" + FlagStakeCap = "stake_cap" + FlagStakeToken = "stake_token" + FlagStakeMin = "stake_min" + FlagFeeEnabled = "fee_payments" + FlagIsBlacklist = "is_blacklist" + FlagIsAdd = "is_add" + FlagTokens = "tokens" + FlagTitle = "title" + FlagDescription = "description" + FlagInvalidated = "invalidated" + FlagSupply = "supply" + FlagSupplyCap = "supply_cap" + FlagWebsite = "website" + FlagSocial = "social" + FlagMintingFee = "minting_fee" + FlagOwner = "owner" + FlagOwnerEditDisabled = "owner_edit_disabled" + FlagNftMetadata = "nft_metadata" + FlagNftHash = "nft_hash" + FlagTokenType = "token_type" + FlagTokenRate = "token_rate" ) // NewTxCmd returns a root CLI command handler for all x/bank transaction commands. @@ -46,129 +56,71 @@ func NewTxCmd() *cobra.Command { } txCmd.AddCommand( - GetTxUpsertTokenAliasCmd(), - GetTxUpsertTokenRateCmd(), - GetTxProposalUpsertTokenAliasCmd(), - GetTxProposalUpsertTokenRatesCmd(), + GetTxUpsertTokenInfoCmd(), + GetTxProposalUpsertTokenInfoCmd(), GetTxProposalTokensBlackWhiteChangeCmd(), ) return txCmd } -// GetTxUpsertTokenAliasCmd implement cli command for MsgUpsertTokenAlias -func GetTxUpsertTokenAliasCmd() *cobra.Command { +// GetTxProposalUpsertTokenInfoCmd implement cli command for MsgUpsertTokenInfos +func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "upsert-alias", - Short: "Upsert token alias", + Use: "proposal-upsert-rate", + Short: "Create a proposal to upsert token rate", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) - - symbol, err := cmd.Flags().GetString(FlagSymbol) if err != nil { - return fmt.Errorf("invalid symbol") + return fmt.Errorf("invalid is_blacklist flag: %w", err) } - name, err := cmd.Flags().GetString(FlagName) + denom, err := cmd.Flags().GetString(FlagDenom) if err != nil { - return fmt.Errorf("invalid name") + return fmt.Errorf("invalid denom") } - - icon, err := cmd.Flags().GetString(FlagIcon) - if err != nil { - return fmt.Errorf("invalid icon") + if denom == appparams.DefaultDenom { + return fmt.Errorf("bond denom rate is read-only") } - decimals, err := cmd.Flags().GetUint32(FlagDecimals) + tokenType, err := cmd.Flags().GetString(FlagTokenType) if err != nil { - return fmt.Errorf("invalid decimals") + return fmt.Errorf("invalid tokenType") } - denomsString, err := cmd.Flags().GetString(FlagDenoms) + rateString, err := cmd.Flags().GetString(FlagTokenRate) if err != nil { - return fmt.Errorf("invalid denoms") - } - - denoms := strings.Split(denomsString, ",") - for _, denom := range denoms { - if err = sdk.ValidateDenom(denom); err != nil { - return err - } + return fmt.Errorf("invalid rate") } - isInvalidated, err := cmd.Flags().GetBool(FlagInvalidated) - if err != nil { - return fmt.Errorf("invalid invalidated flag: %w", err) - } - - msg := types.NewMsgUpsertTokenAlias( - clientCtx.FromAddress, - symbol, - name, - icon, - decimals, - denoms, - isInvalidated, - ) - - err = msg.ValidateBasic() + feeRate, err := sdk.NewDecFromStr(rateString) if err != nil { return err } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(FlagSymbol, "KEX", "Ticker (eg. ATOM, KEX, BTC)") - cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") - cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") - cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") - cmd.Flags().String(FlagDenoms, "ukex,mkex", "An array of token denoms to be aliased") - cmd.Flags().Bool(FlagInvalidated, false, "Flag to show token alias is invalidated or not") - - flags.AddTxFlagsToCmd(cmd) - _ = cmd.MarkFlagRequired(flags.FlagFrom) - - return cmd -} - -// GetTxProposalUpsertTokenAliasCmd implement cli command for MsgUpsertTokenAlias -func GetTxProposalUpsertTokenAliasCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "proposal-upsert-alias", - Short: "Create a proposal to upsert token alias", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - - symbol, err := cmd.Flags().GetString(FlagSymbol) + feeEnabled, err := cmd.Flags().GetBool(FlagFeeEnabled) if err != nil { - return fmt.Errorf("invalid symbol: %w", err) + return fmt.Errorf("invalid fee enabled flag") } - name, err := cmd.Flags().GetString(FlagName) + supplyString, err := cmd.Flags().GetString(FlagSupply) if err != nil { - return fmt.Errorf("invalid name: %w", err) + return fmt.Errorf("invalid supply: %w", err) } - icon, err := cmd.Flags().GetString(FlagIcon) - if err != nil { - return fmt.Errorf("invalid icon: %w", err) - } - - decimals, err := cmd.Flags().GetUint32(FlagDecimals) - if err != nil { - return fmt.Errorf("invalid decimals: %w", err) + supply, ok := sdk.NewIntFromString(supplyString) + if !ok { + return fmt.Errorf("invalid supply: %s", supplyString) } - denoms, err := cmd.Flags().GetString(FlagDenoms) + supplyCapString, err := cmd.Flags().GetString(FlagSupplyCap) if err != nil { - return fmt.Errorf("invalid denoms: %w", err) + return fmt.Errorf("invalid supply cap: %w", err) } - isInvalidated, err := cmd.Flags().GetBool(FlagInvalidated) - if err != nil { - return fmt.Errorf("invalid invalidated flag: %w", err) + supplyCap, ok := sdk.NewIntFromString(supplyCapString) + if !ok { + return fmt.Errorf("invalid supply cap: %s", supplyCapString) } title, err := cmd.Flags().GetString(FlagTitle) @@ -181,89 +133,44 @@ func GetTxProposalUpsertTokenAliasCmd() *cobra.Command { return fmt.Errorf("invalid description: %w", err) } - msg, err := govtypes.NewMsgSubmitProposal( - clientCtx.FromAddress, - title, - description, - types.NewUpsertTokenAliasProposal( - symbol, - name, - icon, - decimals, - strings.Split(denoms, ","), - isInvalidated, - ), - ) + website, err := cmd.Flags().GetString(FlagWebsite) if err != nil { - return err + return fmt.Errorf("invalid website: %w", err) } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(FlagSymbol, "KEX", "Ticker (eg. ATOM, KEX, BTC)") - cmd.MarkFlagRequired(FlagSymbol) - cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") - cmd.MarkFlagRequired(FlagName) - cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") - cmd.MarkFlagRequired(FlagIcon) - cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") - cmd.MarkFlagRequired(FlagDecimals) - cmd.Flags().String(FlagDenoms, "ukex,mkex", "An array of token denoms to be aliased") - cmd.MarkFlagRequired(FlagDenoms) - cmd.Flags().Bool(FlagInvalidated, false, "Flag to show token alias is invalidated or not") - - cmd.Flags().String(FlagTitle, "", "The title of the proposal.") - cmd.MarkFlagRequired(FlagTitle) - cmd.Flags().String(FlagDescription, "", "The description of the proposal, it can be a url, some text, etc.") - cmd.MarkFlagRequired(FlagDescription) - - flags.AddTxFlagsToCmd(cmd) - _ = cmd.MarkFlagRequired(flags.FlagFrom) - - return cmd -} - -// GetTxProposalUpsertTokenRatesCmd implement cli command for MsgUpsertTokenAlias -func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "proposal-upsert-rate", - Short: "Create a proposal to upsert token rate", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - - denom, err := cmd.Flags().GetString(FlagDenom) + social, err := cmd.Flags().GetString(FlagSocial) if err != nil { - return fmt.Errorf("invalid denom") - } - if denom == appparams.DefaultDenom { - return fmt.Errorf("bond denom rate is read-only") + return fmt.Errorf("invalid social: %w", err) } - rateString, err := cmd.Flags().GetString(FlagRate) + mintingFeeStr, err := cmd.Flags().GetString(FlagMintingFee) if err != nil { - return fmt.Errorf("invalid rate") + return fmt.Errorf("invalid mintingFee: %w", err) + } + + mintingFee, ok := sdk.NewIntFromString(mintingFeeStr) + if !ok { + return fmt.Errorf("invalid minting fee: %s", mintingFeeStr) } - rate, err := sdk.NewDecFromStr(rateString) + owner, err := cmd.Flags().GetString(FlagOwner) if err != nil { - return err + return fmt.Errorf("invalid owner: %w", err) } - feePayments, err := cmd.Flags().GetBool(FlagFeePayments) + ownerEditDisabled, err := cmd.Flags().GetBool(FlagOwnerEditDisabled) if err != nil { - return fmt.Errorf("invalid fee payments") + return fmt.Errorf("invalid ownerEditDisabled: %w", err) } - title, err := cmd.Flags().GetString(FlagTitle) + nftMetadata, err := cmd.Flags().GetString(FlagNftMetadata) if err != nil { - return fmt.Errorf("invalid title: %w", err) + return fmt.Errorf("invalid nftMetadata: %w", err) } - description, err := cmd.Flags().GetString(FlagDescription) + nftHash, err := cmd.Flags().GetString(FlagNftHash) if err != nil { - return fmt.Errorf("invalid description: %w", err) + return fmt.Errorf("invalid nftHash: %w", err) } stakeToken, err := cmd.Flags().GetBool(FlagStakeToken) @@ -296,18 +203,54 @@ func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { return fmt.Errorf("invalid invalidated flag: %w", err) } + symbol, err := cmd.Flags().GetString(FlagSymbol) + if err != nil { + return fmt.Errorf("invalid symbol") + } + + name, err := cmd.Flags().GetString(FlagName) + if err != nil { + return fmt.Errorf("invalid name") + } + + icon, err := cmd.Flags().GetString(FlagIcon) + if err != nil { + return fmt.Errorf("invalid icon") + } + + decimals, err := cmd.Flags().GetUint32(FlagDecimals) + if err != nil { + return fmt.Errorf("invalid decimals") + } + msg, err := govtypes.NewMsgSubmitProposal( clientCtx.FromAddress, title, description, - types.NewUpsertTokenRatesProposal( + types.NewUpsertTokenInfosProposal( denom, - rate, - feePayments, + tokenType, + feeRate, + feeEnabled, + supply, + supplyCap, stakeCap, stakeMin, stakeToken, isInvalidated, + symbol, + name, + icon, + decimals, + description, + website, + social, + 0, + mintingFee, + owner, + ownerEditDisabled, + nftMetadata, + nftHash, ), ) if err != nil { @@ -325,10 +268,10 @@ func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { cmd.Flags().String(FlagDenom, "tbtc", "denom - identifier for token rates") cmd.MarkFlagRequired(FlagDenom) - cmd.Flags().String(FlagRate, "1.0", "rate to register, max decimal 9, max value 10^10") - cmd.MarkFlagRequired(FlagRate) - cmd.Flags().Bool(FlagFeePayments, true, "use registry as fee payment") - cmd.MarkFlagRequired(FlagFeePayments) + cmd.Flags().String(FlagFeeRate, "1.0", "rate to register, max decimal 9, max value 10^10") + cmd.MarkFlagRequired(FlagFeeRate) + cmd.Flags().Bool(FlagFeeEnabled, true, "use registry as fee payment") + cmd.MarkFlagRequired(FlagFeeEnabled) cmd.Flags().String(FlagTitle, "", "The title of a proposal.") cmd.MarkFlagRequired(FlagTitle) cmd.Flags().String(FlagDescription, "", "The description of the proposal, it can be a url, some text, etc.") @@ -337,6 +280,21 @@ func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { cmd.Flags().String(FlagStakeMin, "1", "min amount to stake at a time.") cmd.Flags().Bool(FlagStakeToken, false, "flag of if staking token or not.") cmd.Flags().Bool(FlagInvalidated, false, "Flag to show token rate is invalidated or not") + cmd.Flags().String(FlagSymbol, "KEX", "Ticker (eg. ATOM, KEX, BTC)") + cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") + cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") + cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") + cmd.Flags().String(FlagSupply, "", "Supply of token") + cmd.Flags().String(FlagSupplyCap, "", "Supply cap of token") + cmd.Flags().String(FlagWebsite, "", "Website") + cmd.Flags().String(FlagSocial, "", "Social") + cmd.Flags().String(FlagMintingFee, "", "Minting fee") + cmd.Flags().String(FlagOwner, "", "Owner") + cmd.Flags().Bool(FlagOwnerEditDisabled, false, "Owner edit disabled flag") + cmd.Flags().String(FlagNftMetadata, "", "Nft metadata") + cmd.Flags().String(FlagNftHash, "", "Nft hash") + cmd.Flags().String(FlagTokenType, "", "Token type") + cmd.Flags().String(FlagTokenRate, "", "Token rate") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) @@ -344,13 +302,16 @@ func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { return cmd } -// GetTxUpsertTokenRateCmd implement cli command for MsgUpsertTokenRate -func GetTxUpsertTokenRateCmd() *cobra.Command { +// GetTxUpsertTokenInfoCmd implement cli command for MsgUpsertTokenInfo +func GetTxUpsertTokenInfoCmd() *cobra.Command { cmd := &cobra.Command{ Use: "upsert-rate", Short: "Upsert token rate", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } denom, err := cmd.Flags().GetString(FlagDenom) if err != nil { @@ -360,21 +321,46 @@ func GetTxUpsertTokenRateCmd() *cobra.Command { return fmt.Errorf("bond denom rate is read-only") } - rateString, err := cmd.Flags().GetString(FlagRate) + tokenType, err := cmd.Flags().GetString(FlagTokenType) + if err != nil { + return fmt.Errorf("invalid tokenType") + } + + rateString, err := cmd.Flags().GetString(FlagFeeRate) if err != nil { return fmt.Errorf("invalid rate") } - rate, err := sdk.NewDecFromStr(rateString) + feeRate, err := sdk.NewDecFromStr(rateString) if err != nil { return err } - feePayments, err := cmd.Flags().GetBool(FlagFeePayments) + feeEnabled, err := cmd.Flags().GetBool(FlagFeeEnabled) if err != nil { return fmt.Errorf("invalid fee payments") } + supplyString, err := cmd.Flags().GetString(FlagSupply) + if err != nil { + return fmt.Errorf("invalid supply: %w", err) + } + + supply, ok := sdk.NewIntFromString(supplyString) + if !ok { + return fmt.Errorf("invalid supply: %s", supplyString) + } + + supplyCapString, err := cmd.Flags().GetString(FlagSupplyCap) + if err != nil { + return fmt.Errorf("invalid supply cap: %w", err) + } + + supplyCap, ok := sdk.NewIntFromString(supplyCapString) + if !ok { + return fmt.Errorf("invalid supply cap: %s", supplyCapString) + } + stakeToken, err := cmd.Flags().GetBool(FlagStakeToken) if err != nil { return fmt.Errorf("invalid stake token flag") @@ -405,15 +391,96 @@ func GetTxUpsertTokenRateCmd() *cobra.Command { return fmt.Errorf("invalid invalidated flag: %w", err) } - msg := types.NewMsgUpsertTokenRate( + symbol, err := cmd.Flags().GetString(FlagSymbol) + if err != nil { + return fmt.Errorf("invalid symbol") + } + + name, err := cmd.Flags().GetString(FlagName) + if err != nil { + return fmt.Errorf("invalid name") + } + + icon, err := cmd.Flags().GetString(FlagIcon) + if err != nil { + return fmt.Errorf("invalid icon") + } + + decimals, err := cmd.Flags().GetUint32(FlagDecimals) + if err != nil { + return fmt.Errorf("invalid decimals") + } + + description, err := cmd.Flags().GetString(FlagDescription) + if err != nil { + return fmt.Errorf("invalid description: %w", err) + } + + website, err := cmd.Flags().GetString(FlagWebsite) + if err != nil { + return fmt.Errorf("invalid website: %w", err) + } + + social, err := cmd.Flags().GetString(FlagSocial) + if err != nil { + return fmt.Errorf("invalid social: %w", err) + } + + mintingFeeStr, err := cmd.Flags().GetString(FlagMintingFee) + if err != nil { + return fmt.Errorf("invalid mintingFee: %w", err) + } + + mintingFee, ok := sdk.NewIntFromString(mintingFeeStr) + if !ok { + return fmt.Errorf("invalid minting fee: %s", mintingFeeStr) + } + + owner, err := cmd.Flags().GetString(FlagOwner) + if err != nil { + return fmt.Errorf("invalid owner: %w", err) + } + + ownerEditDisabled, err := cmd.Flags().GetBool(FlagOwnerEditDisabled) + if err != nil { + return fmt.Errorf("invalid ownerEditDisabled: %w", err) + } + + nftMetadata, err := cmd.Flags().GetString(FlagNftMetadata) + if err != nil { + return fmt.Errorf("invalid nftMetadata: %w", err) + } + + nftHash, err := cmd.Flags().GetString(FlagNftHash) + if err != nil { + return fmt.Errorf("invalid nftHash: %w", err) + } + + msg := types.NewMsgUpsertTokenInfo( clientCtx.FromAddress, denom, - rate, - feePayments, + tokenType, + feeRate, + feeEnabled, + supply, + supplyCap, stakeCap, stakeMin, stakeToken, isInvalidated, + symbol, + name, + icon, + decimals, + description, + website, + social, + 0, + mintingFee, + owner, + ownerEditDisabled, + nftMetadata, + nftHash, ) err = msg.ValidateBasic() @@ -427,14 +494,30 @@ func GetTxUpsertTokenRateCmd() *cobra.Command { cmd.Flags().String(FlagDenom, "tbtc", "denom - identifier for token rates") cmd.MarkFlagRequired(FlagDenom) - cmd.Flags().String(FlagRate, "1.0", "rate to register, max decimal 9, max value 10^10") - cmd.MarkFlagRequired(FlagRate) - cmd.Flags().Bool(FlagFeePayments, true, "use registry as fee payment") - cmd.MarkFlagRequired(FlagFeePayments) + cmd.Flags().String(FlagFeeRate, "1.0", "rate to register, max decimal 9, max value 10^10") + cmd.MarkFlagRequired(FlagFeeRate) + cmd.Flags().Bool(FlagFeeEnabled, true, "use registry as fee payment") + cmd.MarkFlagRequired(FlagFeeEnabled) cmd.Flags().String(FlagStakeCap, "0.1", "rewards to be allocated for the token.") cmd.Flags().String(FlagStakeMin, "1", "min amount to stake at a time.") cmd.Flags().Bool(FlagStakeToken, false, "flag of if staking token or not.") cmd.Flags().Bool(FlagInvalidated, false, "Flag to show token rate is invalidated or not") + cmd.Flags().String(FlagSymbol, "KEX", "Ticker (eg. ATOM, KEX, BTC)") + cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") + cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") + cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") + cmd.Flags().String(FlagSupply, "", "Supply of token") + cmd.Flags().String(FlagSupplyCap, "", "Supply cap of token") + cmd.Flags().String(FlagWebsite, "", "Website") + cmd.Flags().String(FlagSocial, "", "Social") + cmd.Flags().String(FlagMintingFee, "", "Minting fee") + cmd.Flags().String(FlagOwner, "", "Owner") + cmd.Flags().Bool(FlagOwnerEditDisabled, false, "Owner edit disabled flag") + cmd.Flags().String(FlagNftMetadata, "", "Nft metadata") + cmd.Flags().String(FlagNftHash, "", "Nft hash") + cmd.Flags().String(FlagTokenType, "", "Token type") + cmd.Flags().String(FlagDescription, "", "Token description") + cmd.Flags().String(FlagTokenRate, "", "Token rate") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) @@ -449,6 +532,9 @@ func GetTxProposalTokensBlackWhiteChangeCmd() *cobra.Command { Short: "Create a proposal to update whitelisted and blacklisted tokens", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } isBlacklist, err := cmd.Flags().GetBool(FlagIsBlacklist) if err != nil { diff --git a/x/tokens/handler.go b/x/tokens/handler.go index d3e6c20ad..779e72f1b 100644 --- a/x/tokens/handler.go +++ b/x/tokens/handler.go @@ -15,12 +15,8 @@ func NewHandler(ck keeper.Keeper, cgk types.CustomGovKeeper) sdk.Handler { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - case *types.MsgUpsertTokenAlias: - res, err := msgServer.UpsertTokenAlias(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgUpsertTokenRate: - res, err := msgServer.UpsertTokenRate(sdk.WrapSDKContext(ctx), msg) + case *types.MsgUpsertTokenInfo: + res, err := msgServer.UpsertTokenInfo(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) default: diff --git a/x/tokens/handler_test.go b/x/tokens/handler_test.go index b1e294c5a..1339f5f11 100644 --- a/x/tokens/handler_test.go +++ b/x/tokens/handler_test.go @@ -4,10 +4,10 @@ import ( "bytes" "os" "strconv" - "strings" "testing" "time" + "cosmossdk.io/math" simapp "github.com/KiraCore/sekai/app" appparams "github.com/KiraCore/sekai/app/params" "github.com/KiraCore/sekai/x/gov" @@ -51,151 +51,107 @@ func setPermissionToAddr(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context, ad return nil } -func TestNewHandler_MsgUpsertTokenAlias(t *testing.T) { +func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) handler := tokens.NewHandler(app.TokensKeeper, app.CustomGovKeeper) tests := []struct { name string - constructor func(sdk.AccAddress) (*tokenstypes.MsgUpsertTokenAlias, error) + constructor func(sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) handlerErr string }{ { name: "good permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenAlias, error) { - err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenAlias) + constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenInfo) require.NoError(t, err) - return tokenstypes.NewMsgUpsertTokenAlias( - addr, - "ETH", - "Ethereum", - "icon", - 6, - []string{"finney"}, - false, - ), nil - }, - }, - { - name: "lack permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenAlias, error) { - return tokenstypes.NewMsgUpsertTokenAlias( - addr, - "ETH", - "Ethereum", - "icon", - 6, - []string{"finney"}, - false, - ), nil - }, - handlerErr: "PERMISSION_UPSERT_TOKEN_ALIAS: not enough permissions", - }, - } - for i, tt := range tests { - addr := NewAccountByIndex(i) - theMsg, err := tt.constructor(addr) - require.NoError(t, err) - - _, err = handler(ctx, theMsg) - if len(tt.handlerErr) != 0 { - require.Error(t, err) - require.Contains(t, err.Error(), tt.handlerErr) - } else { - require.NoError(t, err) - - // test various query commands - alias := app.TokensKeeper.GetTokenAlias(ctx, theMsg.Symbol) - require.True(t, alias != nil) - aliasesAll := app.TokensKeeper.ListTokenAlias(ctx) - require.True(t, len(aliasesAll) > 0) - aliasesByDenom := app.TokensKeeper.GetTokenAliasesByDenom(ctx, theMsg.Denoms) - require.True(t, aliasesByDenom[theMsg.Denoms[0]] != nil) - - // try different alias for same denom - theMsg.Symbol += "V2" - _, err = handler(ctx, theMsg) - require.Error(t, err) - require.True(t, strings.Contains(err.Error(), "denom is already registered")) - } - } -} - -func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { - - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - handler := tokens.NewHandler(app.TokensKeeper, app.CustomGovKeeper) - - tests := []struct { - name string - constructor func(sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) - handlerErr string - }{ - { - name: "good permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) { - err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenRate) - require.NoError(t, err) - return tokenstypes.NewMsgUpsertTokenRate( + return tokenstypes.NewMsgUpsertTokenInfo( addr, + "adr20", "finney", sdk.NewDecWithPrec(1, 3), // 0.001 true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, }, { name: "lack permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) { - return tokenstypes.NewMsgUpsertTokenRate( + constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + return tokenstypes.NewMsgUpsertTokenInfo( addr, + "adr20", "finney", sdk.NewDecWithPrec(1, 3), // 0.001 true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, handlerErr: "PERMISSION_UPSERT_TOKEN_RATE: not enough permissions", }, { name: "negative rate value test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) { - return tokenstypes.NewMsgUpsertTokenRate( + constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + return tokenstypes.NewMsgUpsertTokenInfo( addr, + "adr20", "finney", sdk.NewDec(-1), // -1 true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, handlerErr: "rate should be positive", }, - { - name: "bond denom rate change test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) { - err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenRate) - require.NoError(t, err) - return tokenstypes.NewMsgUpsertTokenRate( - addr, - "ukex", sdk.NewDec(10), - true, - sdk.ZeroDec(), - sdk.ZeroInt(), - false, - false, - ), nil - }, - handlerErr: "bond denom rate is read-only", - }, + // { + // name: "bond denom rate change test", + // constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + // err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenInfo) + // require.NoError(t, err) + // return tokenstypes.NewMsgUpsertTokenInfo( + // addr, + // "adr20", + // "ukex", sdk.NewDec(10), + // true, + // sdk.ZeroInt(), sdk.ZeroInt(), + // sdk.ZeroDec(), + // sdk.ZeroInt(), + // false, + // false, + // "ETH", + // "Ethereum", + // "icon", + // 6, + // "", "", "", 0, math.ZeroInt(), "", false, "", "", + // ), nil + // }, + // handlerErr: "bond denom rate is read-only", + // }, } for i, tt := range tests { addr := NewAccountByIndex(i) @@ -210,139 +166,17 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { require.NoError(t, err) // test various query commands - rate := app.TokensKeeper.GetTokenRate(ctx, theMsg.Denom) + rate := app.TokensKeeper.GetTokenInfo(ctx, theMsg.Denom) require.True(t, rate != nil) - ratesAll := app.TokensKeeper.GetAllTokenRates(ctx) + ratesAll := app.TokensKeeper.GetAllTokenInfos(ctx) require.True(t, len(ratesAll) > 0) - ratesByDenom := app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{theMsg.Denom}) - require.True(t, ratesByDenom[theMsg.Denom] != nil) + ratesByDenom := app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{theMsg.Denom}) + require.True(t, ratesByDenom[theMsg.Denom].Data != nil) } } } -func TestHandler_CreateProposalUpsertTokenAliases_Errors(t *testing.T) { - proposerAddr, err := sdk.AccAddressFromBech32("kira1alzyfq40zjsveat87jlg8jxetwqmr0a29sgd0f") - require.NoError(t, err) - - tests := []struct { - name string - content govtypes.Content - preparePerms func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context) - expectedErr error - }{ - { - "Proposer does not have Perm", - tokenstypes.NewUpsertTokenAliasProposal( - "BTC", - "Bitcoin", - "http://theicon.com", - 18, - []string{}, - false, - ), - func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context) {}, - errors.Wrap(types.ErrNotEnoughPermissions, types.PermCreateUpsertTokenAliasProposal.String()), - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - - tt.preparePerms(t, app, ctx) - - handler := gov.NewHandler(app.CustomGovKeeper) - msg, err := govtypes.NewMsgSubmitProposal(proposerAddr, "title", "some desc", tt.content) - require.NoError(t, err) - _, err = handler(ctx, msg) - require.EqualError(t, err, tt.expectedErr.Error()) - }) - } -} - -func TestHandler_CreateProposalUpsertTokenAliases(t *testing.T) { - proposerAddr, err := sdk.AccAddressFromBech32("kira1alzyfq40zjsveat87jlg8jxetwqmr0a29sgd0f") - require.NoError(t, err) - - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{ - Time: time.Now(), - }) - - // Set proposer Permissions - proposerActor := types.NewDefaultActor(proposerAddr) - err2 := app.CustomGovKeeper.AddWhitelistPermission(ctx, proposerActor, types.PermCreateUpsertTokenAliasProposal) - require.NoError(t, err2) - - properties := app.CustomGovKeeper.GetNetworkProperties(ctx) - properties.MinimumProposalEndTime = 10 - app.CustomGovKeeper.SetNetworkProperties(ctx, properties) - - handler := gov.NewHandler(app.CustomGovKeeper) - proposal := tokenstypes.NewUpsertTokenAliasProposal( - "BTC", - "Bitcoin", - "http://sdlkfjalsdk.es", - 18, - []string{ - "atom", - }, - false, - ) - msg, err := govtypes.NewMsgSubmitProposal(proposerAddr, "title", "some desc", proposal) - require.NoError(t, err) - res, err := handler( - ctx, - msg, - ) - require.NoError(t, err) - expData, _ := proto.Marshal(&govtypes.MsgSubmitProposalResponse{ProposalID: 1}) - require.Equal(t, expData, res.Data) - - savedProposal, found := app.CustomGovKeeper.GetProposal(ctx, 1) - require.True(t, found) - - expectedSavedProposal, err := types.NewProposal( - 1, - "title", - "some desc", - tokenstypes.NewUpsertTokenAliasProposal( - "BTC", - "Bitcoin", - "http://sdlkfjalsdk.es", - 18, - []string{ - "atom", - }, - false, - ), - ctx.BlockTime(), - ctx.BlockTime().Add(time.Second*time.Duration(properties.MinimumProposalEndTime)), - ctx.BlockTime().Add(time.Second*time.Duration(properties.MinimumProposalEndTime)+ - time.Second*time.Duration(properties.ProposalEnactmentTime), - ), - ctx.BlockHeight()+2, - ctx.BlockHeight()+3, - ) - require.NoError(t, err) - require.Equal(t, expectedSavedProposal, savedProposal) - - // Next proposal ID is increased. - id := app.CustomGovKeeper.GetNextProposalID(ctx) - require.Equal(t, uint64(2), id) - - // Is not on finished active proposals. - iterator := app.CustomGovKeeper.GetActiveProposalsWithFinishedVotingEndTimeIterator(ctx, ctx.BlockTime()) - require.False(t, iterator.Valid()) - - ctx = ctx.WithBlockTime(ctx.BlockTime().Add(time.Minute * 10)) - iterator = app.CustomGovKeeper.GetActiveProposalsWithFinishedVotingEndTimeIterator(ctx, ctx.BlockTime()) - require.True(t, iterator.Valid()) -} - -func TestHandler_CreateProposalUpsertTokenRates_Errors(t *testing.T) { +func TestHandler_CreateProposalUpsertTokenInfo_Errors(t *testing.T) { proposerAddr, err := sdk.AccAddressFromBech32("kira1alzyfq40zjsveat87jlg8jxetwqmr0a29sgd0f") require.NoError(t, err) @@ -354,17 +188,21 @@ func TestHandler_CreateProposalUpsertTokenRates_Errors(t *testing.T) { }{ { "Proposer does not have Perm", - tokenstypes.NewUpsertTokenRatesProposal( + tokenstypes.NewUpsertTokenInfosProposal( "btc", + "adr20", sdk.NewDec(1234), false, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "BTC", "Bitcoin", "", 9, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context) {}, - errors.Wrap(types.ErrNotEnoughPermissions, types.PermCreateUpsertTokenRateProposal.String()), + errors.Wrap(types.ErrNotEnoughPermissions, types.PermCreateUpsertTokenInfoProposal.String()), }, } @@ -385,7 +223,7 @@ func TestHandler_CreateProposalUpsertTokenRates_Errors(t *testing.T) { } } -func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { +func TestHandler_CreateProposalUpsertTokenInfo(t *testing.T) { proposerAddr, err := sdk.AccAddressFromBech32("kira1alzyfq40zjsveat87jlg8jxetwqmr0a29sgd0f") require.NoError(t, err) @@ -396,7 +234,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { // Set proposer Permissions proposerActor := types.NewDefaultActor(proposerAddr) - err2 := app.CustomGovKeeper.AddWhitelistPermission(ctx, proposerActor, types.PermCreateUpsertTokenRateProposal) + err2 := app.CustomGovKeeper.AddWhitelistPermission(ctx, proposerActor, types.PermCreateUpsertTokenInfoProposal) require.NoError(t, err2) properties := app.CustomGovKeeper.GetNetworkProperties(ctx) @@ -404,14 +242,18 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { app.CustomGovKeeper.SetNetworkProperties(ctx, properties) handler := gov.NewHandler(app.CustomGovKeeper) - proposal := tokenstypes.NewUpsertTokenRatesProposal( + proposal := tokenstypes.NewUpsertTokenInfosProposal( "btc", + "adr20", sdk.NewDec(1234), false, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "BTC", "Bitcoin", "", 9, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) msg, err := govtypes.NewMsgSubmitProposal(proposerAddr, "title", "some desc", proposal) require.NoError(t, err) @@ -430,14 +272,18 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { 1, "title", "some desc", - tokenstypes.NewUpsertTokenRatesProposal( + tokenstypes.NewUpsertTokenInfosProposal( "btc", + "adr20", sdk.NewDec(1234), false, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "BTC", "Bitcoin", "", 9, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), ctx.BlockTime(), ctx.BlockTime().Add(time.Second*time.Duration(properties.MinimumProposalEndTime)), diff --git a/x/tokens/keeper/alias.go b/x/tokens/keeper/alias.go deleted file mode 100644 index 064c981d9..000000000 --- a/x/tokens/keeper/alias.go +++ /dev/null @@ -1,106 +0,0 @@ -package keeper - -import ( - "fmt" - "strings" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/KiraCore/sekai/x/tokens/types" -) - -// GetTokenAlias returns a token alias -func (k Keeper) GetTokenAlias(ctx sdk.Context, symbol string) *types.TokenAlias { - prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), PrefixKeyTokenAlias) - bz := prefixStore.Get([]byte(symbol)) - if bz == nil { - return nil - } - - alias := new(types.TokenAlias) - k.cdc.MustUnmarshal(bz, alias) - - return alias -} - -// ListTokenAlias returns all list of token alias -func (k Keeper) ListTokenAlias(ctx sdk.Context) []*types.TokenAlias { - var tokenAliases []*types.TokenAlias - - // get iterator for token aliases - store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenAlias) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - symbol := strings.TrimPrefix(string(iterator.Key()), string(PrefixKeyTokenAlias)) - tokenAlias := k.GetTokenAlias(ctx, symbol) - if tokenAlias != nil { - tokenAliases = append(tokenAliases, tokenAlias) - } - } - return tokenAliases -} - -// GetTokenAliasesByDenom returns all list of token alias -func (k Keeper) GetTokenAliasesByDenom(ctx sdk.Context, denoms []string) map[string]*types.TokenAlias { - // get iterator for token aliases - store := ctx.KVStore(k.storeKey) - tokenAliasesMap := make(map[string]*types.TokenAlias) - - for _, denom := range denoms { - denomTokenStoreID := append([]byte(PrefixKeyDenomToken), []byte(denom)...) - - if store.Has(denomTokenStoreID) { - symbol := string(store.Get(denomTokenStoreID)) - tokenAlias := k.GetTokenAlias(ctx, symbol) - tokenAliasesMap[denom] = tokenAlias - } - } - return tokenAliasesMap -} - -// UpsertTokenAlias upsert a token alias to the registry -func (k Keeper) UpsertTokenAlias(ctx sdk.Context, alias types.TokenAlias) error { - store := ctx.KVStore(k.storeKey) - // we use symbol of TokenAlias as an ID inside KVStore storage - tokenAliasStoreID := append([]byte(PrefixKeyTokenAlias), []byte(alias.Symbol)...) - - for _, denom := range alias.Denoms { - denomTokenStoreID := append([]byte(PrefixKeyDenomToken), []byte(denom)...) - - if store.Has(denomTokenStoreID) { - symbol := string(store.Get(denomTokenStoreID)) - if symbol != alias.Symbol { - return fmt.Errorf("%s denom is already registered for %s token alias", denom, symbol) - } - } - store.Set(denomTokenStoreID, []byte(alias.Symbol)) - } - store.Set(tokenAliasStoreID, k.cdc.MustMarshal(&alias)) - return nil -} - -// DeleteTokenAlias delete token alias by symbol -func (k Keeper) DeleteTokenAlias(ctx sdk.Context, symbol string) error { - store := ctx.KVStore(k.storeKey) - // we use symbol of TokenAlias as an ID inside KVStore storage - tokenAliasStoreID := append([]byte(PrefixKeyTokenAlias), []byte(symbol)...) - - if !store.Has(tokenAliasStoreID) { - return fmt.Errorf("no alias is available for %s symbol", symbol) - } - - var alias types.TokenAlias - bz := store.Get(tokenAliasStoreID) - k.cdc.MustUnmarshal(bz, &alias) - - for _, denom := range alias.Denoms { - denomTokenStoreID := append([]byte(PrefixKeyDenomToken), []byte(denom)...) - store.Delete(denomTokenStoreID) - } - - store.Delete(tokenAliasStoreID) - return nil -} diff --git a/x/tokens/keeper/alias_test.go b/x/tokens/keeper/alias_test.go deleted file mode 100644 index f98161810..000000000 --- a/x/tokens/keeper/alias_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package keeper_test - -import ( - "github.com/KiraCore/sekai/x/tokens/types" -) - -func (suite *KeeperTestSuite) TestTokenAlias() { - suite.SetupTest() - ctx := suite.ctx - - // check initial token alias before registration - alias := suite.app.TokensKeeper.GetTokenAlias(ctx, "stake") - suite.Require().Nil(alias) - aliases := suite.app.TokensKeeper.ListTokenAlias(ctx) - suite.Require().Len(aliases, 1) - aliasMap := suite.app.TokensKeeper.GetTokenAliasesByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(aliasMap), 0) - suite.Require().Nil(aliasMap["stake"]) - - // upsert token alias and check - newAlias := types.TokenAlias{ - Symbol: "stake", - Name: "test token", - Icon: "icon_link", - Decimals: 6, - Denoms: []string{"stake"}, - } - suite.app.TokensKeeper.UpsertTokenAlias(ctx, newAlias) - alias = suite.app.TokensKeeper.GetTokenAlias(ctx, "stake") - suite.Require().NotNil(alias) - aliases = suite.app.TokensKeeper.ListTokenAlias(ctx) - suite.Require().Len(aliases, 2) - aliasMap = suite.app.TokensKeeper.GetTokenAliasesByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(aliasMap), 1) - suite.Require().NotNil(aliasMap["stake"]) - - // delete token alias and check - suite.app.TokensKeeper.DeleteTokenAlias(ctx, "stake") - alias = suite.app.TokensKeeper.GetTokenAlias(ctx, "stake") - suite.Require().Nil(alias) - aliases = suite.app.TokensKeeper.ListTokenAlias(ctx) - suite.Require().Len(aliases, 1) - aliasMap = suite.app.TokensKeeper.GetTokenAliasesByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(aliasMap), 0) - suite.Require().Nil(aliasMap["stake"]) -} diff --git a/x/tokens/keeper/burn.go b/x/tokens/keeper/burn.go new file mode 100644 index 000000000..9a9eef470 --- /dev/null +++ b/x/tokens/keeper/burn.go @@ -0,0 +1,21 @@ +package keeper + +import ( + "github.com/KiraCore/sekai/x/tokens/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error { + for _, coin := range amt { + tokenInfo := k.GetTokenInfo(ctx, coin.Denom) + if tokenInfo == nil { + return types.ErrTokenNotRegistered + } + tokenInfo.Supply = tokenInfo.Supply.Sub(coin.Amount) + err := k.UpsertTokenInfo(ctx, *tokenInfo) + if err != nil { + return err + } + } + return k.bankKeeper.BurnCoins(ctx, moduleName, amt) +} diff --git a/x/tokens/keeper/freeze.go b/x/tokens/keeper/freeze.go index 0e543413d..4565d8014 100644 --- a/x/tokens/keeper/freeze.go +++ b/x/tokens/keeper/freeze.go @@ -7,50 +7,42 @@ import ( func (k Keeper) AddTokensToBlacklist(ctx sdk.Context, tokens []string) { tokensBlackWhites := k.GetTokenBlackWhites(ctx) - if tokensBlackWhites != nil { - tokensBlackWhites.Blacklisted = addTokens(tokensBlackWhites.Blacklisted, tokens) - k.SetTokenBlackWhites(ctx, tokensBlackWhites) - } + tokensBlackWhites.Blacklisted = addTokens(tokensBlackWhites.Blacklisted, tokens) + k.SetTokenBlackWhites(ctx, tokensBlackWhites) } func (k Keeper) RemoveTokensFromBlacklist(ctx sdk.Context, tokens []string) { tokensBlackWhites := k.GetTokenBlackWhites(ctx) - if tokensBlackWhites != nil { - tokensBlackWhites.Blacklisted = removeTokens(tokensBlackWhites.Blacklisted, tokens) - k.SetTokenBlackWhites(ctx, tokensBlackWhites) - } + tokensBlackWhites.Blacklisted = removeTokens(tokensBlackWhites.Blacklisted, tokens) + k.SetTokenBlackWhites(ctx, tokensBlackWhites) } func (k Keeper) AddTokensToWhitelist(ctx sdk.Context, tokens []string) { tokensBlackWhites := k.GetTokenBlackWhites(ctx) - if tokensBlackWhites != nil { - tokensBlackWhites.Whitelisted = addTokens(tokensBlackWhites.Whitelisted, tokens) - k.SetTokenBlackWhites(ctx, tokensBlackWhites) - } + tokensBlackWhites.Whitelisted = addTokens(tokensBlackWhites.Whitelisted, tokens) + k.SetTokenBlackWhites(ctx, tokensBlackWhites) } func (k Keeper) RemoveTokensFromWhitelist(ctx sdk.Context, tokens []string) { tokensBlackWhites := k.GetTokenBlackWhites(ctx) - if tokensBlackWhites != nil { - tokensBlackWhites.Whitelisted = removeTokens(tokensBlackWhites.Whitelisted, tokens) - k.SetTokenBlackWhites(ctx, tokensBlackWhites) - } + tokensBlackWhites.Whitelisted = removeTokens(tokensBlackWhites.Whitelisted, tokens) + k.SetTokenBlackWhites(ctx, tokensBlackWhites) } -func (k Keeper) SetTokenBlackWhites(ctx sdk.Context, tokensBlackWhite *types.TokensWhiteBlack) { +func (k Keeper) SetTokenBlackWhites(ctx sdk.Context, tokensBlackWhite types.TokensWhiteBlack) { store := ctx.KVStore(k.storeKey) - store.Set(PrefixKeyTokenBlackWhite, k.cdc.MustMarshal(tokensBlackWhite)) + store.Set(PrefixKeyTokenBlackWhite, k.cdc.MustMarshal(&tokensBlackWhite)) } -func (k Keeper) GetTokenBlackWhites(ctx sdk.Context) *types.TokensWhiteBlack { +func (k Keeper) GetTokenBlackWhites(ctx sdk.Context) types.TokensWhiteBlack { store := ctx.KVStore(k.storeKey) bz := store.Get(PrefixKeyTokenBlackWhite) if bz == nil { - return nil + return types.TokensWhiteBlack{} } - tokensBlackWhite := new(types.TokensWhiteBlack) - k.cdc.MustUnmarshal(bz, tokensBlackWhite) + tokensBlackWhite := types.TokensWhiteBlack{} + k.cdc.MustUnmarshal(bz, &tokensBlackWhite) return tokensBlackWhite } diff --git a/x/tokens/keeper/freeze_test.go b/x/tokens/keeper/freeze_test.go index 43e21ea2c..95cf73e62 100644 --- a/x/tokens/keeper/freeze_test.go +++ b/x/tokens/keeper/freeze_test.go @@ -87,8 +87,8 @@ func (suite *KeeperTestSuite) TestTokenBlackWhiteSetGet() { Whitelisted: []string{"newwhite"}, Blacklisted: []string{"newblack"}, } - suite.app.TokensKeeper.SetTokenBlackWhites(ctx, &blackWhites) + suite.app.TokensKeeper.SetTokenBlackWhites(ctx, blackWhites) bw := suite.app.TokensKeeper.GetTokenBlackWhites(ctx) suite.Require().NotNil(bw) - suite.Require().Equal(blackWhites, *bw) + suite.Require().Equal(blackWhites, bw) } diff --git a/x/tokens/keeper/grpc_query.go b/x/tokens/keeper/grpc_query.go index 520906998..a1aa9220d 100644 --- a/x/tokens/keeper/grpc_query.go +++ b/x/tokens/keeper/grpc_query.go @@ -3,7 +3,6 @@ package keeper import ( "context" - appparams "github.com/KiraCore/sekai/app/params" "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -18,45 +17,33 @@ func NewQuerier(keeper Keeper) types.QueryServer { var _ types.QueryServer = Querier{} -func (q Querier) GetTokenAlias(ctx context.Context, request *types.TokenAliasRequest) (*types.TokenAliasResponse, error) { - alias := q.keeper.GetTokenAlias(sdk.UnwrapSDKContext(ctx), request.Symbol) - - return &types.TokenAliasResponse{Data: alias}, nil -} - -func (q Querier) GetTokenAliasesByDenom(ctx context.Context, request *types.TokenAliasesByDenomRequest) (*types.TokenAliasesByDenomResponse, error) { - aliases := q.keeper.GetTokenAliasesByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) - - return &types.TokenAliasesByDenomResponse{Data: aliases}, nil -} - -func (q Querier) GetAllTokenAliases(ctx context.Context, request *types.AllTokenAliasesRequest) (*types.AllTokenAliasesResponse, error) { - aliases := q.keeper.ListTokenAlias(sdk.UnwrapSDKContext(ctx)) - - return &types.AllTokenAliasesResponse{ - Data: aliases, - DefaultDenom: appparams.DefaultDenom, - Bech32Prefix: appparams.AccountAddressPrefix, +func (q Querier) GetTokenInfo(goCtx context.Context, request *types.TokenInfoRequest) (*types.TokenInfoResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + info := q.keeper.GetTokenInfo(ctx, request.Denom) + supply := q.keeper.bankKeeper.GetSupply(ctx, request.Denom) + return &types.TokenInfoResponse{ + Data: info, + Supply: supply, }, nil } -func (q Querier) GetTokenRate(ctx context.Context, request *types.TokenRateRequest) (*types.TokenRateResponse, error) { - rate := q.keeper.GetTokenRate(sdk.UnwrapSDKContext(ctx), request.Denom) - - if rate == nil { - return &types.TokenRateResponse{Data: nil}, nil - } - return &types.TokenRateResponse{Data: rate}, nil -} - -func (q Querier) GetTokenRatesByDenom(ctx context.Context, request *types.TokenRatesByDenomRequest) (*types.TokenRatesByDenomResponse, error) { - rates := q.keeper.GetTokenRatesByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) - return &types.TokenRatesByDenomResponse{Data: rates}, nil +func (q Querier) GetTokenInfosByDenom(ctx context.Context, request *types.TokenInfosByDenomRequest) (*types.TokenInfosByDenomResponse, error) { + infos := q.keeper.GetTokenInfosByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) + return &types.TokenInfosByDenomResponse{Data: infos}, nil } -func (q Querier) GetAllTokenRates(ctx context.Context, request *types.AllTokenRatesRequest) (*types.AllTokenRatesResponse, error) { - rates := q.keeper.GetAllTokenRates(sdk.UnwrapSDKContext(ctx)) - return &types.AllTokenRatesResponse{Data: rates}, nil +func (q Querier) GetAllTokenInfos(goCtx context.Context, request *types.AllTokenInfosRequest) (*types.AllTokenInfosResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + infos := q.keeper.GetAllTokenInfos(ctx) + data := []types.TokenInfoResponse{} + for _, info := range infos { + supply := q.keeper.bankKeeper.GetSupply(ctx, info.Denom) + data = append(data, types.TokenInfoResponse{ + Data: &info, + Supply: supply, + }) + } + return &types.AllTokenInfosResponse{Data: data}, nil } func (q Querier) GetTokenBlackWhites(ctx context.Context, request *types.TokenBlackWhitesRequest) (*types.TokenBlackWhitesResponse, error) { diff --git a/x/tokens/keeper/grpc_query_test.go b/x/tokens/keeper/grpc_query_test.go index 63d7fa2f4..e3d3a8d12 100644 --- a/x/tokens/keeper/grpc_query_test.go +++ b/x/tokens/keeper/grpc_query_test.go @@ -11,110 +11,54 @@ import ( "github.com/stretchr/testify/require" ) -func TestQuerier_GetTokenAlias(t *testing.T) { +func TestQuerier_GetTokenInfo(t *testing.T) { app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) querier := keeper.NewQuerier(app.TokensKeeper) - resp, err := querier.GetTokenAlias( + resp, err := querier.GetTokenInfo( sdk.WrapSDKContext(ctx), - &types.TokenAliasRequest{Symbol: "KEX"}, - ) - require.NoError(t, err) - require.Equal(t, "KEX", resp.Data.Symbol) - require.Equal(t, "Kira", resp.Data.Name) - require.Equal(t, "", resp.Data.Icon) - require.Equal(t, uint32(0x6), resp.Data.Decimals) - require.Equal(t, []string{"ukex", "mkex"}, resp.Data.Denoms) -} - -func TestQuerier_GetTokenAliasesByDenom(t *testing.T) { - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - - querier := keeper.NewQuerier(app.TokensKeeper) - - resp, err := querier.GetTokenAliasesByDenom( - sdk.WrapSDKContext(ctx), - &types.TokenAliasesByDenomRequest{Denoms: []string{"ukex"}}, - ) - require.NoError(t, err) - require.Equal(t, len(resp.Data), 1) - require.Equal(t, "KEX", resp.Data["ukex"].Symbol) - require.Equal(t, "Kira", resp.Data["ukex"].Name) - require.Equal(t, "", resp.Data["ukex"].Icon) - require.Equal(t, uint32(0x6), resp.Data["ukex"].Decimals) - require.Equal(t, []string{"ukex", "mkex"}, resp.Data["ukex"].Denoms) -} - -func TestQuerier_GetAllTokenAliases(t *testing.T) { - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - - querier := keeper.NewQuerier(app.TokensKeeper) - - resp, err := querier.GetAllTokenAliases( - sdk.WrapSDKContext(ctx), - &types.AllTokenAliasesRequest{}, - ) - require.NoError(t, err) - require.Equal(t, len(resp.Data), 1) - require.Equal(t, "KEX", resp.Data[0].Symbol) - require.Equal(t, "Kira", resp.Data[0].Name) - require.Equal(t, "", resp.Data[0].Icon) - require.Equal(t, uint32(0x6), resp.Data[0].Decimals) - require.Equal(t, []string{"ukex", "mkex"}, resp.Data[0].Denoms) -} - -func TestQuerier_GetTokenRate(t *testing.T) { - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - - querier := keeper.NewQuerier(app.TokensKeeper) - - resp, err := querier.GetTokenRate( - sdk.WrapSDKContext(ctx), - &types.TokenRateRequest{Denom: "ukex"}, + &types.TokenInfoRequest{Denom: "ukex"}, ) require.NoError(t, err) require.Equal(t, "ukex", resp.Data.Denom) require.Equal(t, sdk.NewDec(1), resp.Data.FeeRate) - require.Equal(t, true, resp.Data.FeePayments) + require.Equal(t, true, resp.Data.FeeEnabled) } -func TestQuerier_GetTokenRatesByDenom(t *testing.T) { +func TestQuerier_GetTokenInfosByDenom(t *testing.T) { app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) querier := keeper.NewQuerier(app.TokensKeeper) - resp, err := querier.GetTokenRatesByDenom( + resp, err := querier.GetTokenInfosByDenom( sdk.WrapSDKContext(ctx), - &types.TokenRatesByDenomRequest{Denoms: []string{"ukex"}}, + &types.TokenInfosByDenomRequest{Denoms: []string{"ukex"}}, ) require.NoError(t, err) require.Equal(t, len(resp.Data), 1) - require.Equal(t, "ukex", resp.Data["ukex"].Denom) - require.Equal(t, sdk.NewDec(1), resp.Data["ukex"].FeeRate) - require.Equal(t, true, resp.Data["ukex"].FeePayments) + require.Equal(t, "ukex", resp.Data["ukex"].Data.Denom) + require.Equal(t, sdk.NewDec(1), resp.Data["ukex"].Data.FeeRate) + require.Equal(t, true, resp.Data["ukex"].Data.FeeEnabled) } -func TestQuerier_GetAllTokenRates(t *testing.T) { +func TestQuerier_GetAllTokenInfos(t *testing.T) { app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) querier := keeper.NewQuerier(app.TokensKeeper) - resp, err := querier.GetAllTokenRates( + resp, err := querier.GetAllTokenInfos( sdk.WrapSDKContext(ctx), - &types.AllTokenRatesRequest{}, + &types.AllTokenInfosRequest{}, ) require.NoError(t, err) require.Equal(t, len(resp.Data), 4) - require.Equal(t, "frozen", resp.Data[0].Denom) - require.Equal(t, sdk.NewDecWithPrec(1, 1), resp.Data[0].FeeRate) - require.Equal(t, true, resp.Data[0].FeePayments) + require.Equal(t, "xeth", resp.Data[0].Data.Denom) + require.Equal(t, sdk.NewDecWithPrec(1, 1), resp.Data[0].Data.FeeRate) + require.Equal(t, true, resp.Data[0].Data.FeeEnabled) } func TestQuerier_GetTokenBlackWhites(t *testing.T) { diff --git a/x/tokens/keeper/keeper.go b/x/tokens/keeper/keeper.go index 986e1a893..f95bf99e0 100644 --- a/x/tokens/keeper/keeper.go +++ b/x/tokens/keeper/keeper.go @@ -10,9 +10,7 @@ import ( // store prefixes var ( - PrefixKeyTokenAlias = []byte("token_alias_registry") - PrefixKeyDenomToken = []byte("denom_token_registry") - PrefixKeyTokenRate = []byte("token_rate_registry") + PrefixKeyTokenInfo = []byte("token_rate_registry") PrefixKeyTokenBlackWhite = []byte("token_black_white") ) diff --git a/x/tokens/keeper/mint.go b/x/tokens/keeper/mint.go new file mode 100644 index 000000000..50c2e9be3 --- /dev/null +++ b/x/tokens/keeper/mint.go @@ -0,0 +1,36 @@ +package keeper + +import ( + "cosmossdk.io/math" + "github.com/KiraCore/sekai/x/tokens/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error { + for _, coin := range amt { + tokenInfo := k.GetTokenInfo(ctx, coin.Denom) + if tokenInfo == nil { + tokenInfo = &types.TokenInfo{ + Denom: coin.Denom, + FeeRate: math.LegacyZeroDec(), + FeeEnabled: false, + Supply: math.ZeroInt(), + StakeCap: math.LegacyZeroDec(), + StakeMin: math.OneInt(), + StakeEnabled: false, + Inactive: false, + Symbol: coin.Denom, + Name: coin.Denom, + Icon: "", + Decimals: 6, + } + } + + tokenInfo.Supply = tokenInfo.Supply.Add(coin.Amount) + err := k.UpsertTokenInfo(ctx, *tokenInfo) + if err != nil { + return err + } + } + return k.bankKeeper.MintCoins(ctx, moduleName, amt) +} diff --git a/x/tokens/keeper/msg_server.go b/x/tokens/keeper/msg_server.go index 128a8fb11..001f4b22f 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -3,7 +3,6 @@ package keeper import ( "context" "fmt" - "strings" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -30,40 +29,7 @@ func NewMsgServerImpl(keeper Keeper, cgk types.CustomGovKeeper) types.MsgServer var _ types.MsgServer = msgServer{} -func (k msgServer) UpsertTokenAlias( - goCtx context.Context, - msg *types.MsgUpsertTokenAlias, -) (*types.MsgUpsertTokenAliasResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenAlias) - if !isAllowed { - return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenAlias.String()) - } - - err := k.keeper.UpsertTokenAlias(ctx, *types.NewTokenAlias( - msg.Symbol, - msg.Name, - msg.Icon, - msg.Decimals, - msg.Denoms, - msg.Invalidated, - )) - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeUpsertTokenAlias, - sdk.NewAttribute(types.AttributeKeyProposer, msg.Proposer.String()), - sdk.NewAttribute(types.AttributeKeySymbol, msg.Symbol), - sdk.NewAttribute(types.AttributeKeyName, msg.Name), - sdk.NewAttribute(types.AttributeKeyIcon, msg.Icon), - sdk.NewAttribute(types.AttributeKeyDecimals, fmt.Sprintf("%d", msg.Decimals)), - sdk.NewAttribute(types.AttributeKeyDenoms, strings.Join(msg.Denoms, ",")), - ), - ) - return &types.MsgUpsertTokenAliasResponse{}, err -} - -func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTokenRate) (*types.MsgUpsertTokenRateResponse, error) { +func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTokenInfo) (*types.MsgUpsertTokenInfoResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) err := msg.ValidateBasic() @@ -71,35 +37,76 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } - isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenRate) + tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) + if tokenInfo != nil { + if tokenInfo.Owner != msg.Proposer.String() || tokenInfo.OwnerEditDisabled { + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) + } + tokenInfo.Icon = msg.Icon + tokenInfo.Description = msg.Description + tokenInfo.Website = msg.Website + tokenInfo.Social = msg.Social + if !tokenInfo.SupplyCap.IsZero() && + (tokenInfo.SupplyCap.LT(msg.SupplyCap) || msg.SupplyCap.IsZero()) { + return nil, types.ErrSupplyCapShouldNotBeIncreased + } + tokenInfo.SupplyCap = msg.SupplyCap + tokenInfo.MintingFee = msg.MintingFee + tokenInfo.Owner = msg.Owner + tokenInfo.OwnerEditDisabled = msg.OwnerEditDisabled + err = k.keeper.UpsertTokenInfo(ctx, *tokenInfo) + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + } + + return &types.MsgUpsertTokenInfoResponse{}, nil + } + + isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenInfo) if !isAllowed { - return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenRate.String()) + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) } - err = k.keeper.UpsertTokenRate(ctx, *types.NewTokenRate( + err = k.keeper.UpsertTokenInfo(ctx, types.NewTokenInfo( msg.Denom, - msg.Rate, - msg.FeePayments, + msg.TokenType, + msg.FeeRate, + msg.FeeEnabled, + msg.Supply, + msg.SupplyCap, msg.StakeCap, msg.StakeMin, - msg.StakeToken, - msg.Invalidated, + msg.StakeEnabled, + msg.Inactive, + msg.Symbol, + msg.Name, + msg.Icon, + msg.Decimals, + msg.Description, + msg.Website, + msg.Social, + msg.Holders, + msg.MintingFee, + msg.Owner, + msg.OwnerEditDisabled, + msg.NftMetadata, + msg.NftHash, )) - if err != nil { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } + ctx.EventManager().EmitEvent( sdk.NewEvent( - types.EventTypeUpsertTokenRate, + types.EventTypeUpsertTokenInfo, sdk.NewAttribute(types.AttributeKeyProposer, msg.Proposer.String()), sdk.NewAttribute(types.AttributeKeyDenom, msg.Denom), - sdk.NewAttribute(types.AttributeKeyRate, msg.Rate.String()), - sdk.NewAttribute(types.AttributeKeyFeePayments, fmt.Sprintf("%t", msg.FeePayments)), + sdk.NewAttribute(types.AttributeKeyFeeRate, msg.FeeRate.String()), + sdk.NewAttribute(types.AttributeKeyFeeEnabled, fmt.Sprintf("%t", msg.FeeEnabled)), ), ) - return &types.MsgUpsertTokenRateResponse{}, nil + return &types.MsgUpsertTokenInfoResponse{}, nil } func (k msgServer) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error) { diff --git a/x/tokens/keeper/rate.go b/x/tokens/keeper/rate.go deleted file mode 100644 index a29fd83b9..000000000 --- a/x/tokens/keeper/rate.go +++ /dev/null @@ -1,98 +0,0 @@ -package keeper - -import ( - "errors" - "fmt" - "strings" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/KiraCore/sekai/x/tokens/types" -) - -// GetTokenRate returns a token rate -func (k Keeper) GetTokenRate(ctx sdk.Context, denom string) *types.TokenRate { - prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), PrefixKeyTokenRate) - bz := prefixStore.Get([]byte(denom)) - if bz == nil { - return nil - } - - rate := new(types.TokenRate) - k.cdc.MustUnmarshal(bz, rate) - - return rate -} - -// GetAllTokenRates returns all list of token rate -func (k Keeper) GetAllTokenRates(ctx sdk.Context) []*types.TokenRate { - var tokenRates []*types.TokenRate - - // get iterator for token rates - store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenRate) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - denom := strings.TrimPrefix(string(iterator.Key()), string(PrefixKeyTokenRate)) - tokenRate := k.GetTokenRate(ctx, denom) - if tokenRate != nil { - tokenRates = append(tokenRates, tokenRate) - } - } - return tokenRates -} - -// GetTokenRatesByDenom returns all list of token rate -func (k Keeper) GetTokenRatesByDenom(ctx sdk.Context, denoms []string) map[string]*types.TokenRate { - // get iterator for token aliases - store := ctx.KVStore(k.storeKey) - tokenRatesMap := make(map[string]*types.TokenRate) - - for _, denom := range denoms { - denomTokenStoreID := append([]byte(PrefixKeyTokenRate), []byte(denom)...) - - if store.Has(denomTokenStoreID) { - tokenRate := k.GetTokenRate(ctx, denom) - tokenRatesMap[denom] = tokenRate - } - } - return tokenRatesMap -} - -// UpsertTokenRate upsert a token rate to the registry -func (k Keeper) UpsertTokenRate(ctx sdk.Context, rate types.TokenRate) error { - store := ctx.KVStore(k.storeKey) - // we use denom of TokenRate as an ID inside KVStore storage - tokenRateStoreID := append([]byte(PrefixKeyTokenRate), []byte(rate.Denom)...) - if rate.Denom == k.DefaultDenom(ctx) && store.Has(tokenRateStoreID) { - return errors.New("bond denom rate is read-only") - } - - store.Set(tokenRateStoreID, k.cdc.MustMarshal(&rate)) - - totalRewardsCap := sdk.ZeroDec() - rates := k.GetAllTokenRates(ctx) - for _, rate := range rates { - totalRewardsCap = totalRewardsCap.Add(rate.StakeCap) - } - if totalRewardsCap.GT(sdk.OneDec()) { - return types.ErrTotalRewardsCapExceeds100Percent - } - return nil -} - -// DeleteTokenRate delete token denom by denom -func (k Keeper) DeleteTokenRate(ctx sdk.Context, denom string) error { - store := ctx.KVStore(k.storeKey) - // we use symbol of DeleteTokenRate as an ID inside KVStore storage - tokenRateStoreID := append([]byte(PrefixKeyTokenRate), []byte(denom)...) - - if !store.Has(tokenRateStoreID) { - return fmt.Errorf("no rate registry is available for %s denom", denom) - } - - store.Delete(tokenRateStoreID) - return nil -} diff --git a/x/tokens/keeper/rate_test.go b/x/tokens/keeper/rate_test.go deleted file mode 100644 index e6bf5ba9f..000000000 --- a/x/tokens/keeper/rate_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package keeper_test - -import ( - "github.com/KiraCore/sekai/x/tokens/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (suite *KeeperTestSuite) TestTokenRates() { - suite.SetupTest() - ctx := suite.ctx - - // check initial token rate before registration - rate := suite.app.TokensKeeper.GetTokenRate(ctx, "stake") - suite.Require().Nil(rate) - rates := suite.app.TokensKeeper.GetAllTokenRates(ctx) - suite.Require().Len(rates, 4) - rateMap := suite.app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(rateMap), 0) - suite.Require().Nil(rateMap["stake"]) - - // upsert token rate and check - newRate := types.TokenRate{ - Denom: "stake", - FeeRate: sdk.NewDec(2), - FeePayments: true, - } - suite.app.TokensKeeper.UpsertTokenRate(ctx, newRate) - rate = suite.app.TokensKeeper.GetTokenRate(ctx, "stake") - suite.Require().NotNil(rate) - rates = suite.app.TokensKeeper.GetAllTokenRates(ctx) - suite.Require().Len(rates, 5) - rateMap = suite.app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(rateMap), 1) - suite.Require().NotNil(rateMap["stake"]) - - // delete token rate and check - suite.app.TokensKeeper.DeleteTokenRate(ctx, "stake") - rate = suite.app.TokensKeeper.GetTokenRate(ctx, "stake") - suite.Require().Nil(rate) - rates = suite.app.TokensKeeper.GetAllTokenRates(ctx) - suite.Require().Len(rates, 4) - rateMap = suite.app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(rateMap), 0) - suite.Require().Nil(rateMap["stake"]) -} diff --git a/x/tokens/keeper/token_info.go b/x/tokens/keeper/token_info.go new file mode 100644 index 000000000..92d702b4a --- /dev/null +++ b/x/tokens/keeper/token_info.go @@ -0,0 +1,97 @@ +package keeper + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/KiraCore/sekai/x/tokens/types" +) + +// GetTokenInfo returns a token info +func (k Keeper) GetTokenInfo(ctx sdk.Context, denom string) *types.TokenInfo { + prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), PrefixKeyTokenInfo) + bz := prefixStore.Get([]byte(denom)) + if bz == nil { + return nil + } + + info := new(types.TokenInfo) + k.cdc.MustUnmarshal(bz, info) + + return info +} + +// GetAllTokenInfos returns all list of token info +func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []types.TokenInfo { + var tokenInfos []types.TokenInfo + + // get iterator for token infos + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenInfo) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + info := types.TokenInfo{} + k.cdc.MustUnmarshal(iterator.Value(), &info) + tokenInfos = append(tokenInfos, info) + } + return tokenInfos +} + +// GetTokenInfosByDenom returns all list of token info +func (k Keeper) GetTokenInfosByDenom(ctx sdk.Context, denoms []string) map[string]types.TokenInfoResponse { + tokenInfosMap := make(map[string]types.TokenInfoResponse) + + for _, denom := range denoms { + tokenInfo := k.GetTokenInfo(ctx, denom) + supply := k.bankKeeper.GetSupply(ctx, denom) + tokenInfosMap[denom] = types.TokenInfoResponse{ + Data: tokenInfo, + Supply: supply, + } + } + return tokenInfosMap +} + +// UpsertTokenInfo upsert a token info to the registry +func (k Keeper) UpsertTokenInfo(ctx sdk.Context, info types.TokenInfo) error { + store := ctx.KVStore(k.storeKey) + // we use denom of TokenInfo as an ID inside KVStore storage + tokenInfoStoreID := append([]byte(PrefixKeyTokenInfo), []byte(info.Denom)...) + // if info.Denom == k.DefaultDenom(ctx) && store.Has(tokenInfoStoreID) { + // return types.ErrBondDenomIsReadOnly + // } + + if !info.SupplyCap.IsNil() && info.SupplyCap.IsPositive() && info.Supply.GT(info.SupplyCap) { + return types.ErrCannotExceedTokenCap + } + + store.Set(tokenInfoStoreID, k.cdc.MustMarshal(&info)) + + totalRewardsCap := sdk.ZeroDec() + infos := k.GetAllTokenInfos(ctx) + for _, info := range infos { + totalRewardsCap = totalRewardsCap.Add(info.StakeCap) + } + if totalRewardsCap.GT(sdk.OneDec()) { + return types.ErrTotalRewardsCapExceeds100Percent + } + + return nil +} + +// DeleteTokenInfo delete token denom by denom +func (k Keeper) DeleteTokenInfo(ctx sdk.Context, denom string) error { + store := ctx.KVStore(k.storeKey) + // we use symbol of DeleteTokenInfo as an ID inside KVStore storage + tokenInfoStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) + + if !store.Has(tokenInfoStoreID) { + return fmt.Errorf("no token info registry is available for %s denom", denom) + } + + store.Delete(tokenInfoStoreID) + return nil +} diff --git a/x/tokens/keeper/token_info_test.go b/x/tokens/keeper/token_info_test.go new file mode 100644 index 000000000..185c85b04 --- /dev/null +++ b/x/tokens/keeper/token_info_test.go @@ -0,0 +1,45 @@ +package keeper_test + +import ( + "github.com/KiraCore/sekai/x/tokens/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (suite *KeeperTestSuite) TestTokenInfos() { + suite.SetupTest() + ctx := suite.ctx + + // check initial token rate before registration + rate := suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") + suite.Require().Nil(rate) + rates := suite.app.TokensKeeper.GetAllTokenInfos(ctx) + suite.Require().Len(rates, 4) + rateMap := suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) + suite.Require().Equal(len(rateMap), 1) + suite.Require().Nil(rateMap["stake"].Data) + + // upsert token rate and check + newRate := types.TokenInfo{ + Denom: "stake", + FeeRate: sdk.NewDec(2), + FeeEnabled: true, + } + suite.app.TokensKeeper.UpsertTokenInfo(ctx, newRate) + rate = suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") + suite.Require().NotNil(rate) + rates = suite.app.TokensKeeper.GetAllTokenInfos(ctx) + suite.Require().Len(rates, 5) + rateMap = suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) + suite.Require().Equal(len(rateMap), 1) + suite.Require().NotNil(rateMap["stake"]) + + // delete token rate and check + suite.app.TokensKeeper.DeleteTokenInfo(ctx, "stake") + rate = suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") + suite.Require().Nil(rate) + rates = suite.app.TokensKeeper.GetAllTokenInfos(ctx) + suite.Require().Len(rates, 4) + rateMap = suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) + suite.Require().Equal(len(rateMap), 1) + suite.Require().Nil(rateMap["stake"].Data) +} diff --git a/x/tokens/module.go b/x/tokens/module.go index 0359822e6..8120e5885 100644 --- a/x/tokens/module.go +++ b/x/tokens/module.go @@ -95,12 +95,8 @@ func (am AppModule) InitGenesis( var genesisState tokenstypes.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - for _, alias := range genesisState.Aliases { - am.tokensKeeper.UpsertTokenAlias(ctx, *alias) - } - - for _, rate := range genesisState.Rates { - am.tokensKeeper.UpsertTokenRate(ctx, *rate) + for _, rate := range genesisState.TokenInfos { + am.tokensKeeper.UpsertTokenInfo(ctx, rate) } am.tokensKeeper.SetTokenBlackWhites(ctx, genesisState.TokenBlackWhites) @@ -110,8 +106,7 @@ func (am AppModule) InitGenesis( func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { var genesisState tokenstypes.GenesisState - genesisState.Aliases = am.tokensKeeper.ListTokenAlias(ctx) - genesisState.Rates = am.tokensKeeper.GetAllTokenRates(ctx) + genesisState.TokenInfos = am.tokensKeeper.GetAllTokenInfos(ctx) genesisState.TokenBlackWhites = am.tokensKeeper.GetTokenBlackWhites(ctx) return cdc.MustMarshalJSON(&genesisState) } diff --git a/x/tokens/proposal_handler.go b/x/tokens/proposal_handler.go index 820b0004a..525af4168 100644 --- a/x/tokens/proposal_handler.go +++ b/x/tokens/proposal_handler.go @@ -8,44 +8,43 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -type ApplyUpsertTokenAliasProposalHandler struct { +type ApplyUpsertTokenInfosProposalHandler struct { keeper keeper.Keeper } -func NewApplyUpsertTokenAliasProposalHandler(keeper keeper.Keeper) *ApplyUpsertTokenAliasProposalHandler { - return &ApplyUpsertTokenAliasProposalHandler{ - keeper: keeper, - } -} - -func (a ApplyUpsertTokenAliasProposalHandler) ProposalType() string { - return kiratypes.ProposalTypeUpsertTokenAlias -} - -func (a ApplyUpsertTokenAliasProposalHandler) Apply(ctx sdk.Context, proposalID uint64, proposal types.Content, slash sdk.Dec) error { - p := proposal.(*tokenstypes.ProposalUpsertTokenAlias) - - alias := tokenstypes.NewTokenAlias(p.Symbol, p.Name, p.Icon, p.Decimals, p.Denoms, p.Invalidated) - return a.keeper.UpsertTokenAlias(ctx, *alias) +func NewApplyUpsertTokenInfosProposalHandler(keeper keeper.Keeper) *ApplyUpsertTokenInfosProposalHandler { + return &ApplyUpsertTokenInfosProposalHandler{keeper: keeper} } -type ApplyUpsertTokenRatesProposalHandler struct { - keeper keeper.Keeper -} - -func NewApplyUpsertTokenRatesProposalHandler(keeper keeper.Keeper) *ApplyUpsertTokenRatesProposalHandler { - return &ApplyUpsertTokenRatesProposalHandler{keeper: keeper} +func (a ApplyUpsertTokenInfosProposalHandler) ProposalType() string { + return kiratypes.ProposalTypeUpsertTokenInfos } -func (a ApplyUpsertTokenRatesProposalHandler) ProposalType() string { - return kiratypes.ProposalTypeUpsertTokenRates -} - -func (a ApplyUpsertTokenRatesProposalHandler) Apply(ctx sdk.Context, proposalID uint64, proposal types.Content, slash sdk.Dec) error { - p := proposal.(*tokenstypes.ProposalUpsertTokenRates) +func (a ApplyUpsertTokenInfosProposalHandler) Apply(ctx sdk.Context, proposalID uint64, proposal types.Content, slash sdk.Dec) error { + p := proposal.(*tokenstypes.ProposalUpsertTokenInfo) + + tokenInfo := a.keeper.GetTokenInfo(ctx, p.Denom) + if tokenInfo != nil { + tokenInfo.Name = p.Name + tokenInfo.Symbol = p.Symbol + tokenInfo.Icon = p.Icon + tokenInfo.Description = p.Description + tokenInfo.Website = p.Website + tokenInfo.Social = p.Social + tokenInfo.Inactive = p.Inactive + tokenInfo.FeeRate = p.FeeRate + tokenInfo.FeeEnabled = p.FeeEnabled + tokenInfo.StakeCap = p.StakeCap + tokenInfo.StakeMin = p.StakeMin + tokenInfo.StakeEnabled = p.StakeEnabled + return a.keeper.UpsertTokenInfo(ctx, *tokenInfo) + } - rate := tokenstypes.NewTokenRate(p.Denom, p.Rate, p.FeePayments, p.StakeCap, p.StakeMin, p.StakeToken, p.Invalidated) - return a.keeper.UpsertTokenRate(ctx, *rate) + return a.keeper.UpsertTokenInfo(ctx, tokenstypes.NewTokenInfo( + p.Denom, p.TokenType, p.FeeRate, p.FeeEnabled, p.Supply, p.SupplyCap, p.StakeCap, p.StakeMin, p.StakeEnabled, p.Inactive, + p.Symbol, p.Name, p.Icon, p.Decimals, + p.Description, p.Website, p.Social, p.Holders, p.MintingFee, p.Owner, p.OwnerEditDisabled, p.NftMetadata, p.NftHash, + )) } type ApplyWhiteBlackChangeProposalHandler struct { diff --git a/x/tokens/types/alias.pb.go b/x/tokens/types/alias.pb.go deleted file mode 100644 index 61653c40d..000000000 --- a/x/tokens/types/alias.pb.go +++ /dev/null @@ -1,1016 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: kira/tokens/alias.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// 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 - -type TokenAlias struct { - Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` - Denoms []string `protobuf:"bytes,5,rep,name=denoms,proto3" json:"denoms,omitempty"` - Invalidated bool `protobuf:"varint,6,opt,name=invalidated,proto3" json:"invalidated,omitempty"` -} - -func (m *TokenAlias) Reset() { *m = TokenAlias{} } -func (m *TokenAlias) String() string { return proto.CompactTextString(m) } -func (*TokenAlias) ProtoMessage() {} -func (*TokenAlias) Descriptor() ([]byte, []int) { - return fileDescriptor_e5f7b26b3e48e5a6, []int{0} -} -func (m *TokenAlias) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenAlias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenAlias.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 *TokenAlias) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAlias.Merge(m, src) -} -func (m *TokenAlias) XXX_Size() int { - return m.Size() -} -func (m *TokenAlias) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAlias.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenAlias proto.InternalMessageInfo - -func (m *TokenAlias) GetSymbol() string { - if m != nil { - return m.Symbol - } - return "" -} - -func (m *TokenAlias) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *TokenAlias) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *TokenAlias) GetDecimals() uint32 { - if m != nil { - return m.Decimals - } - return 0 -} - -func (m *TokenAlias) GetDenoms() []string { - if m != nil { - return m.Denoms - } - return nil -} - -func (m *TokenAlias) GetInvalidated() bool { - if m != nil { - return m.Invalidated - } - return false -} - -type MsgUpsertTokenAlias struct { - Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` - Denoms []string `protobuf:"bytes,5,rep,name=denoms,proto3" json:"denoms,omitempty"` - Invalidated bool `protobuf:"varint,6,opt,name=invalidated,proto3" json:"invalidated,omitempty"` - Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,7,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` -} - -func (m *MsgUpsertTokenAlias) Reset() { *m = MsgUpsertTokenAlias{} } -func (m *MsgUpsertTokenAlias) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertTokenAlias) ProtoMessage() {} -func (*MsgUpsertTokenAlias) Descriptor() ([]byte, []int) { - return fileDescriptor_e5f7b26b3e48e5a6, []int{1} -} -func (m *MsgUpsertTokenAlias) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpsertTokenAlias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpsertTokenAlias.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 *MsgUpsertTokenAlias) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertTokenAlias.Merge(m, src) -} -func (m *MsgUpsertTokenAlias) XXX_Size() int { - return m.Size() -} -func (m *MsgUpsertTokenAlias) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertTokenAlias.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpsertTokenAlias proto.InternalMessageInfo - -func (m *MsgUpsertTokenAlias) GetSymbol() string { - if m != nil { - return m.Symbol - } - return "" -} - -func (m *MsgUpsertTokenAlias) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *MsgUpsertTokenAlias) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *MsgUpsertTokenAlias) GetDecimals() uint32 { - if m != nil { - return m.Decimals - } - return 0 -} - -func (m *MsgUpsertTokenAlias) GetDenoms() []string { - if m != nil { - return m.Denoms - } - return nil -} - -func (m *MsgUpsertTokenAlias) GetInvalidated() bool { - if m != nil { - return m.Invalidated - } - return false -} - -func (m *MsgUpsertTokenAlias) GetProposer() github_com_cosmos_cosmos_sdk_types.AccAddress { - if m != nil { - return m.Proposer - } - return nil -} - -func init() { - proto.RegisterType((*TokenAlias)(nil), "kira.tokens.TokenAlias") - proto.RegisterType((*MsgUpsertTokenAlias)(nil), "kira.tokens.MsgUpsertTokenAlias") -} - -func init() { proto.RegisterFile("kira/tokens/alias.proto", fileDescriptor_e5f7b26b3e48e5a6) } - -var fileDescriptor_e5f7b26b3e48e5a6 = []byte{ - // 330 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x92, 0xbd, 0x4e, 0xeb, 0x30, - 0x14, 0xc7, 0xeb, 0xb6, 0xb7, 0xb7, 0xd7, 0xbd, 0x08, 0x29, 0x20, 0x88, 0x3a, 0xa4, 0x51, 0xa6, - 0x2c, 0x8d, 0x07, 0x36, 0xb6, 0x16, 0x36, 0xc4, 0x12, 0xc1, 0xc2, 0x84, 0x1b, 0x5b, 0xc1, 0x4a, - 0x9c, 0x13, 0xf9, 0x04, 0x44, 0x1f, 0x02, 0x89, 0x67, 0xe0, 0x69, 0x18, 0x3b, 0x32, 0x55, 0xa8, - 0x7d, 0x03, 0x46, 0x26, 0xe4, 0xa4, 0xad, 0xfa, 0x08, 0x4c, 0xfe, 0x7f, 0x1c, 0xff, 0x64, 0xc9, - 0x87, 0x9e, 0x66, 0xca, 0x70, 0x56, 0x41, 0x26, 0x0b, 0x64, 0x3c, 0x57, 0x1c, 0xa3, 0xd2, 0x40, - 0x05, 0xce, 0xc0, 0x16, 0x51, 0x53, 0x0c, 0x8f, 0x53, 0x48, 0xa1, 0xce, 0x99, 0x55, 0xcd, 0x48, - 0xf0, 0x46, 0x28, 0xbd, 0xb1, 0x03, 0x13, 0x7b, 0xcf, 0x39, 0xa1, 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0x19, 0x57, 0xec, 0x79, 0xbb, 0x21, 0x35, 0x78, 0xd6, 0xab, 0xff, 0xff, 0xec, 0x27, 0x00, 0x00, - 0xff, 0xff, 0x6f, 0x5b, 0xa6, 0x08, 0x3d, 0x02, 0x00, 0x00, -} - -func (m *TokenAlias) 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 *TokenAlias) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenAlias) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Invalidated { - i-- - if m.Invalidated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.Decimals != 0 { - i = encodeVarintAlias(dAtA, i, uint64(m.Decimals)) - i-- - dAtA[i] = 0x20 - } - if len(m.Icon) > 0 { - i -= len(m.Icon) - copy(dAtA[i:], m.Icon) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Icon))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Symbol))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpsertTokenAlias) 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 *MsgUpsertTokenAlias) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpsertTokenAlias) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Proposer) > 0 { - i -= len(m.Proposer) - copy(dAtA[i:], m.Proposer) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Proposer))) - i-- - dAtA[i] = 0x3a - } - if m.Invalidated { - i-- - if m.Invalidated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.Decimals != 0 { - i = encodeVarintAlias(dAtA, i, uint64(m.Decimals)) - i-- - dAtA[i] = 0x20 - } - if len(m.Icon) > 0 { - i -= len(m.Icon) - copy(dAtA[i:], m.Icon) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Icon))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Symbol))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintAlias(dAtA []byte, offset int, v uint64) int { - offset -= sovAlias(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TokenAlias) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - l = len(m.Icon) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - if m.Decimals != 0 { - n += 1 + sovAlias(uint64(m.Decimals)) - } - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovAlias(uint64(l)) - } - } - if m.Invalidated { - n += 2 - } - return n -} - -func (m *MsgUpsertTokenAlias) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - l = len(m.Icon) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - if m.Decimals != 0 { - n += 1 + sovAlias(uint64(m.Decimals)) - } - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovAlias(uint64(l)) - } - } - if m.Invalidated { - n += 2 - } - l = len(m.Proposer) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - return n -} - -func sovAlias(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAlias(x uint64) (n int) { - return sovAlias(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TokenAlias) 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 ErrIntOverflowAlias - } - 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: TokenAlias: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAlias: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Icon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decimals |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invalidated = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipAlias(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAlias - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpsertTokenAlias) 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 ErrIntOverflowAlias - } - 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: MsgUpsertTokenAlias: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertTokenAlias: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Icon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decimals |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invalidated = bool(v != 0) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAlias - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposer = append(m.Proposer[:0], dAtA[iNdEx:postIndex]...) - if m.Proposer == nil { - m.Proposer = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAlias(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAlias - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAlias(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, ErrIntOverflowAlias - } - 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, ErrIntOverflowAlias - } - 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, ErrIntOverflowAlias - } - 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, ErrInvalidLengthAlias - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAlias - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAlias - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAlias = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAlias = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAlias = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokens/types/codec.go b/x/tokens/types/codec.go index c031db0db..b0a6c63e3 100644 --- a/x/tokens/types/codec.go +++ b/x/tokens/types/codec.go @@ -11,40 +11,9 @@ import ( // RegisterCodec register codec and metadata func RegisterCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgUpsertTokenAlias{}, "kiraHub/MsgUpsertTokenAlias", nil) - functionmeta.AddNewFunction((&MsgUpsertTokenAlias{}).Type(), `{ - "description": "MsgUpsertTokenAlias represents a message to register token alias.", - "parameters": { - "symbol": { - "type": "string", - "description": "Ticker (eg. ATOM, KEX, BTC)." - }, - "name": { - "type": "string", - "description": "Token Name (e.g. Cosmos, Kira, Bitcoin)." - }, - "icon": { - "type": "string", - "description": "Graphical Symbol (url link to graphics)." - }, - "decimals": { - "type": "uint32", - "description": "Integer number of max decimals." - }, - "denoms": { - "type": "array", - "description": "An array of token denoms to be aliased." - }, - "proposer": { - "type": "string", - "description": "proposer who propose this message." - } - } - }`) - - cdc.RegisterConcrete(&MsgUpsertTokenRate{}, "kiraHub/MsgUpsertTokenRate", nil) - functionmeta.AddNewFunction((&MsgUpsertTokenRate{}).Type(), `{ - "description": "MsgUpsertTokenRate represents a message to register token rate.", + cdc.RegisterConcrete(&MsgUpsertTokenInfo{}, "kiraHub/MsgUpsertTokenInfo", nil) + functionmeta.AddNewFunction((&MsgUpsertTokenInfo{}).Type(), `{ + "description": "MsgUpsertTokenInfo represents a message to register token rate.", "parameters": { "denom": { "type": "string", @@ -67,7 +36,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgEthereumTx{}, "kiraHub/MsgEthereumTx", nil) functionmeta.AddNewFunction((&MsgEthereumTx{}).Type(), `{ - "description": "MsgUpsertTokenRate represents a message to register token rate.", + "description": "MsgUpsertTokenInfo represents a message to register token rate.", "parameters": { "tx_type": { "type": "string", @@ -92,16 +61,14 @@ func RegisterCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces register Msg and structs func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUpsertTokenRate{}, - &MsgUpsertTokenAlias{}, + &MsgUpsertTokenInfo{}, &MsgEthereumTx{}, ) registry.RegisterInterface( "kira.gov.Content", (*govtypes.Content)(nil), - &ProposalUpsertTokenAlias{}, - &ProposalUpsertTokenRates{}, + &ProposalUpsertTokenInfo{}, &ProposalTokensWhiteBlackChange{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/tokens/types/errors.go b/x/tokens/types/errors.go index 214898630..97245f97b 100644 --- a/x/tokens/types/errors.go +++ b/x/tokens/types/errors.go @@ -4,8 +4,11 @@ import "github.com/cosmos/cosmos-sdk/types/errors" // tokens module errors var ( - ErrTokenAliasNotFound = errors.Register(ModuleName, 2, "token alias not found") - ErrTokenRateNotFound = errors.Register(ModuleName, 3, "token rate not found") + ErrTokenInfoNotFound = errors.Register(ModuleName, 3, "token rate not found") ErrTotalRewardsCapExceeds100Percent = errors.Register(ModuleName, 4, "total rewards cap exceeds 100%") ErrUnimplementedTxType = errors.Register(ModuleName, 5, "not implemented tx type") + ErrCannotExceedTokenCap = errors.Register(ModuleName, 6, "cannot exceed token cap") + ErrBondDenomIsReadOnly = errors.Register(ModuleName, 7, "bond denom rate is read-only") + ErrTokenNotRegistered = errors.Register(ModuleName, 8, "token not registered") + ErrSupplyCapShouldNotBeIncreased = errors.Register(ModuleName, 9, "supply cap should not be increased") ) diff --git a/x/tokens/types/events.go b/x/tokens/types/events.go index df7b5dfc5..2b268f536 100644 --- a/x/tokens/types/events.go +++ b/x/tokens/types/events.go @@ -2,13 +2,12 @@ package types // tokens module events const ( - EventTypeUpsertTokenAlias = "upsert_token_alias" - EventTypeUpsertTokenRate = "upsert_token_rate" + EventTypeUpsertTokenInfo = "upsert_token_info" - AttributeKeyDescription = "proposal_id" - AttributeKeyDenom = "proposal_type" - AttributeKeyRate = "proposal_content" - AttributeKeyFeePayments = "voter" + AttributeKeyDescription = "description" + AttributeKeyDenom = "denom" + AttributeKeyFeeRate = "fee_rate" + AttributeKeyFeeEnabled = "fee_enabled" AttributeKeyProposer = "proposer" AttributeKeySymbol = "symbol" AttributeKeyName = "name" diff --git a/x/tokens/types/expected_keepers.go b/x/tokens/types/expected_keepers.go index 760cbe04c..a44d361ee 100644 --- a/x/tokens/types/expected_keepers.go +++ b/x/tokens/types/expected_keepers.go @@ -12,6 +12,9 @@ type CustomGovKeeper interface { // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { + GetSupply(ctx sdk.Context, denom string) sdk.Coin + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error SendCoins(ctx sdk.Context, senderAddr sdk.AccAddress, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error diff --git a/x/tokens/types/genesis.go b/x/tokens/types/genesis.go index 49ecce7e4..87cf7bc98 100644 --- a/x/tokens/types/genesis.go +++ b/x/tokens/types/genesis.go @@ -3,6 +3,7 @@ package types import ( "encoding/json" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -10,16 +11,13 @@ import ( // DefaultGenesis returns the default CustomGo genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - Aliases: []*TokenAlias{ - NewTokenAlias("KEX", "Kira", "", 6, []string{"ukex", "mkex"}, false), + TokenInfos: []TokenInfo{ + NewTokenInfo("ukex", "adr20", sdk.NewDec(1), true, math.ZeroInt(), math.ZeroInt(), sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false, "KEX", "KEX", "", 6, "", "", "", 0, math.ZeroInt(), "", false, "", ""), // 1 + NewTokenInfo("ubtc", "adr20", sdk.NewDec(10), true, math.ZeroInt(), math.ZeroInt(), sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false, "BTC", "Bitcoin", "", 9, "", "", "", 0, math.ZeroInt(), "", false, "", ""), // 10 + NewTokenInfo("xeth", "adr20", sdk.NewDecWithPrec(1, 1), true, math.ZeroInt(), math.ZeroInt(), sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false, "ETH", "Ethereum", "", 18, "", "", "", 0, math.ZeroInt(), "", false, "", ""), // 0.1 + NewTokenInfo("frozen", "adr20", sdk.NewDecWithPrec(1, 1), true, math.ZeroInt(), math.ZeroInt(), sdk.ZeroDec(), sdk.OneInt(), false, false, "FROZEN", "FROZEN", "", 6, "", "", "", 0, math.ZeroInt(), "", false, "", ""), // 0.1 }, - Rates: []*TokenRate{ - NewTokenRate("ukex", sdk.NewDec(1), true, sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false), // 1 - NewTokenRate("ubtc", sdk.NewDec(10), true, sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false), // 10 - NewTokenRate("xeth", sdk.NewDecWithPrec(1, 1), true, sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false), // 0.1 - NewTokenRate("frozen", sdk.NewDecWithPrec(1, 1), true, sdk.ZeroDec(), sdk.OneInt(), false, false), // 0.1 - }, - TokenBlackWhites: &TokensWhiteBlack{ + TokenBlackWhites: TokensWhiteBlack{ Whitelisted: []string{"ukex"}, Blacklisted: []string{"frozen"}, }, diff --git a/x/tokens/types/genesis.pb.go b/x/tokens/types/genesis.pb.go index 36a06b646..8145be4e5 100644 --- a/x/tokens/types/genesis.pb.go +++ b/x/tokens/types/genesis.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" math "math" @@ -23,9 +24,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { - Aliases []*TokenAlias `protobuf:"bytes,1,rep,name=aliases,proto3" json:"aliases,omitempty"` - Rates []*TokenRate `protobuf:"bytes,2,rep,name=rates,proto3" json:"rates,omitempty"` - TokenBlackWhites *TokensWhiteBlack `protobuf:"bytes,3,opt,name=tokenBlackWhites,proto3" json:"tokenBlackWhites,omitempty"` + TokenInfos []TokenInfo `protobuf:"bytes,1,rep,name=tokenInfos,proto3" json:"tokenInfos"` + TokenBlackWhites TokensWhiteBlack `protobuf:"bytes,2,opt,name=tokenBlackWhites,proto3" json:"tokenBlackWhites"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -61,25 +61,18 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetAliases() []*TokenAlias { +func (m *GenesisState) GetTokenInfos() []TokenInfo { if m != nil { - return m.Aliases + return m.TokenInfos } return nil } -func (m *GenesisState) GetRates() []*TokenRate { - if m != nil { - return m.Rates - } - return nil -} - -func (m *GenesisState) GetTokenBlackWhites() *TokensWhiteBlack { +func (m *GenesisState) GetTokenBlackWhites() TokensWhiteBlack { if m != nil { return m.TokenBlackWhites } - return nil + return TokensWhiteBlack{} } func init() { @@ -89,23 +82,23 @@ func init() { func init() { proto.RegisterFile("kira/tokens/genesis.proto", fileDescriptor_d3cbd9121e22d5d1) } var fileDescriptor_d3cbd9121e22d5d1 = []byte{ - // 254 bytes of a gzipped FileDescriptorProto + // 242 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xce, 0x2c, 0x4a, 0xd4, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x2b, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x06, 0x49, 0xe9, 0x41, 0xa4, 0xa4, 0xc4, 0x91, 0xd5, - 0x25, 0xe6, 0x64, 0x26, 0x42, 0x55, 0x49, 0x89, 0x21, 0x4b, 0x14, 0x25, 0x96, 0xa4, 0x42, 0xc5, - 0x25, 0x90, 0xc5, 0xd3, 0x8a, 0x52, 0x53, 0xab, 0xa0, 0x32, 0x4a, 0xbb, 0x18, 0xb9, 0x78, 0xdc, - 0x21, 0x36, 0x05, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x19, 0x72, 0xb1, 0x83, 0x4d, 0x4c, 0x2d, 0x96, - 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x12, 0xd7, 0x43, 0xb2, 0x5a, 0x2f, 0x04, 0x44, 0x39, 0x82, - 0x14, 0x04, 0xc1, 0xd4, 0x09, 0xe9, 0x70, 0xb1, 0x82, 0xec, 0x2a, 0x96, 0x60, 0x02, 0x6b, 0x10, - 0xc3, 0xd4, 0x10, 0x94, 0x58, 0x92, 0x1a, 0x04, 0x51, 0x24, 0xe4, 0xc9, 0x25, 0x00, 0x96, 0x72, - 0xca, 0x49, 0x4c, 0xce, 0x0e, 0xcf, 0xc8, 0x04, 0x69, 0x64, 0x56, 0x60, 0xd4, 0xe0, 0x36, 0x92, - 0xc5, 0xd4, 0x58, 0x0c, 0x56, 0x00, 0x56, 0x1a, 0x84, 0xa1, 0xcd, 0xc9, 0xe9, 0xc4, 0x23, 0x39, - 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, - 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x34, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, - 0xf3, 0x73, 0xf5, 0xbd, 0x33, 0x8b, 0x12, 0x9d, 0xf3, 0x8b, 0x52, 0xf5, 0x8b, 0x53, 0xb3, 0x13, - 0x33, 0xf5, 0x2b, 0x60, 0xe1, 0x50, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x07, 0x63, - 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xad, 0xea, 0x38, 0x58, 0x7c, 0x01, 0x00, 0x00, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x06, 0x49, 0xe9, 0x41, 0xa4, 0xa4, 0x44, 0xd2, 0xf3, + 0xd3, 0xf3, 0xc1, 0xe2, 0xfa, 0x20, 0x16, 0x44, 0x89, 0x94, 0x38, 0xb2, 0x6e, 0x30, 0x05, 0x95, + 0x90, 0x40, 0x96, 0x48, 0x2b, 0x4a, 0x4d, 0xad, 0x4a, 0x85, 0xc8, 0x28, 0xcd, 0x65, 0xe4, 0xe2, + 0x71, 0x87, 0xd8, 0x13, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc3, 0xc5, 0x05, 0x56, 0xe7, 0x99, + 0x97, 0x96, 0x5f, 0x2c, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0x6d, 0x24, 0xa6, 0x87, 0x64, 0xb7, 0x5e, + 0x08, 0x4c, 0xda, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0x24, 0xf5, 0x42, 0xfe, 0x5c, 0x02, + 0x60, 0x9e, 0x53, 0x4e, 0x62, 0x72, 0x76, 0x78, 0x46, 0x66, 0x49, 0x6a, 0xb1, 0x04, 0x93, 0x02, + 0xa3, 0x06, 0xb7, 0x91, 0x2c, 0xa6, 0x19, 0xc5, 0x60, 0x05, 0x60, 0xa5, 0x50, 0xa3, 0x30, 0x34, + 0x3b, 0x39, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, + 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x46, 0x7a, 0x66, + 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, 0x77, 0x66, 0x51, 0xa2, 0x73, 0x7e, 0x51, + 0xaa, 0x7e, 0x71, 0x6a, 0x76, 0x62, 0xa6, 0x7e, 0x05, 0x3c, 0x0c, 0x2a, 0x0b, 0x52, 0x8b, 0x93, + 0xd8, 0xc0, 0x5e, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x3e, 0x5d, 0x13, 0x5d, 0x01, + 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -128,36 +121,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.TokenBlackWhites != nil { - { - size, err := m.TokenBlackWhites.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Rates) > 0 { - for iNdEx := len(m.Rates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + { + size, err := m.TokenBlackWhites.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - if len(m.Aliases) > 0 { - for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { + i-- + dAtA[i] = 0x12 + if len(m.TokenInfos) > 0 { + for iNdEx := len(m.TokenInfos) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Aliases[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TokenInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -188,22 +165,14 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - if len(m.Aliases) > 0 { - for _, e := range m.Aliases { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Rates) > 0 { - for _, e := range m.Rates { + if len(m.TokenInfos) > 0 { + for _, e := range m.TokenInfos { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if m.TokenBlackWhites != nil { - l = m.TokenBlackWhites.Size() - n += 1 + l + sovGenesis(uint64(l)) - } + l = m.TokenBlackWhites.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -244,7 +213,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenInfos", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -271,46 +240,12 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Aliases = append(m.Aliases, &TokenAlias{}) - if err := m.Aliases[len(m.Aliases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.TokenInfos = append(m.TokenInfos, TokenInfo{}) + if err := m.TokenInfos[len(m.TokenInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rates", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Rates = append(m.Rates, &TokenRate{}) - if err := m.Rates[len(m.Rates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TokenBlackWhites", wireType) } @@ -339,9 +274,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.TokenBlackWhites == nil { - m.TokenBlackWhites = &TokensWhiteBlack{} - } if err := m.TokenBlackWhites.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/tokens/types/msg_alias.go b/x/tokens/types/msg_alias.go deleted file mode 100644 index 267f615f7..000000000 --- a/x/tokens/types/msg_alias.go +++ /dev/null @@ -1,59 +0,0 @@ -package types - -import ( - "github.com/KiraCore/sekai/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - _ sdk.Msg = &MsgUpsertTokenAlias{} -) - -// NewMsgUpsertTokenAlias returns an instance of MsgUpsertTokenAlias -func NewMsgUpsertTokenAlias( - proposer sdk.AccAddress, - symbol string, - name string, - icon string, - decimals uint32, - denoms []string, - invalidated bool, -) *MsgUpsertTokenAlias { - return &MsgUpsertTokenAlias{ - Proposer: proposer, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, - Denoms: denoms, - Invalidated: invalidated, - } -} - -// Route returns route -func (m *MsgUpsertTokenAlias) Route() string { - return ModuleName -} - -// Type returns return message type -func (m *MsgUpsertTokenAlias) Type() string { - return types.MsgTypeUpsertTokenAlias -} - -// ValidateBasic returns basic validation result -func (m *MsgUpsertTokenAlias) ValidateBasic() error { - return nil -} - -// GetSignBytes returns to sign bytes -func (m *MsgUpsertTokenAlias) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(m) - return sdk.MustSortJSON(bz) -} - -// GetSigners returns signers -func (m *MsgUpsertTokenAlias) GetSigners() []sdk.AccAddress { - return []sdk.AccAddress{ - m.Proposer, - } -} diff --git a/x/tokens/types/msg_rate.go b/x/tokens/types/msg_rate.go deleted file mode 100644 index 689ab4c10..000000000 --- a/x/tokens/types/msg_rate.go +++ /dev/null @@ -1,80 +0,0 @@ -package types - -import ( - "errors" - - appparams "github.com/KiraCore/sekai/app/params" - "github.com/KiraCore/sekai/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - _ sdk.Msg = &MsgUpsertTokenRate{} -) - -// NewMsgUpsertTokenRate returns an instance of MsgUpserTokenRate -func NewMsgUpsertTokenRate( - proposer sdk.AccAddress, - denom string, - rate sdk.Dec, - feePayments bool, - stakeCap sdk.Dec, - stakeMin sdk.Int, - stakeToken bool, - invalidated bool, -) *MsgUpsertTokenRate { - return &MsgUpsertTokenRate{ - Proposer: proposer, - Denom: denom, - Rate: rate, - FeePayments: feePayments, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeToken: stakeToken, - Invalidated: invalidated, - } -} - -// Route returns route -func (m *MsgUpsertTokenRate) Route() string { - return ModuleName -} - -// Type returns return message type -func (m *MsgUpsertTokenRate) Type() string { - return types.MsgTypeUpsertTokenRate -} - -// ValidateBasic returns basic validation result -func (m *MsgUpsertTokenRate) ValidateBasic() error { - if m.Denom == appparams.DefaultDenom { - return errors.New("bond denom rate is read-only") - } - - if m.Rate.LTE(sdk.NewDec(0)) { // not positive - return errors.New("rate should be positive") - } - - if m.StakeCap.LT(sdk.NewDec(0)) { // not positive - return errors.New("reward cap should be positive") - } - - if m.StakeCap.GT(sdk.OneDec()) { // more than 1 - return errors.New("reward cap not be more than 100%") - } - - return nil -} - -// GetSignBytes returns to sign bytes -func (m *MsgUpsertTokenRate) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(m) - return sdk.MustSortJSON(bz) -} - -// GetSigners returns signers -func (m *MsgUpsertTokenRate) GetSigners() []sdk.AccAddress { - return []sdk.AccAddress{ - m.Proposer, - } -} diff --git a/x/tokens/types/msg_token_info.go b/x/tokens/types/msg_token_info.go new file mode 100644 index 000000000..ea4ab2dce --- /dev/null +++ b/x/tokens/types/msg_token_info.go @@ -0,0 +1,113 @@ +package types + +import ( + "errors" + + "cosmossdk.io/math" + appparams "github.com/KiraCore/sekai/app/params" + "github.com/KiraCore/sekai/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + _ sdk.Msg = &MsgUpsertTokenInfo{} +) + +// NewMsgUpsertTokenInfo returns an instance of MsgUpserTokenInfo +func NewMsgUpsertTokenInfo( + proposer sdk.AccAddress, + denom string, + tokenType string, + feeRate math.LegacyDec, + feeEnabled bool, + supply math.Int, + supplyCap math.Int, + stakeCap math.LegacyDec, + stakeMin math.Int, + stakeEnabled bool, + inactive bool, + symbol string, + name string, + icon string, + decimals uint32, + description string, + website string, + social string, + holders uint64, + mintingFee math.Int, + owner string, + ownerEditDisabled bool, + nftMetadata string, + nftHash string, +) *MsgUpsertTokenInfo { + return &MsgUpsertTokenInfo{ + Proposer: proposer, + Denom: denom, + TokenType: tokenType, + FeeRate: feeRate, + FeeEnabled: feeEnabled, + Supply: supply, + SupplyCap: supplyCap, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, + Description: description, + Website: website, + Social: social, + Holders: holders, + MintingFee: mintingFee, + Owner: owner, + OwnerEditDisabled: ownerEditDisabled, + NftMetadata: nftMetadata, + NftHash: nftHash, + } +} + +// Route returns route +func (m *MsgUpsertTokenInfo) Route() string { + return ModuleName +} + +// Type returns return message type +func (m *MsgUpsertTokenInfo) Type() string { + return types.MsgTypeUpsertTokenInfo +} + +// ValidateBasic returns basic validation result +func (m *MsgUpsertTokenInfo) ValidateBasic() error { + if m.Denom == appparams.DefaultDenom { + return errors.New("bond denom rate is read-only") + } + + if !m.FeeRate.IsPositive() { // not positive + return errors.New("rate should be positive") + } + + if m.StakeCap.LT(sdk.NewDec(0)) { // not positive + return errors.New("reward cap should be positive") + } + + if m.StakeCap.GT(sdk.OneDec()) { // more than 1 + return errors.New("reward cap not be more than 100%") + } + + return nil +} + +// GetSignBytes returns to sign bytes +func (m *MsgUpsertTokenInfo) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(m) + return sdk.MustSortJSON(bz) +} + +// GetSigners returns signers +func (m *MsgUpsertTokenInfo) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{ + m.Proposer, + } +} diff --git a/x/tokens/types/proposal.go b/x/tokens/types/proposal.go index 82a7ebef6..5287fff1a 100644 --- a/x/tokens/types/proposal.go +++ b/x/tokens/types/proposal.go @@ -3,86 +3,83 @@ package types import ( "errors" + "cosmossdk.io/math" kiratypes "github.com/KiraCore/sekai/types" "github.com/KiraCore/sekai/x/gov/types" sdk "github.com/cosmos/cosmos-sdk/types" ) var ( - _ types.Content = &ProposalUpsertTokenAlias{} - _ types.Content = &ProposalUpsertTokenRates{} + _ types.Content = &ProposalUpsertTokenInfo{} _ types.Content = &ProposalTokensWhiteBlackChange{} ) -func NewUpsertTokenAliasProposal( +func NewUpsertTokenInfosProposal( + denom string, + tokenType string, + feeRate math.LegacyDec, + feeEnabled bool, + supply math.Int, + supplyCap math.Int, + stakeCap math.LegacyDec, + stakeMin math.Int, + stakeEnabled bool, + inactive bool, symbol string, name string, icon string, decimals uint32, - denoms []string, - isInvalidated bool, -) *ProposalUpsertTokenAlias { - return &ProposalUpsertTokenAlias{ - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, - Denoms: denoms, - Invalidated: isInvalidated, - } -} - -func (m *ProposalUpsertTokenAlias) ProposalType() string { - return kiratypes.ProposalTypeUpsertTokenAlias -} - -func (m *ProposalUpsertTokenAlias) ProposalPermission() types.PermValue { - return types.PermCreateUpsertTokenAliasProposal -} - -func (m *ProposalUpsertTokenAlias) VotePermission() types.PermValue { - return types.PermVoteUpsertTokenAliasProposal -} - -// ValidateBasic returns basic validation -func (m *ProposalUpsertTokenAlias) ValidateBasic() error { - return nil -} - -func NewUpsertTokenRatesProposal( - denom string, - rate sdk.Dec, - feePayments bool, - stakeCap sdk.Dec, - stakeMin sdk.Int, - stakeToken bool, - isInvalidated bool, -) *ProposalUpsertTokenRates { - return &ProposalUpsertTokenRates{ - Denom: denom, - Rate: rate, - FeePayments: feePayments, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeToken: stakeToken, - Invalidated: isInvalidated, + description string, + website string, + social string, + holders uint64, + mintingFee math.Int, + owner string, + ownerEditDisabled bool, + nftMetadata string, + nftHash string, +) *ProposalUpsertTokenInfo { + return &ProposalUpsertTokenInfo{ + Denom: denom, + TokenType: tokenType, + FeeRate: feeRate, + FeeEnabled: feeEnabled, + Supply: supply, + SupplyCap: supplyCap, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, + Description: description, + Website: website, + Social: social, + Holders: holders, + MintingFee: mintingFee, + Owner: owner, + OwnerEditDisabled: ownerEditDisabled, + NftMetadata: nftMetadata, + NftHash: nftHash, } } -func (m *ProposalUpsertTokenRates) ProposalType() string { - return kiratypes.ProposalTypeUpsertTokenRates +func (m *ProposalUpsertTokenInfo) ProposalType() string { + return kiratypes.ProposalTypeUpsertTokenInfos } -func (m *ProposalUpsertTokenRates) ProposalPermission() types.PermValue { - return types.PermCreateUpsertTokenRateProposal +func (m *ProposalUpsertTokenInfo) ProposalPermission() types.PermValue { + return types.PermCreateUpsertTokenInfoProposal } -func (m *ProposalUpsertTokenRates) VotePermission() types.PermValue { - return types.PermVoteUpsertTokenRateProposal +func (m *ProposalUpsertTokenInfo) VotePermission() types.PermValue { + return types.PermVoteUpsertTokenInfoProposal } // ValidateBasic returns basic validation -func (m *ProposalUpsertTokenRates) ValidateBasic() error { +func (m *ProposalUpsertTokenInfo) ValidateBasic() error { if m.StakeCap.LT(sdk.NewDec(0)) { // not positive return errors.New("reward cap should be positive") } diff --git a/x/tokens/types/proposal.pb.go b/x/tokens/types/proposal.pb.go index 03b062989..a733fa296 100644 --- a/x/tokens/types/proposal.pb.go +++ b/x/tokens/types/proposal.pb.go @@ -25,27 +25,44 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type ProposalUpsertTokenAlias struct { - Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` - Denoms []string `protobuf:"bytes,5,rep,name=denoms,proto3" json:"denoms,omitempty"` - Invalidated bool `protobuf:"varint,6,opt,name=invalidated,proto3" json:"invalidated,omitempty"` +type ProposalUpsertTokenInfo struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` + FeeEnabled bool `protobuf:"varint,4,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` + Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` + SupplyCap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=supply_cap,json=supplyCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply_cap"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeEnabled bool `protobuf:"varint,9,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,10,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,11,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,13,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,14,opt,name=decimals,proto3" json:"decimals,omitempty"` + Description string `protobuf:"bytes,15,opt,name=description,proto3" json:"description,omitempty"` + Website string `protobuf:"bytes,16,opt,name=website,proto3" json:"website,omitempty"` + Social string `protobuf:"bytes,17,opt,name=social,proto3" json:"social,omitempty"` + Holders uint64 `protobuf:"varint,18,opt,name=holders,proto3" json:"holders,omitempty"` + MintingFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,19,opt,name=minting_fee,json=mintingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"minting_fee"` + Owner string `protobuf:"bytes,20,opt,name=owner,proto3" json:"owner,omitempty"` + OwnerEditDisabled bool `protobuf:"varint,21,opt,name=owner_edit_disabled,json=ownerEditDisabled,proto3" json:"owner_edit_disabled,omitempty"` + NftMetadata string `protobuf:"bytes,22,opt,name=nft_metadata,json=nftMetadata,proto3" json:"nft_metadata,omitempty"` + NftHash string `protobuf:"bytes,23,opt,name=nft_hash,json=nftHash,proto3" json:"nft_hash,omitempty"` } -func (m *ProposalUpsertTokenAlias) Reset() { *m = ProposalUpsertTokenAlias{} } -func (m *ProposalUpsertTokenAlias) String() string { return proto.CompactTextString(m) } -func (*ProposalUpsertTokenAlias) ProtoMessage() {} -func (*ProposalUpsertTokenAlias) Descriptor() ([]byte, []int) { +func (m *ProposalUpsertTokenInfo) Reset() { *m = ProposalUpsertTokenInfo{} } +func (m *ProposalUpsertTokenInfo) String() string { return proto.CompactTextString(m) } +func (*ProposalUpsertTokenInfo) ProtoMessage() {} +func (*ProposalUpsertTokenInfo) Descriptor() ([]byte, []int) { return fileDescriptor_68008d794328e180, []int{0} } -func (m *ProposalUpsertTokenAlias) XXX_Unmarshal(b []byte) error { +func (m *ProposalUpsertTokenInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ProposalUpsertTokenAlias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ProposalUpsertTokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ProposalUpsertTokenAlias.Marshal(b, m, deterministic) + return xxx_messageInfo_ProposalUpsertTokenInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -55,179 +72,194 @@ func (m *ProposalUpsertTokenAlias) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *ProposalUpsertTokenAlias) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposalUpsertTokenAlias.Merge(m, src) +func (m *ProposalUpsertTokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalUpsertTokenInfo.Merge(m, src) } -func (m *ProposalUpsertTokenAlias) XXX_Size() int { +func (m *ProposalUpsertTokenInfo) XXX_Size() int { return m.Size() } -func (m *ProposalUpsertTokenAlias) XXX_DiscardUnknown() { - xxx_messageInfo_ProposalUpsertTokenAlias.DiscardUnknown(m) +func (m *ProposalUpsertTokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalUpsertTokenInfo.DiscardUnknown(m) } -var xxx_messageInfo_ProposalUpsertTokenAlias proto.InternalMessageInfo +var xxx_messageInfo_ProposalUpsertTokenInfo proto.InternalMessageInfo -func (m *ProposalUpsertTokenAlias) GetSymbol() string { +func (m *ProposalUpsertTokenInfo) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetTokenType() string { + if m != nil { + return m.TokenType + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetFeeEnabled() bool { + if m != nil { + return m.FeeEnabled + } + return false +} + +func (m *ProposalUpsertTokenInfo) GetStakeEnabled() bool { + if m != nil { + return m.StakeEnabled + } + return false +} + +func (m *ProposalUpsertTokenInfo) GetInactive() bool { + if m != nil { + return m.Inactive + } + return false +} + +func (m *ProposalUpsertTokenInfo) GetSymbol() string { if m != nil { return m.Symbol } return "" } -func (m *ProposalUpsertTokenAlias) GetName() string { +func (m *ProposalUpsertTokenInfo) GetName() string { if m != nil { return m.Name } return "" } -func (m *ProposalUpsertTokenAlias) GetIcon() string { +func (m *ProposalUpsertTokenInfo) GetIcon() string { if m != nil { return m.Icon } return "" } -func (m *ProposalUpsertTokenAlias) GetDecimals() uint32 { +func (m *ProposalUpsertTokenInfo) GetDecimals() uint32 { if m != nil { return m.Decimals } return 0 } -func (m *ProposalUpsertTokenAlias) GetDenoms() []string { +func (m *ProposalUpsertTokenInfo) GetDescription() string { if m != nil { - return m.Denoms + return m.Description } - return nil + return "" } -func (m *ProposalUpsertTokenAlias) GetInvalidated() bool { +func (m *ProposalUpsertTokenInfo) GetWebsite() string { if m != nil { - return m.Invalidated + return m.Website } - return false + return "" } -type ProposalUpsertTokenRates struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate" yaml:"rate"` - FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` - Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` +func (m *ProposalUpsertTokenInfo) GetSocial() string { + if m != nil { + return m.Social + } + return "" } -func (m *ProposalUpsertTokenRates) Reset() { *m = ProposalUpsertTokenRates{} } -func (m *ProposalUpsertTokenRates) String() string { return proto.CompactTextString(m) } -func (*ProposalUpsertTokenRates) ProtoMessage() {} -func (*ProposalUpsertTokenRates) Descriptor() ([]byte, []int) { - return fileDescriptor_68008d794328e180, []int{1} -} -func (m *ProposalUpsertTokenRates) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProposalUpsertTokenRates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProposalUpsertTokenRates.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 *ProposalUpsertTokenInfo) GetHolders() uint64 { + if m != nil { + return m.Holders } -} -func (m *ProposalUpsertTokenRates) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposalUpsertTokenRates.Merge(m, src) -} -func (m *ProposalUpsertTokenRates) XXX_Size() int { - return m.Size() -} -func (m *ProposalUpsertTokenRates) XXX_DiscardUnknown() { - xxx_messageInfo_ProposalUpsertTokenRates.DiscardUnknown(m) + return 0 } -var xxx_messageInfo_ProposalUpsertTokenRates proto.InternalMessageInfo - -func (m *ProposalUpsertTokenRates) GetDenom() string { +func (m *ProposalUpsertTokenInfo) GetOwner() string { if m != nil { - return m.Denom + return m.Owner } return "" } -func (m *ProposalUpsertTokenRates) GetFeePayments() bool { +func (m *ProposalUpsertTokenInfo) GetOwnerEditDisabled() bool { if m != nil { - return m.FeePayments + return m.OwnerEditDisabled } return false } -func (m *ProposalUpsertTokenRates) GetStakeToken() bool { +func (m *ProposalUpsertTokenInfo) GetNftMetadata() string { if m != nil { - return m.StakeToken + return m.NftMetadata } - return false + return "" } -func (m *ProposalUpsertTokenRates) GetInvalidated() bool { +func (m *ProposalUpsertTokenInfo) GetNftHash() string { if m != nil { - return m.Invalidated + return m.NftHash } - return false + return "" } func init() { - proto.RegisterType((*ProposalUpsertTokenAlias)(nil), "kira.tokens.ProposalUpsertTokenAlias") - proto.RegisterType((*ProposalUpsertTokenRates)(nil), "kira.tokens.ProposalUpsertTokenRates") + proto.RegisterType((*ProposalUpsertTokenInfo)(nil), "kira.tokens.ProposalUpsertTokenInfo") } func init() { proto.RegisterFile("kira/tokens/proposal.proto", fileDescriptor_68008d794328e180) } var fileDescriptor_68008d794328e180 = []byte{ - // 460 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xbf, 0x8f, 0xd3, 0x30, - 0x14, 0xae, 0xe9, 0x8f,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, 0xcd, 0x6d, 0x07, 0x1b, 0xca, 0x64, 0x7e, 0x7d, 0x7d, 0x07, 0x37, 0xaf, 0x2f, 0x4d, 0xcf, - 0xb6, 0x01, 0x3a, 0xdf, 0x06, 0xe8, 0xd7, 0x36, 0x40, 0x9f, 0x76, 0x41, 0xef, 0x7c, 0x17, 0xf4, - 0x7e, 0xec, 0x82, 0xde, 0xdb, 0xd9, 0x95, 0x33, 0xbf, 0x60, 0x0d, 0x5d, 0xc8, 0x06, 0x12, 0x05, - 0x25, 0x65, 0xc9, 0xc7, 0x8b, 0xd7, 0x60, 0x4e, 0xbe, 0x1a, 0x99, 0xdb, 0xfc, 0xf8, 0x6f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x2e, 0xe0, 0x26, 0xef, 0x29, 0x03, 0x00, 0x00, + // 620 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcb, 0x6e, 0x13, 0x31, + 0x14, 0xcd, 0x40, 0x9b, 0x4c, 0x6e, 0x5a, 0xda, 0xba, 0xa5, 0x75, 0x23, 0x91, 0x84, 0x22, 0xa1, + 0x6c, 0x9a, 0x2c, 0xd8, 0x75, 0x99, 0x3e, 0x44, 0x84, 0x2a, 0xd0, 0xa8, 0x6c, 0xd8, 0x8c, 0x9c, + 0x99, 0x3b, 0x89, 0x95, 0x19, 0x7b, 0x34, 0x76, 0x29, 0xd9, 0xf3, 0x01, 0x7c, 0x02, 0x1f, 0xc1, + 0x47, 0x54, 0xac, 0xba, 0x44, 0x2c, 0x2a, 0xd4, 0x6e, 0x58, 0xf3, 0x05, 0xc8, 0xf6, 0xa4, 0x2a, + 0xec, 0xd2, 0xd5, 0xdc, 0x73, 0xce, 0xf8, 0xdc, 0xeb, 0x23, 0xdb, 0xd0, 0x9c, 0xf2, 0x82, 0xf5, + 0xb5, 0x9c, 0xa2, 0x50, 0xfd, 0xbc, 0x90, 0xb9, 0x54, 0x2c, 0xed, 0xe5, 0x85, 0xd4, 0x92, 0x34, + 0x8c, 0xd6, 0x73, 0x5a, 0x73, 0x6b, 0x2c, 0xc7, 0xd2, 0xf2, 0x7d, 0x53, 0xb9, 0x5f, 0x9a, 0xbb, + 0x91, 0x54, 0x99, 0x54, 0xa1, 0x13, 0x1c, 0x70, 0xd2, 0xde, 0x67, 0x1f, 0x76, 0xde, 0x95, 0x86, + 0xef, 0x73, 0x85, 0x85, 0x3e, 0x33, 0x4e, 0x43, 0x91, 0x48, 0xb2, 0x05, 0xcb, 0x31, 0x0a, 0x99, + 0x51, 0xaf, 0xe3, 0x75, 0xeb, 0x81, 0x03, 0xe4, 0x19, 0x80, 0x6d, 0x16, 0xea, 0x59, 0x8e, 0xf4, + 0x91, 0x95, 0xea, 0x96, 0x39, 0x9b, 0xe5, 0x48, 0x86, 0xe0, 0x27, 0x88, 0x61, 0xc1, 0x34, 0xd2, + 0xc7, 0x46, 0x1c, 0xf4, 0x2e, 0xaf, 0xdb, 0x95, 0x9f, 0xd7, 0xed, 0x97, 0x63, 0xae, 0x27, 0xe7, + 0xa3, 0x5e, 0x24, 0xb3, 0x72, 0x86, 0xf2, 0xb3, 0xaf, 0xe2, 0x69, 0xdf, 0xb8, 0xa9, 0xde, 0x11, + 0x46, 0x41, 0x2d, 0x41, 0x0c, 0x98, 0x46, 0xd2, 0x86, 0x86, 0xb1, 0x42, 0xc1, 0x46, 0x29, 0xc6, + 0x74, 0xa9, 0xe3, 0x75, 0xfd, 0x00, 0x12, 0xc4, 0x63, 0xc7, 0x90, 0x13, 0xa8, 0xaa, 0xf3, 0x3c, + 0x4f, 0x67, 0x74, 0x79, 0xe1, 0x4e, 0x43, 0xa1, 0x83, 0x72, 0x35, 0x39, 0x05, 0x70, 0x55, 0x18, + 0xb1, 0x9c, 0x56, 0x1f, 0xe4, 0x55, 0x77, 0x0e, 0x87, 0x2c, 0x27, 0x21, 0xd4, 0x95, 0x66, 0x53, + 0xb4, 0x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e4, 0x85, 0xc0, 0x82, 0x6e, 0xb9, 0x5b, + 0x65, 0x01, 0xe9, 0xc1, 0xa6, 0x2d, 0x42, 0x8c, 0xb9, 0x0e, 0x63, 0xae, 0x5c, 0xee, 0x4f, 0x6d, + 0xae, 0x1b, 0x56, 0x3a, 0x8e, 0xb9, 0x3e, 0x2a, 0x05, 0xf2, 0x1c, 0x56, 0x44, 0xa2, 0xc3, 0x0c, + 0x35, 0x8b, 0x99, 0x66, 0x74, 0xdb, 0xa5, 0x20, 0x12, 0x7d, 0x5a, 0x52, 0x64, 0x17, 0x7c, 0xf3, + 0xcb, 0x84, 0xa9, 0x09, 0xdd, 0x71, 0x31, 0x88, 0x44, 0xbf, 0x66, 0x6a, 0x72, 0xb0, 0xf6, 0xfb, + 0x6b, 0xdb, 0xfb, 0xfe, 0x6d, 0xbf, 0x76, 0x28, 0x85, 0x46, 0xa1, 0x07, 0x83, 0xcb, 0x9b, 0x96, + 0x77, 0x75, 0xd3, 0xf2, 0x7e, 0xdd, 0xb4, 0xbc, 0x2f, 0xb7, 0xad, 0xca, 0xd5, 0x6d, 0xab, 0xf2, + 0xe3, 0xb6, 0x55, 0xf9, 0xd0, 0xbd, 0xb7, 0xc5, 0x37, 0xbc, 0x60, 0x87, 0xb2, 0xc0, 0xbe, 0xc2, + 0x29, 0xe3, 0xfd, 0x4f, 0xf3, 0x17, 0xc9, 0x6e, 0x74, 0x54, 0xb5, 0x2f, 0xca, 0xab, 0xbf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xde, 0x6c, 0xdd, 0xd4, 0xad, 0x04, 0x00, 0x00, } -func (this *ProposalUpsertTokenAlias) Equal(that interface{}) bool { +func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*ProposalUpsertTokenAlias) + that1, ok := that.(*ProposalUpsertTokenInfo) if !ok { - that2, ok := that.(ProposalUpsertTokenAlias) + that2, ok := that.(ProposalUpsertTokenInfo) if ok { that1 = &that2 } else { @@ -239,74 +271,78 @@ func (this *ProposalUpsertTokenAlias) Equal(that interface{}) bool { } else if this == nil { return false } - if this.Symbol != that1.Symbol { + if this.Denom != that1.Denom { return false } - if this.Name != that1.Name { + if this.TokenType != that1.TokenType { return false } - if this.Icon != that1.Icon { + if !this.FeeRate.Equal(that1.FeeRate) { return false } - if this.Decimals != that1.Decimals { + if this.FeeEnabled != that1.FeeEnabled { return false } - if len(this.Denoms) != len(that1.Denoms) { + if !this.Supply.Equal(that1.Supply) { return false } - for i := range this.Denoms { - if this.Denoms[i] != that1.Denoms[i] { - return false - } + if !this.SupplyCap.Equal(that1.SupplyCap) { + return false } - if this.Invalidated != that1.Invalidated { + if !this.StakeCap.Equal(that1.StakeCap) { return false } - return true -} -func (this *ProposalUpsertTokenRates) Equal(that interface{}) bool { - if that == nil { - return this == nil + if !this.StakeMin.Equal(that1.StakeMin) { + return false } - - that1, ok := that.(*ProposalUpsertTokenRates) - if !ok { - that2, ok := that.(ProposalUpsertTokenRates) - if ok { - that1 = &that2 - } else { - return false - } + if this.StakeEnabled != that1.StakeEnabled { + return false } - if that1 == nil { - return this == nil - } else if this == nil { + if this.Inactive != that1.Inactive { return false } - if this.Denom != that1.Denom { + if this.Symbol != that1.Symbol { return false } - if !this.Rate.Equal(that1.Rate) { + if this.Name != that1.Name { return false } - if this.FeePayments != that1.FeePayments { + if this.Icon != that1.Icon { return false } - if !this.StakeCap.Equal(that1.StakeCap) { + if this.Decimals != that1.Decimals { return false } - if !this.StakeMin.Equal(that1.StakeMin) { + if this.Description != that1.Description { + return false + } + if this.Website != that1.Website { + return false + } + if this.Social != that1.Social { + return false + } + if this.Holders != that1.Holders { + return false + } + if !this.MintingFee.Equal(that1.MintingFee) { + return false + } + if this.Owner != that1.Owner { + return false + } + if this.OwnerEditDisabled != that1.OwnerEditDisabled { return false } - if this.StakeToken != that1.StakeToken { + if this.NftMetadata != that1.NftMetadata { return false } - if this.Invalidated != that1.Invalidated { + if this.NftHash != that1.NftHash { return false } return true } -func (m *ProposalUpsertTokenAlias) Marshal() (dAtA []byte, err error) { +func (m *ProposalUpsertTokenInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -316,103 +352,144 @@ func (m *ProposalUpsertTokenAlias) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ProposalUpsertTokenAlias) MarshalTo(dAtA []byte) (int, error) { +func (m *ProposalUpsertTokenInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ProposalUpsertTokenAlias) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Invalidated { + if len(m.NftHash) > 0 { + i -= len(m.NftHash) + copy(dAtA[i:], m.NftHash) + i = encodeVarintProposal(dAtA, i, uint64(len(m.NftHash))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.NftMetadata) > 0 { + i -= len(m.NftMetadata) + copy(dAtA[i:], m.NftMetadata) + i = encodeVarintProposal(dAtA, i, uint64(len(m.NftMetadata))) i-- - if m.Invalidated { + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.OwnerEditDisabled { + i-- + if m.OwnerEditDisabled { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x30 - } - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x2a + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + { + size := m.MintingFee.Size() + i -= size + if _, err := m.MintingFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err } + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + if m.Holders != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.Holders)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if len(m.Social) > 0 { + i -= len(m.Social) + copy(dAtA[i:], m.Social) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Social))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x7a } if m.Decimals != 0 { i = encodeVarintProposal(dAtA, i, uint64(m.Decimals)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x70 } if len(m.Icon) > 0 { i -= len(m.Icon) copy(dAtA[i:], m.Icon) i = encodeVarintProposal(dAtA, i, uint64(len(m.Icon))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x6a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintProposal(dAtA, i, uint64(len(m.Name))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x62 } if len(m.Symbol) > 0 { i -= len(m.Symbol) copy(dAtA[i:], m.Symbol) i = encodeVarintProposal(dAtA, i, uint64(len(m.Symbol))) i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProposalUpsertTokenRates) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + dAtA[i] = 0x5a } - return dAtA[:n], nil -} - -func (m *ProposalUpsertTokenRates) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProposalUpsertTokenRates) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Invalidated { + if m.Inactive { i-- - if m.Invalidated { + if m.Inactive { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x38 + dAtA[i] = 0x50 } - if m.StakeToken { + if m.StakeEnabled { i-- - if m.StakeToken { + if m.StakeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x30 + dAtA[i] = 0x48 } { size := m.StakeMin.Size() @@ -423,7 +500,7 @@ func (m *ProposalUpsertTokenRates) MarshalToSizedBuffer(dAtA []byte) (int, error i = encodeVarintProposal(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x42 { size := m.StakeCap.Size() i -= size @@ -433,27 +510,54 @@ func (m *ProposalUpsertTokenRates) MarshalToSizedBuffer(dAtA []byte) (int, error i = encodeVarintProposal(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 - if m.FeePayments { + dAtA[i] = 0x3a + { + size := m.SupplyCap.Size() + i -= size + if _, err := m.SupplyCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.Supply.Size() + i -= size + if _, err := m.Supply.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.FeeEnabled { i-- - if m.FeePayments { + if m.FeeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x20 } { - size := m.Rate.Size() + size := m.FeeRate.Size() i -= size - if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintProposal(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + if len(m.TokenType) > 0 { + i -= len(m.TokenType) + copy(dAtA[i:], m.TokenType) + i = encodeVarintProposal(dAtA, i, uint64(len(m.TokenType))) + i-- + dAtA[i] = 0x12 + } if len(m.Denom) > 0 { i -= len(m.Denom) copy(dAtA[i:], m.Denom) @@ -475,12 +579,39 @@ func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *ProposalUpsertTokenAlias) Size() (n int) { +func (m *ProposalUpsertTokenInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.TokenType) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = m.FeeRate.Size() + n += 1 + l + sovProposal(uint64(l)) + if m.FeeEnabled { + n += 2 + } + l = m.Supply.Size() + n += 1 + l + sovProposal(uint64(l)) + l = m.SupplyCap.Size() + n += 1 + l + sovProposal(uint64(l)) + l = m.StakeCap.Size() + n += 1 + l + sovProposal(uint64(l)) + l = m.StakeMin.Size() + n += 1 + l + sovProposal(uint64(l)) + if m.StakeEnabled { + n += 2 + } + if m.Inactive { + n += 2 + } l = len(m.Symbol) if l > 0 { n += 1 + l + sovProposal(uint64(l)) @@ -496,42 +627,37 @@ func (m *ProposalUpsertTokenAlias) Size() (n int) { if m.Decimals != 0 { n += 1 + sovProposal(uint64(m.Decimals)) } - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovProposal(uint64(l)) - } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) } - if m.Invalidated { - n += 2 + l = len(m.Website) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) } - return n -} - -func (m *ProposalUpsertTokenRates) Size() (n int) { - if m == nil { - return 0 + l = len(m.Social) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) } - var l int - _ = l - l = len(m.Denom) + if m.Holders != 0 { + n += 2 + sovProposal(uint64(m.Holders)) + } + l = m.MintingFee.Size() + n += 2 + l + sovProposal(uint64(l)) + l = len(m.Owner) if l > 0 { - n += 1 + l + sovProposal(uint64(l)) + n += 2 + l + sovProposal(uint64(l)) } - l = m.Rate.Size() - n += 1 + l + sovProposal(uint64(l)) - if m.FeePayments { - n += 2 + if m.OwnerEditDisabled { + n += 3 } - l = m.StakeCap.Size() - n += 1 + l + sovProposal(uint64(l)) - l = m.StakeMin.Size() - n += 1 + l + sovProposal(uint64(l)) - if m.StakeToken { - n += 2 + l = len(m.NftMetadata) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) } - if m.Invalidated { - n += 2 + l = len(m.NftHash) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) } return n } @@ -542,7 +668,7 @@ func sovProposal(x uint64) (n int) { func sozProposal(x uint64) (n int) { return sovProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { +func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -565,15 +691,15 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ProposalUpsertTokenAlias: wiretype end group for non-group") + return fmt.Errorf("proto: ProposalUpsertTokenInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ProposalUpsertTokenAlias: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProposalUpsertTokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -601,11 +727,11 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Symbol = string(dAtA[iNdEx:postIndex]) + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -633,11 +759,11 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.TokenType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -665,13 +791,15 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Icon = string(dAtA[iNdEx:postIndex]) + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } - m.Decimals = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -681,14 +809,15 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Decimals |= uint32(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } + m.FeeEnabled = bool(v != 0) case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -716,13 +845,15 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplyCap", wireType) } - var v int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -732,65 +863,29 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.Invalidated = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal } - if (skippy < 0) || (iNdEx+skippy) < 0 { + postIndex := iNdEx + intStringLen + if postIndex < 0 { return ErrInvalidLengthProposal } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProposalUpsertTokenRates) 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if err := m.SupplyCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProposalUpsertTokenRates: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProposalUpsertTokenRates: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -818,11 +913,13 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -850,13 +947,13 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 9: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -873,10 +970,30 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { break } } - m.FeePayments = bool(v != 0) - case 4: + m.StakeEnabled = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Inactive = bool(v != 0) + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -904,13 +1021,43 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -938,15 +1085,128 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Icon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + 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 ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimals |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Social", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Social = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Holders", wireType) } - var v int + m.Holders = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -956,15 +1216,80 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Holders |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.StakeToken = bool(v != 0) - case 7: + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintingFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MintingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OwnerEditDisabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -981,7 +1306,71 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { break } } - m.Invalidated = bool(v != 0) + m.OwnerEditDisabled = bool(v != 0) + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftMetadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NftMetadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NftHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProposal(dAtA[iNdEx:]) diff --git a/x/tokens/types/query.pb.go b/x/tokens/types/query.pb.go index e878417d7..54c3253d5 100644 --- a/x/tokens/types/query.pb.go +++ b/x/tokens/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -29,22 +30,22 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type TokenAliasRequest struct { - Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` +type TokenInfoRequest struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` } -func (m *TokenAliasRequest) Reset() { *m = TokenAliasRequest{} } -func (m *TokenAliasRequest) String() string { return proto.CompactTextString(m) } -func (*TokenAliasRequest) ProtoMessage() {} -func (*TokenAliasRequest) Descriptor() ([]byte, []int) { +func (m *TokenInfoRequest) Reset() { *m = TokenInfoRequest{} } +func (m *TokenInfoRequest) String() string { return proto.CompactTextString(m) } +func (*TokenInfoRequest) ProtoMessage() {} +func (*TokenInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_c8db6e46fba94960, []int{0} } -func (m *TokenAliasRequest) XXX_Unmarshal(b []byte) error { +func (m *TokenInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenAliasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenAliasRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -54,225 +55,42 @@ func (m *TokenAliasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *TokenAliasRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasRequest.Merge(m, src) +func (m *TokenInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfoRequest.Merge(m, src) } -func (m *TokenAliasRequest) XXX_Size() int { +func (m *TokenInfoRequest) XXX_Size() int { return m.Size() } -func (m *TokenAliasRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasRequest.DiscardUnknown(m) +func (m *TokenInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfoRequest.DiscardUnknown(m) } -var xxx_messageInfo_TokenAliasRequest proto.InternalMessageInfo +var xxx_messageInfo_TokenInfoRequest proto.InternalMessageInfo -func (m *TokenAliasRequest) GetSymbol() string { +func (m *TokenInfoRequest) GetDenom() string { if m != nil { - return m.Symbol + return m.Denom } return "" } -type TokenAliasResponse struct { - Data *TokenAlias `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +type TokenInfoResponse struct { + Data *TokenInfo `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Supply types.Coin `protobuf:"bytes,2,opt,name=supply,proto3" json:"supply"` } -func (m *TokenAliasResponse) Reset() { *m = TokenAliasResponse{} } -func (m *TokenAliasResponse) String() string { return proto.CompactTextString(m) } -func (*TokenAliasResponse) ProtoMessage() {} -func (*TokenAliasResponse) Descriptor() ([]byte, []int) { +func (m *TokenInfoResponse) Reset() { *m = TokenInfoResponse{} } +func (m *TokenInfoResponse) String() string { return proto.CompactTextString(m) } +func (*TokenInfoResponse) ProtoMessage() {} +func (*TokenInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_c8db6e46fba94960, []int{1} } -func (m *TokenAliasResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenAliasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenAliasResponse.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 *TokenAliasResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasResponse.Merge(m, src) -} -func (m *TokenAliasResponse) XXX_Size() int { - return m.Size() -} -func (m *TokenAliasResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenAliasResponse proto.InternalMessageInfo - -func (m *TokenAliasResponse) GetData() *TokenAlias { - if m != nil { - return m.Data - } - return nil -} - -type AllTokenAliasesRequest struct { -} - -func (m *AllTokenAliasesRequest) Reset() { *m = AllTokenAliasesRequest{} } -func (m *AllTokenAliasesRequest) String() string { return proto.CompactTextString(m) } -func (*AllTokenAliasesRequest) ProtoMessage() {} -func (*AllTokenAliasesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{2} -} -func (m *AllTokenAliasesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AllTokenAliasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AllTokenAliasesRequest.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 *AllTokenAliasesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenAliasesRequest.Merge(m, src) -} -func (m *AllTokenAliasesRequest) XXX_Size() int { - return m.Size() -} -func (m *AllTokenAliasesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenAliasesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AllTokenAliasesRequest proto.InternalMessageInfo - -type AllTokenAliasesResponse struct { - Data []*TokenAlias `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` - DefaultDenom string `protobuf:"bytes,2,opt,name=default_denom,json=defaultDenom,proto3" json:"default_denom,omitempty"` - Bech32Prefix string `protobuf:"bytes,3,opt,name=bech32_prefix,json=bech32Prefix,proto3" json:"bech32_prefix,omitempty"` -} - -func (m *AllTokenAliasesResponse) Reset() { *m = AllTokenAliasesResponse{} } -func (m *AllTokenAliasesResponse) String() string { return proto.CompactTextString(m) } -func (*AllTokenAliasesResponse) ProtoMessage() {} -func (*AllTokenAliasesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{3} -} -func (m *AllTokenAliasesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AllTokenAliasesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AllTokenAliasesResponse.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 *AllTokenAliasesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenAliasesResponse.Merge(m, src) -} -func (m *AllTokenAliasesResponse) XXX_Size() int { - return m.Size() -} -func (m *AllTokenAliasesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenAliasesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AllTokenAliasesResponse proto.InternalMessageInfo - -func (m *AllTokenAliasesResponse) GetData() []*TokenAlias { - if m != nil { - return m.Data - } - return nil -} - -func (m *AllTokenAliasesResponse) GetDefaultDenom() string { - if m != nil { - return m.DefaultDenom - } - return "" -} - -func (m *AllTokenAliasesResponse) GetBech32Prefix() string { - if m != nil { - return m.Bech32Prefix - } - return "" -} - -type TokenAliasesByDenomRequest struct { - Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` -} - -func (m *TokenAliasesByDenomRequest) Reset() { *m = TokenAliasesByDenomRequest{} } -func (m *TokenAliasesByDenomRequest) String() string { return proto.CompactTextString(m) } -func (*TokenAliasesByDenomRequest) ProtoMessage() {} -func (*TokenAliasesByDenomRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{4} -} -func (m *TokenAliasesByDenomRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenAliasesByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenAliasesByDenomRequest.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 *TokenAliasesByDenomRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasesByDenomRequest.Merge(m, src) -} -func (m *TokenAliasesByDenomRequest) XXX_Size() int { - return m.Size() -} -func (m *TokenAliasesByDenomRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasesByDenomRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenAliasesByDenomRequest proto.InternalMessageInfo - -func (m *TokenAliasesByDenomRequest) GetDenoms() []string { - if m != nil { - return m.Denoms - } - return nil -} - -type TokenAliasesByDenomResponse struct { - Data map[string]*TokenAlias `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *TokenAliasesByDenomResponse) Reset() { *m = TokenAliasesByDenomResponse{} } -func (m *TokenAliasesByDenomResponse) String() string { return proto.CompactTextString(m) } -func (*TokenAliasesByDenomResponse) ProtoMessage() {} -func (*TokenAliasesByDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{5} -} -func (m *TokenAliasesByDenomResponse) XXX_Unmarshal(b []byte) error { +func (m *TokenInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenAliasesByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenAliasesByDenomResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -282,128 +100,47 @@ func (m *TokenAliasesByDenomResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *TokenAliasesByDenomResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasesByDenomResponse.Merge(m, src) +func (m *TokenInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfoResponse.Merge(m, src) } -func (m *TokenAliasesByDenomResponse) XXX_Size() int { +func (m *TokenInfoResponse) XXX_Size() int { return m.Size() } -func (m *TokenAliasesByDenomResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasesByDenomResponse.DiscardUnknown(m) +func (m *TokenInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_TokenAliasesByDenomResponse proto.InternalMessageInfo +var xxx_messageInfo_TokenInfoResponse proto.InternalMessageInfo -func (m *TokenAliasesByDenomResponse) GetData() map[string]*TokenAlias { +func (m *TokenInfoResponse) GetData() *TokenInfo { if m != nil { return m.Data } return nil } -type TokenRateRequest struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (m *TokenRateRequest) Reset() { *m = TokenRateRequest{} } -func (m *TokenRateRequest) String() string { return proto.CompactTextString(m) } -func (*TokenRateRequest) ProtoMessage() {} -func (*TokenRateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{6} -} -func (m *TokenRateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenRateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenRateRequest.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 *TokenRateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRateRequest.Merge(m, src) -} -func (m *TokenRateRequest) XXX_Size() int { - return m.Size() -} -func (m *TokenRateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenRateRequest proto.InternalMessageInfo - -func (m *TokenRateRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -type TokenRateResponse struct { - Data *TokenRate `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *TokenRateResponse) Reset() { *m = TokenRateResponse{} } -func (m *TokenRateResponse) String() string { return proto.CompactTextString(m) } -func (*TokenRateResponse) ProtoMessage() {} -func (*TokenRateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{7} -} -func (m *TokenRateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenRateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenRateResponse.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 *TokenRateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRateResponse.Merge(m, src) -} -func (m *TokenRateResponse) XXX_Size() int { - return m.Size() -} -func (m *TokenRateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenRateResponse proto.InternalMessageInfo - -func (m *TokenRateResponse) GetData() *TokenRate { +func (m *TokenInfoResponse) GetSupply() types.Coin { if m != nil { - return m.Data + return m.Supply } - return nil + return types.Coin{} } -type AllTokenRatesRequest struct { +type AllTokenInfosRequest struct { } -func (m *AllTokenRatesRequest) Reset() { *m = AllTokenRatesRequest{} } -func (m *AllTokenRatesRequest) String() string { return proto.CompactTextString(m) } -func (*AllTokenRatesRequest) ProtoMessage() {} -func (*AllTokenRatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{8} +func (m *AllTokenInfosRequest) Reset() { *m = AllTokenInfosRequest{} } +func (m *AllTokenInfosRequest) String() string { return proto.CompactTextString(m) } +func (*AllTokenInfosRequest) ProtoMessage() {} +func (*AllTokenInfosRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c8db6e46fba94960, []int{2} } -func (m *AllTokenRatesRequest) XXX_Unmarshal(b []byte) error { +func (m *AllTokenInfosRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AllTokenRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AllTokenInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AllTokenRatesRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_AllTokenInfosRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -413,34 +150,34 @@ func (m *AllTokenRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *AllTokenRatesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenRatesRequest.Merge(m, src) +func (m *AllTokenInfosRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllTokenInfosRequest.Merge(m, src) } -func (m *AllTokenRatesRequest) XXX_Size() int { +func (m *AllTokenInfosRequest) XXX_Size() int { return m.Size() } -func (m *AllTokenRatesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenRatesRequest.DiscardUnknown(m) +func (m *AllTokenInfosRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AllTokenInfosRequest.DiscardUnknown(m) } -var xxx_messageInfo_AllTokenRatesRequest proto.InternalMessageInfo +var xxx_messageInfo_AllTokenInfosRequest proto.InternalMessageInfo -type AllTokenRatesResponse struct { - Data []*TokenRate `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` +type AllTokenInfosResponse struct { + Data []TokenInfoResponse `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` } -func (m *AllTokenRatesResponse) Reset() { *m = AllTokenRatesResponse{} } -func (m *AllTokenRatesResponse) String() string { return proto.CompactTextString(m) } -func (*AllTokenRatesResponse) ProtoMessage() {} -func (*AllTokenRatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{9} +func (m *AllTokenInfosResponse) Reset() { *m = AllTokenInfosResponse{} } +func (m *AllTokenInfosResponse) String() string { return proto.CompactTextString(m) } +func (*AllTokenInfosResponse) ProtoMessage() {} +func (*AllTokenInfosResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c8db6e46fba94960, []int{3} } -func (m *AllTokenRatesResponse) XXX_Unmarshal(b []byte) error { +func (m *AllTokenInfosResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AllTokenRatesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AllTokenInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AllTokenRatesResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_AllTokenInfosResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -450,41 +187,41 @@ func (m *AllTokenRatesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *AllTokenRatesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenRatesResponse.Merge(m, src) +func (m *AllTokenInfosResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllTokenInfosResponse.Merge(m, src) } -func (m *AllTokenRatesResponse) XXX_Size() int { +func (m *AllTokenInfosResponse) XXX_Size() int { return m.Size() } -func (m *AllTokenRatesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenRatesResponse.DiscardUnknown(m) +func (m *AllTokenInfosResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AllTokenInfosResponse.DiscardUnknown(m) } -var xxx_messageInfo_AllTokenRatesResponse proto.InternalMessageInfo +var xxx_messageInfo_AllTokenInfosResponse proto.InternalMessageInfo -func (m *AllTokenRatesResponse) GetData() []*TokenRate { +func (m *AllTokenInfosResponse) GetData() []TokenInfoResponse { if m != nil { return m.Data } return nil } -type TokenRatesByDenomRequest struct { +type TokenInfosByDenomRequest struct { Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` } -func (m *TokenRatesByDenomRequest) Reset() { *m = TokenRatesByDenomRequest{} } -func (m *TokenRatesByDenomRequest) String() string { return proto.CompactTextString(m) } -func (*TokenRatesByDenomRequest) ProtoMessage() {} -func (*TokenRatesByDenomRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{10} +func (m *TokenInfosByDenomRequest) Reset() { *m = TokenInfosByDenomRequest{} } +func (m *TokenInfosByDenomRequest) String() string { return proto.CompactTextString(m) } +func (*TokenInfosByDenomRequest) ProtoMessage() {} +func (*TokenInfosByDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c8db6e46fba94960, []int{4} } -func (m *TokenRatesByDenomRequest) XXX_Unmarshal(b []byte) error { +func (m *TokenInfosByDenomRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenRatesByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfosByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenRatesByDenomRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfosByDenomRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -494,41 +231,41 @@ func (m *TokenRatesByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *TokenRatesByDenomRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRatesByDenomRequest.Merge(m, src) +func (m *TokenInfosByDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfosByDenomRequest.Merge(m, src) } -func (m *TokenRatesByDenomRequest) XXX_Size() int { +func (m *TokenInfosByDenomRequest) XXX_Size() int { return m.Size() } -func (m *TokenRatesByDenomRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRatesByDenomRequest.DiscardUnknown(m) +func (m *TokenInfosByDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfosByDenomRequest.DiscardUnknown(m) } -var xxx_messageInfo_TokenRatesByDenomRequest proto.InternalMessageInfo +var xxx_messageInfo_TokenInfosByDenomRequest proto.InternalMessageInfo -func (m *TokenRatesByDenomRequest) GetDenoms() []string { +func (m *TokenInfosByDenomRequest) GetDenoms() []string { if m != nil { return m.Denoms } return nil } -type TokenRatesByDenomResponse struct { - Data map[string]*TokenRate `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +type TokenInfosByDenomResponse struct { + Data map[string]TokenInfoResponse `protobuf:"bytes,1,rep,name=data,proto3" json:"data" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *TokenRatesByDenomResponse) Reset() { *m = TokenRatesByDenomResponse{} } -func (m *TokenRatesByDenomResponse) String() string { return proto.CompactTextString(m) } -func (*TokenRatesByDenomResponse) ProtoMessage() {} -func (*TokenRatesByDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{11} +func (m *TokenInfosByDenomResponse) Reset() { *m = TokenInfosByDenomResponse{} } +func (m *TokenInfosByDenomResponse) String() string { return proto.CompactTextString(m) } +func (*TokenInfosByDenomResponse) ProtoMessage() {} +func (*TokenInfosByDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c8db6e46fba94960, []int{5} } -func (m *TokenRatesByDenomResponse) XXX_Unmarshal(b []byte) error { +func (m *TokenInfosByDenomResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenRatesByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfosByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenRatesByDenomResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfosByDenomResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -538,19 +275,19 @@ func (m *TokenRatesByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *TokenRatesByDenomResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRatesByDenomResponse.Merge(m, src) +func (m *TokenInfosByDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfosByDenomResponse.Merge(m, src) } -func (m *TokenRatesByDenomResponse) XXX_Size() int { +func (m *TokenInfosByDenomResponse) XXX_Size() int { return m.Size() } -func (m *TokenRatesByDenomResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRatesByDenomResponse.DiscardUnknown(m) +func (m *TokenInfosByDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfosByDenomResponse.DiscardUnknown(m) } -var xxx_messageInfo_TokenRatesByDenomResponse proto.InternalMessageInfo +var xxx_messageInfo_TokenInfosByDenomResponse proto.InternalMessageInfo -func (m *TokenRatesByDenomResponse) GetData() map[string]*TokenRate { +func (m *TokenInfosByDenomResponse) GetData() map[string]TokenInfoResponse { if m != nil { return m.Data } @@ -564,7 +301,7 @@ func (m *TokenBlackWhitesRequest) Reset() { *m = TokenBlackWhitesRequest func (m *TokenBlackWhitesRequest) String() string { return proto.CompactTextString(m) } func (*TokenBlackWhitesRequest) ProtoMessage() {} func (*TokenBlackWhitesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{12} + return fileDescriptor_c8db6e46fba94960, []int{6} } func (m *TokenBlackWhitesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -594,14 +331,14 @@ func (m *TokenBlackWhitesRequest) XXX_DiscardUnknown() { var xxx_messageInfo_TokenBlackWhitesRequest proto.InternalMessageInfo type TokenBlackWhitesResponse struct { - Data *TokensWhiteBlack `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Data TokensWhiteBlack `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` } func (m *TokenBlackWhitesResponse) Reset() { *m = TokenBlackWhitesResponse{} } func (m *TokenBlackWhitesResponse) String() string { return proto.CompactTextString(m) } func (*TokenBlackWhitesResponse) ProtoMessage() {} func (*TokenBlackWhitesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{13} + return fileDescriptor_c8db6e46fba94960, []int{7} } func (m *TokenBlackWhitesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -630,28 +367,21 @@ func (m *TokenBlackWhitesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_TokenBlackWhitesResponse proto.InternalMessageInfo -func (m *TokenBlackWhitesResponse) GetData() *TokensWhiteBlack { +func (m *TokenBlackWhitesResponse) GetData() TokensWhiteBlack { if m != nil { return m.Data } - return nil + return TokensWhiteBlack{} } func init() { - proto.RegisterType((*TokenAliasRequest)(nil), "kira.tokens.TokenAliasRequest") - proto.RegisterType((*TokenAliasResponse)(nil), "kira.tokens.TokenAliasResponse") - proto.RegisterType((*AllTokenAliasesRequest)(nil), "kira.tokens.AllTokenAliasesRequest") - proto.RegisterType((*AllTokenAliasesResponse)(nil), "kira.tokens.AllTokenAliasesResponse") - proto.RegisterType((*TokenAliasesByDenomRequest)(nil), "kira.tokens.TokenAliasesByDenomRequest") - proto.RegisterType((*TokenAliasesByDenomResponse)(nil), "kira.tokens.TokenAliasesByDenomResponse") - proto.RegisterMapType((map[string]*TokenAlias)(nil), "kira.tokens.TokenAliasesByDenomResponse.DataEntry") - proto.RegisterType((*TokenRateRequest)(nil), "kira.tokens.TokenRateRequest") - proto.RegisterType((*TokenRateResponse)(nil), "kira.tokens.TokenRateResponse") - proto.RegisterType((*AllTokenRatesRequest)(nil), "kira.tokens.AllTokenRatesRequest") - proto.RegisterType((*AllTokenRatesResponse)(nil), "kira.tokens.AllTokenRatesResponse") - proto.RegisterType((*TokenRatesByDenomRequest)(nil), "kira.tokens.TokenRatesByDenomRequest") - proto.RegisterType((*TokenRatesByDenomResponse)(nil), "kira.tokens.TokenRatesByDenomResponse") - proto.RegisterMapType((map[string]*TokenRate)(nil), "kira.tokens.TokenRatesByDenomResponse.DataEntry") + proto.RegisterType((*TokenInfoRequest)(nil), "kira.tokens.TokenInfoRequest") + proto.RegisterType((*TokenInfoResponse)(nil), "kira.tokens.TokenInfoResponse") + proto.RegisterType((*AllTokenInfosRequest)(nil), "kira.tokens.AllTokenInfosRequest") + proto.RegisterType((*AllTokenInfosResponse)(nil), "kira.tokens.AllTokenInfosResponse") + proto.RegisterType((*TokenInfosByDenomRequest)(nil), "kira.tokens.TokenInfosByDenomRequest") + proto.RegisterType((*TokenInfosByDenomResponse)(nil), "kira.tokens.TokenInfosByDenomResponse") + proto.RegisterMapType((map[string]TokenInfoResponse)(nil), "kira.tokens.TokenInfosByDenomResponse.DataEntry") proto.RegisterType((*TokenBlackWhitesRequest)(nil), "kira.tokens.TokenBlackWhitesRequest") proto.RegisterType((*TokenBlackWhitesResponse)(nil), "kira.tokens.TokenBlackWhitesResponse") } @@ -659,52 +389,45 @@ func init() { func init() { proto.RegisterFile("kira/tokens/query.proto", fileDescriptor_c8db6e46fba94960) } var fileDescriptor_c8db6e46fba94960 = []byte{ - // 712 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0x8e, 0x9b, 0x5f, 0x2a, 0x75, 0xda, 0x4a, 0xfd, 0x2d, 0xc1, 0x49, 0x4d, 0x6b, 0xc0, 0x6d, - 0x21, 0xa2, 0x10, 0x43, 0xca, 0x01, 0x71, 0x41, 0x4d, 0x0b, 0x3d, 0x20, 0xd4, 0x12, 0x21, 0x21, - 0x71, 0xa9, 0x36, 0xcd, 0x36, 0xb5, 0xe2, 0x78, 0x53, 0xef, 0x06, 0x35, 0x48, 0x5c, 0x78, 0x82, - 0x4a, 0xbc, 0x09, 0x17, 0x5e, 0x81, 0x63, 0x25, 0x2e, 0x1c, 0xab, 0x96, 0x07, 0x41, 0xde, 0x5d, - 0xa7, 0xeb, 0x3a, 0x89, 0x7b, 0xb3, 0x67, 0xbe, 0x99, 0x6f, 0xbe, 0xf9, 0x63, 0x43, 0xa9, 0xe3, - 0x85, 0xd8, 0xe5, 0xb4, 0x43, 0x02, 0xe6, 0x1e, 0xf7, 0x49, 0x38, 0xa8, 0xf6, 0x42, 0xca, 0x29, - 0x9a, 0x8d, 0x1c, 0x55, 0xe9, 0xb0, 0x12, 0x28, 0xec, 0x7b, 0x98, 0x49, 0x94, 0x65, 0xea, 0x8e, - 0x10, 0x73, 0xa2, 0xec, 0x65, 0xdd, 0x7e, 0x18, 0x12, 0xf2, 0x25, 0xf6, 0x14, 0xdb, 0xb4, 0x4d, - 0xc5, 0xa3, 0x1b, 0x3d, 0x29, 0xeb, 0x52, 0x9b, 0xd2, 0xb6, 0x4f, 0x5c, 0xdc, 0xf3, 0x5c, 0x1c, - 0x04, 0x94, 0x63, 0xee, 0xd1, 0x40, 0xb1, 0x38, 0xeb, 0xf0, 0xff, 0x87, 0x28, 0xd5, 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0x18, 0xea, 0x82, 0x99, 0x90, - 0x34, 0x9c, 0x24, 0x7a, 0x98, 0x7d, 0x9d, 0xb2, 0x8c, 0xca, 0x4d, 0xcf, 0xd8, 0xc9, 0xa1, 0x5d, - 0x98, 0x8b, 0xe9, 0xa2, 0x81, 0xa2, 0xe5, 0x31, 0x83, 0x56, 0xa9, 0xed, 0x71, 0xee, 0x61, 0xc2, - 0x3e, 0x2c, 0x68, 0xed, 0x13, 0xab, 0x88, 0xee, 0x8f, 0xec, 0x8b, 0x7e, 0x6b, 0x96, 0x33, 0x09, - 0xa2, 0x92, 0x5b, 0xa2, 0x71, 0x45, 0x84, 0xdc, 0xeb, 0xbf, 0x23, 0x86, 0xda, 0x50, 0xd4, 0x75, - 0x0c, 0x9b, 0xb6, 0x96, 0x75, 0x1e, 0x92, 0xfe, 0xc1, 0xcd, 0xae, 0xc8, 0xc9, 0xa1, 0x16, 0xdc, - 0x8a, 0x89, 0xb4, 0x75, 0x46, 0xab, 0xe9, 0x04, 0xe9, 0x43, 0xb0, 0xd6, 0x32, 0x50, 0x31, 0x4b, - 0xbd, 0xfe, 0xeb, 0xc2, 0x36, 0xce, 0x2e, 0x6c, 0xe3, 0xfc, 0xc2, 0x36, 0x4e, 0x2f, 0xed, 0xdc, - 0xd9, 0xa5, 0x9d, 0xfb, 0x73, 0x69, 0xe7, 0x3e, 0x55, 0xda, 0x1e, 0x3f, 0xea, 0x37, 0xab, 0x07, - 0xb4, 0xeb, 0xbe, 0xf5, 0x42, 0xbc, 0x45, 0x43, 0xe2, 0x32, 0xd2, 0xc1, 0x9e, 0x7b, 0x12, 0xb7, - 0x84, 0x0f, 0x7a, 0x84, 0x35, 0xa7, 0xc5, 0x5f, 0x75, 0xe3, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x35, 0xa8, 0x66, 0x9a, 0xfc, 0x07, 0x00, 0x00, + // 607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0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 0xf2, 0xbb, 0x8a, 0xde, 0x04, 0xeb, 0x22, 0xde, 0xb5, 0xf1, 0x60, 0x7c, + 0x34, 0xb2, 0x38, 0x89, 0x87, 0xfc, 0x46, 0x4e, 0x24, 0x15, 0x92, 0xbd, 0xed, 0xa4, 0x6e, 0xbf, + 0x95, 0xf5, 0x63, 0x22, 0x41, 0xa4, 0x26, 0x1b, 0xe9, 0xfc, 0x29, 0x80, 0xe2, 0x61, 0xf8, 0x66, + 0xc0, 0x11, 0xb8, 0x75, 0x40, 0x78, 0x0c, 0x07, 0x5b, 0x37, 0x41, 0x0b, 0x1a, 0x75, 0x49, 0x4f, + 0x7a, 0xf3, 0xe3, 0xf7, 0xdf, 0x5f, 0xf3, 0x6b, 0x70, 0x15, 0x25, 0xdf, 0x22, 0x2b, 0xac, 0xec, + 0x83, 0xea, 0x01, 0xe1, 0xa9, 0x85, 0x81, 0x9b, 0xa9, 0x72, 0x8b, 0x96, 0x4c, 0xd5, 0xff, 0x25, + 0x91, 0xae, 0xaa, 0x70, 0xad, 0x41, 0x98, 0x71, 0x65, 0xf0, 0xb3, 0x02, 0x6a, 0xc9, 0x0e, 0xe7, + 0x57, 0x0d, 0xb7, 0x96, 0xad, 0x42, 0xe4, 0xff, 0xf0, 0xff, 0x36, 0x46, 0xbf, 0x2f, 0x18, 0x5a, + 0x70, 0x23, 0xcb, 0xd0, 0x37, 0x83, 0xbe, 0xd8, 0x55, 0xf8, 0x49, 0x01, 0x6b, 0x73, 0x98, 0xc4, + 0x85, 0xc2, 0x07, 0x59, 0x93, 0xec, 0x2a, 0xa8, 0x5b, 0x4b, 0x54, 0x92, 0x64, 0x53, 0x90, 0x6c, + 0xc0, 0x66, 0x8a, 0xc4, 0x0c, 0x95, 0xfd, 0xf7, 0x42, 0xda, 0xed, 0x5e, 0x4c, 0x35, 0xe5, 0x72, + 0xaa, 0x29, 0xbf, 0xa6, 0x9a, 0xf2, 0x65, 0xa6, 0xe5, 0x2e, 0x67, 0x5a, 0xee, 0xc7, 0x4c, 0xcb, + 0xbd, 0x6b, 0x0f, 0x2d, 0x3e, 0xf2, 0x4d, 0x63, 0x40, 0x27, 0xe8, 0xb5, 0xe5, 0xe1, 0x3d, 0xea, + 0x11, 0xc4, 0xc8, 0x18, 0x5b, 0xe8, 0x3c, 0xfe, 0x5a, 0x06, 0x2e, 0x61, 0x66, 0x49, 0x7c, 0xc0, + 0x9e, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x2c, 0xcb, 0xf9, 0xf0, 0x6f, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -719,14 +442,10 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Returns the token alias - GetTokenAlias(ctx context.Context, in *TokenAliasRequest, opts ...grpc.CallOption) (*TokenAliasResponse, error) - GetAllTokenAliases(ctx context.Context, in *AllTokenAliasesRequest, opts ...grpc.CallOption) (*AllTokenAliasesResponse, error) - GetTokenAliasesByDenom(ctx context.Context, in *TokenAliasesByDenomRequest, opts ...grpc.CallOption) (*TokenAliasesByDenomResponse, error) - // Returns the token rates - GetTokenRate(ctx context.Context, in *TokenRateRequest, opts ...grpc.CallOption) (*TokenRateResponse, error) - GetAllTokenRates(ctx context.Context, in *AllTokenRatesRequest, opts ...grpc.CallOption) (*AllTokenRatesResponse, error) - GetTokenRatesByDenom(ctx context.Context, in *TokenRatesByDenomRequest, opts ...grpc.CallOption) (*TokenRatesByDenomResponse, error) + // Returns the token infos + GetTokenInfo(ctx context.Context, in *TokenInfoRequest, opts ...grpc.CallOption) (*TokenInfoResponse, error) + GetAllTokenInfos(ctx context.Context, in *AllTokenInfosRequest, opts ...grpc.CallOption) (*AllTokenInfosResponse, error) + GetTokenInfosByDenom(ctx context.Context, in *TokenInfosByDenomRequest, opts ...grpc.CallOption) (*TokenInfosByDenomResponse, error) // Returns tokens black/white lists GetTokenBlackWhites(ctx context.Context, in *TokenBlackWhitesRequest, opts ...grpc.CallOption) (*TokenBlackWhitesResponse, error) } @@ -739,54 +458,27 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) GetTokenAlias(ctx context.Context, in *TokenAliasRequest, opts ...grpc.CallOption) (*TokenAliasResponse, error) { - out := new(TokenAliasResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenAlias", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetAllTokenAliases(ctx context.Context, in *AllTokenAliasesRequest, opts ...grpc.CallOption) (*AllTokenAliasesResponse, error) { - out := new(AllTokenAliasesResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetAllTokenAliases", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetTokenAliasesByDenom(ctx context.Context, in *TokenAliasesByDenomRequest, opts ...grpc.CallOption) (*TokenAliasesByDenomResponse, error) { - out := new(TokenAliasesByDenomResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenAliasesByDenom", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetTokenRate(ctx context.Context, in *TokenRateRequest, opts ...grpc.CallOption) (*TokenRateResponse, error) { - out := new(TokenRateResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenRate", in, out, opts...) +func (c *queryClient) GetTokenInfo(ctx context.Context, in *TokenInfoRequest, opts ...grpc.CallOption) (*TokenInfoResponse, error) { + out := new(TokenInfoResponse) + err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) GetAllTokenRates(ctx context.Context, in *AllTokenRatesRequest, opts ...grpc.CallOption) (*AllTokenRatesResponse, error) { - out := new(AllTokenRatesResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetAllTokenRates", in, out, opts...) +func (c *queryClient) GetAllTokenInfos(ctx context.Context, in *AllTokenInfosRequest, opts ...grpc.CallOption) (*AllTokenInfosResponse, error) { + out := new(AllTokenInfosResponse) + err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetAllTokenInfos", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) GetTokenRatesByDenom(ctx context.Context, in *TokenRatesByDenomRequest, opts ...grpc.CallOption) (*TokenRatesByDenomResponse, error) { - out := new(TokenRatesByDenomResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenRatesByDenom", in, out, opts...) +func (c *queryClient) GetTokenInfosByDenom(ctx context.Context, in *TokenInfosByDenomRequest, opts ...grpc.CallOption) (*TokenInfosByDenomResponse, error) { + out := new(TokenInfosByDenomResponse) + err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenInfosByDenom", in, out, opts...) if err != nil { return nil, err } @@ -804,14 +496,10 @@ func (c *queryClient) GetTokenBlackWhites(ctx context.Context, in *TokenBlackWhi // QueryServer is the server API for Query service. type QueryServer interface { - // Returns the token alias - GetTokenAlias(context.Context, *TokenAliasRequest) (*TokenAliasResponse, error) - GetAllTokenAliases(context.Context, *AllTokenAliasesRequest) (*AllTokenAliasesResponse, error) - GetTokenAliasesByDenom(context.Context, *TokenAliasesByDenomRequest) (*TokenAliasesByDenomResponse, error) - // Returns the token rates - GetTokenRate(context.Context, *TokenRateRequest) (*TokenRateResponse, error) - GetAllTokenRates(context.Context, *AllTokenRatesRequest) (*AllTokenRatesResponse, error) - GetTokenRatesByDenom(context.Context, *TokenRatesByDenomRequest) (*TokenRatesByDenomResponse, error) + // Returns the token infos + GetTokenInfo(context.Context, *TokenInfoRequest) (*TokenInfoResponse, error) + GetAllTokenInfos(context.Context, *AllTokenInfosRequest) (*AllTokenInfosResponse, error) + GetTokenInfosByDenom(context.Context, *TokenInfosByDenomRequest) (*TokenInfosByDenomResponse, error) // Returns tokens black/white lists GetTokenBlackWhites(context.Context, *TokenBlackWhitesRequest) (*TokenBlackWhitesResponse, error) } @@ -820,23 +508,14 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) GetTokenAlias(ctx context.Context, req *TokenAliasRequest) (*TokenAliasResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTokenAlias not implemented") -} -func (*UnimplementedQueryServer) GetAllTokenAliases(ctx context.Context, req *AllTokenAliasesRequest) (*AllTokenAliasesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAllTokenAliases not implemented") -} -func (*UnimplementedQueryServer) GetTokenAliasesByDenom(ctx context.Context, req *TokenAliasesByDenomRequest) (*TokenAliasesByDenomResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTokenAliasesByDenom not implemented") -} -func (*UnimplementedQueryServer) GetTokenRate(ctx context.Context, req *TokenRateRequest) (*TokenRateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTokenRate not implemented") +func (*UnimplementedQueryServer) GetTokenInfo(ctx context.Context, req *TokenInfoRequest) (*TokenInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTokenInfo not implemented") } -func (*UnimplementedQueryServer) GetAllTokenRates(ctx context.Context, req *AllTokenRatesRequest) (*AllTokenRatesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAllTokenRates not implemented") +func (*UnimplementedQueryServer) GetAllTokenInfos(ctx context.Context, req *AllTokenInfosRequest) (*AllTokenInfosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllTokenInfos not implemented") } -func (*UnimplementedQueryServer) GetTokenRatesByDenom(ctx context.Context, req *TokenRatesByDenomRequest) (*TokenRatesByDenomResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTokenRatesByDenom not implemented") +func (*UnimplementedQueryServer) GetTokenInfosByDenom(ctx context.Context, req *TokenInfosByDenomRequest) (*TokenInfosByDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTokenInfosByDenom not implemented") } func (*UnimplementedQueryServer) GetTokenBlackWhites(ctx context.Context, req *TokenBlackWhitesRequest) (*TokenBlackWhitesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTokenBlackWhites not implemented") @@ -846,110 +525,56 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_GetTokenAlias_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TokenAliasRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetTokenAlias(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.tokens.Query/GetTokenAlias", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetTokenAlias(ctx, req.(*TokenAliasRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetAllTokenAliases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AllTokenAliasesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetAllTokenAliases(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.tokens.Query/GetAllTokenAliases", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetAllTokenAliases(ctx, req.(*AllTokenAliasesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetTokenAliasesByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TokenAliasesByDenomRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetTokenAliasesByDenom(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.tokens.Query/GetTokenAliasesByDenom", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetTokenAliasesByDenom(ctx, req.(*TokenAliasesByDenomRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetTokenRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TokenRateRequest) +func _Query_GetTokenInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TokenInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).GetTokenRate(ctx, in) + return srv.(QueryServer).GetTokenInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kira.tokens.Query/GetTokenRate", + FullMethod: "/kira.tokens.Query/GetTokenInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetTokenRate(ctx, req.(*TokenRateRequest)) + return srv.(QueryServer).GetTokenInfo(ctx, req.(*TokenInfoRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_GetAllTokenRates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AllTokenRatesRequest) +func _Query_GetAllTokenInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AllTokenInfosRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).GetAllTokenRates(ctx, in) + return srv.(QueryServer).GetAllTokenInfos(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kira.tokens.Query/GetAllTokenRates", + FullMethod: "/kira.tokens.Query/GetAllTokenInfos", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetAllTokenRates(ctx, req.(*AllTokenRatesRequest)) + return srv.(QueryServer).GetAllTokenInfos(ctx, req.(*AllTokenInfosRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_GetTokenRatesByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TokenRatesByDenomRequest) +func _Query_GetTokenInfosByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TokenInfosByDenomRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).GetTokenRatesByDenom(ctx, in) + return srv.(QueryServer).GetTokenInfosByDenom(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kira.tokens.Query/GetTokenRatesByDenom", + FullMethod: "/kira.tokens.Query/GetTokenInfosByDenom", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetTokenRatesByDenom(ctx, req.(*TokenRatesByDenomRequest)) + return srv.(QueryServer).GetTokenInfosByDenom(ctx, req.(*TokenInfosByDenomRequest)) } return interceptor(ctx, in, info, handler) } @@ -977,28 +602,16 @@ var _Query_serviceDesc = grpc.ServiceDesc{ HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetTokenAlias", - Handler: _Query_GetTokenAlias_Handler, - }, - { - MethodName: "GetAllTokenAliases", - Handler: _Query_GetAllTokenAliases_Handler, - }, - { - MethodName: "GetTokenAliasesByDenom", - Handler: _Query_GetTokenAliasesByDenom_Handler, - }, - { - MethodName: "GetTokenRate", - Handler: _Query_GetTokenRate_Handler, + MethodName: "GetTokenInfo", + Handler: _Query_GetTokenInfo_Handler, }, { - MethodName: "GetAllTokenRates", - Handler: _Query_GetAllTokenRates_Handler, + MethodName: "GetAllTokenInfos", + Handler: _Query_GetAllTokenInfos_Handler, }, { - MethodName: "GetTokenRatesByDenom", - Handler: _Query_GetTokenRatesByDenom_Handler, + MethodName: "GetTokenInfosByDenom", + Handler: _Query_GetTokenInfosByDenom_Handler, }, { MethodName: "GetTokenBlackWhites", @@ -1009,7 +622,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "kira/tokens/query.proto", } -func (m *TokenAliasRequest) Marshal() (dAtA []byte, err error) { +func (m *TokenInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1019,27 +632,27 @@ func (m *TokenAliasRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenAliasRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenAliasRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Symbol))) + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *TokenAliasResponse) Marshal() (dAtA []byte, err error) { +func (m *TokenInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1049,16 +662,26 @@ func (m *TokenAliasResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenAliasResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenAliasResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + { + size, err := m.Supply.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 if m.Data != nil { { size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) @@ -1074,7 +697,7 @@ func (m *TokenAliasResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AllTokenAliasesRequest) Marshal() (dAtA []byte, err error) { +func (m *AllTokenInfosRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1084,12 +707,12 @@ func (m *AllTokenAliasesRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AllTokenAliasesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AllTokenInfosRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AllTokenAliasesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AllTokenInfosRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1097,7 +720,7 @@ func (m *AllTokenAliasesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *AllTokenAliasesResponse) Marshal() (dAtA []byte, err error) { +func (m *AllTokenInfosResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1107,30 +730,16 @@ func (m *AllTokenAliasesResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AllTokenAliasesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *AllTokenInfosResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AllTokenAliasesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AllTokenInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Bech32Prefix) > 0 { - i -= len(m.Bech32Prefix) - copy(dAtA[i:], m.Bech32Prefix) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bech32Prefix))) - i-- - dAtA[i] = 0x1a - } - if len(m.DefaultDenom) > 0 { - i -= len(m.DefaultDenom) - copy(dAtA[i:], m.DefaultDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DefaultDenom))) - i-- - dAtA[i] = 0x12 - } if len(m.Data) > 0 { for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { { @@ -1148,7 +757,7 @@ func (m *AllTokenAliasesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *TokenAliasesByDenomRequest) Marshal() (dAtA []byte, err error) { +func (m *TokenInfosByDenomRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1158,12 +767,12 @@ func (m *TokenAliasesByDenomRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenAliasesByDenomRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenInfosByDenomRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenAliasesByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenInfosByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1180,7 +789,7 @@ func (m *TokenAliasesByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *TokenAliasesByDenomResponse) Marshal() (dAtA []byte, err error) { +func (m *TokenInfosByDenomResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1190,12 +799,12 @@ func (m *TokenAliasesByDenomResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenAliasesByDenomResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenInfosByDenomResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenAliasesByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenInfosByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1204,143 +813,8 @@ func (m *TokenAliasesByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, er for k := range m.Data { v := m.Data[k] baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintQuery(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TokenRateRequest) 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 *TokenRateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenRateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TokenRateResponse) 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 *TokenRateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Data != nil { - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AllTokenRatesRequest) 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 *AllTokenRatesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AllTokenRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *AllTokenRatesResponse) 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 *AllTokenRatesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AllTokenRatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1348,80 +822,7 @@ func (m *AllTokenRatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TokenRatesByDenomRequest) 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 *TokenRatesByDenomRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenRatesByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TokenRatesByDenomResponse) 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 *TokenRatesByDenomResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenRatesByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - for k := range m.Data { - v := m.Data[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } + dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintQuery(dAtA, i, uint64(len(k))) @@ -1478,18 +879,16 @@ func (m *TokenBlackWhitesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l - if m.Data != nil { - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1504,20 +903,20 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *TokenAliasRequest) Size() (n int) { +func (m *TokenInfoRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Symbol) + l = len(m.Denom) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *TokenAliasResponse) Size() (n int) { +func (m *TokenInfoResponse) Size() (n int) { if m == nil { return 0 } @@ -1527,10 +926,12 @@ func (m *TokenAliasResponse) Size() (n int) { l = m.Data.Size() n += 1 + l + sovQuery(uint64(l)) } + l = m.Supply.Size() + n += 1 + l + sovQuery(uint64(l)) return n } -func (m *AllTokenAliasesRequest) Size() (n int) { +func (m *AllTokenInfosRequest) Size() (n int) { if m == nil { return 0 } @@ -1539,7 +940,7 @@ func (m *AllTokenAliasesRequest) Size() (n int) { return n } -func (m *AllTokenAliasesResponse) Size() (n int) { +func (m *AllTokenInfosResponse) Size() (n int) { if m == nil { return 0 } @@ -1551,18 +952,10 @@ func (m *AllTokenAliasesResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } - l = len(m.DefaultDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Bech32Prefix) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } return n } -func (m *TokenAliasesByDenomRequest) Size() (n int) { +func (m *TokenInfosByDenomRequest) Size() (n int) { if m == nil { return 0 } @@ -1577,7 +970,7 @@ func (m *TokenAliasesByDenomRequest) Size() (n int) { return n } -func (m *TokenAliasesByDenomResponse) Size() (n int) { +func (m *TokenInfosByDenomResponse) Size() (n int) { if m == nil { return 0 } @@ -1587,500 +980,41 @@ func (m *TokenAliasesByDenomResponse) Size() (n int) { for k, v := range m.Data { _ = k _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovQuery(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + l = v.Size() + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + l + sovQuery(uint64(l)) n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) } } - return n -} - -func (m *TokenRateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *TokenRateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Data != nil { - l = m.Data.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *AllTokenRatesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *AllTokenRatesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Data) > 0 { - for _, e := range m.Data { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *TokenRatesByDenomRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *TokenRatesByDenomResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Data) > 0 { - for k, v := range m.Data { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovQuery(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l - n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) - } - } - return n -} - -func (m *TokenBlackWhitesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *TokenBlackWhitesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Data != nil { - l = m.Data.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TokenAliasRequest) 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 ErrIntOverflowQuery - } - 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: TokenAliasRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenAliasResponse) 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 ErrIntOverflowQuery - } - 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: TokenAliasResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Data == nil { - m.Data = &TokenAlias{} - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AllTokenAliasesRequest) 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 ErrIntOverflowQuery - } - 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: AllTokenAliasesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllTokenAliasesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AllTokenAliasesResponse) 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 ErrIntOverflowQuery - } - 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: AllTokenAliasesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllTokenAliasesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data, &TokenAlias{}) - if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DefaultDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bech32Prefix", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bech32Prefix = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + return n +} + +func (m *TokenBlackWhitesRequest) Size() (n int) { + if m == nil { + return 0 } + var l int + _ = l + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *TokenBlackWhitesResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + l = m.Data.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *TokenAliasesByDenomRequest) Unmarshal(dAtA []byte) error { +func (m *TokenInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2103,15 +1037,15 @@ func (m *TokenAliasesByDenomRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenAliasesByDenomRequest: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasesByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2139,7 +1073,7 @@ func (m *TokenAliasesByDenomRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2162,7 +1096,7 @@ func (m *TokenAliasesByDenomRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *TokenAliasesByDenomResponse) Unmarshal(dAtA []byte) error { +func (m *TokenInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2185,10 +1119,10 @@ func (m *TokenAliasesByDenomResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenAliasesByDenomResponse: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasesByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2221,240 +1155,15 @@ func (m *TokenAliasesByDenomResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Data == nil { - m.Data = make(map[string]*TokenAlias) - } - var mapkey string - var mapvalue *TokenAlias - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthQuery - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthQuery - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthQuery - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthQuery - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &TokenAlias{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + m.Data = &TokenInfo{} } - m.Data[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenRateRequest) 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 ErrIntOverflowQuery - } - 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: TokenRateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRateRequest: 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 ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenRateResponse) 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 ErrIntOverflowQuery - } - 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: TokenRateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2481,10 +1190,7 @@ func (m *TokenRateResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Data == nil { - m.Data = &TokenRate{} - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2509,7 +1215,7 @@ func (m *TokenRateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AllTokenRatesRequest) Unmarshal(dAtA []byte) error { +func (m *AllTokenInfosRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2532,10 +1238,10 @@ func (m *AllTokenRatesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AllTokenRatesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AllTokenInfosRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AllTokenRatesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AllTokenInfosRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2559,7 +1265,7 @@ func (m *AllTokenRatesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AllTokenRatesResponse) Unmarshal(dAtA []byte) error { +func (m *AllTokenInfosResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2582,10 +1288,10 @@ func (m *AllTokenRatesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AllTokenRatesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AllTokenInfosResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AllTokenRatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AllTokenInfosResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2617,7 +1323,7 @@ func (m *AllTokenRatesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append(m.Data, &TokenRate{}) + m.Data = append(m.Data, TokenInfoResponse{}) if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2643,7 +1349,7 @@ func (m *AllTokenRatesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *TokenRatesByDenomRequest) Unmarshal(dAtA []byte) error { +func (m *TokenInfosByDenomRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2666,10 +1372,10 @@ func (m *TokenRatesByDenomRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenRatesByDenomRequest: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfosByDenomRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRatesByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenInfosByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2725,7 +1431,7 @@ func (m *TokenRatesByDenomRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { +func (m *TokenInfosByDenomResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2748,10 +1454,10 @@ func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenRatesByDenomResponse: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfosByDenomResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRatesByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenInfosByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2784,10 +1490,10 @@ func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Data == nil { - m.Data = make(map[string]*TokenRate) + m.Data = make(map[string]TokenInfoResponse) } var mapkey string - var mapvalue *TokenRate + mapvalue := &TokenInfoResponse{} for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -2861,7 +1567,7 @@ func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &TokenRate{} + mapvalue = &TokenInfoResponse{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -2881,7 +1587,7 @@ func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.Data[mapkey] = mapvalue + m.Data[mapkey] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -3012,9 +1718,6 @@ func (m *TokenBlackWhitesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Data == nil { - m.Data = &TokensWhiteBlack{} - } if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/tokens/types/query.pb.gw.go b/x/tokens/types/query.pb.gw.go index 6874cb6aa..bce99add2 100644 --- a/x/tokens/types/query.pb.gw.go +++ b/x/tokens/types/query.pb.gw.go @@ -33,38 +33,110 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join -func request_Query_GetAllTokenAliases_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AllTokenAliasesRequest +var ( + filter_Query_GetTokenInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_GetTokenInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetTokenInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetTokenInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetTokenInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetTokenInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetTokenInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_GetAllTokenInfos_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AllTokenInfosRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetAllTokenInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetAllTokenInfos_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AllTokenInfosRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetAllTokenInfos(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GetTokenInfosByDenom_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_GetTokenInfosByDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenInfosByDenomRequest var metadata runtime.ServerMetadata - msg, err := client.GetAllTokenAliases(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetTokenInfosByDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetTokenInfosByDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_GetAllTokenAliases_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AllTokenAliasesRequest +func local_request_Query_GetTokenInfosByDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenInfosByDenomRequest var metadata runtime.ServerMetadata - msg, err := server.GetAllTokenAliases(ctx, &protoReq) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetTokenInfosByDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetTokenInfosByDenom(ctx, &protoReq) return msg, metadata, err } -func request_Query_GetAllTokenRates_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AllTokenRatesRequest +func request_Query_GetTokenBlackWhites_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenBlackWhitesRequest var metadata runtime.ServerMetadata - msg, err := client.GetAllTokenRates(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetTokenBlackWhites(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_GetAllTokenRates_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AllTokenRatesRequest +func local_request_Query_GetTokenBlackWhites_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenBlackWhitesRequest var metadata runtime.ServerMetadata - msg, err := server.GetAllTokenRates(ctx, &protoReq) + msg, err := server.GetTokenBlackWhites(ctx, &protoReq) return msg, metadata, err } @@ -75,7 +147,53 @@ func local_request_Query_GetAllTokenRates_0(ctx context.Context, marshaler runti // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_GetAllTokenAliases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetTokenInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetTokenInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetTokenInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetAllTokenInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetAllTokenInfos_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetAllTokenInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetTokenInfosByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -86,7 +204,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_GetAllTokenAliases_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetTokenInfosByDenom_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -94,11 +212,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_GetAllTokenAliases_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetTokenInfosByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_GetAllTokenRates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetTokenBlackWhites_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -109,7 +227,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_GetAllTokenRates_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetTokenBlackWhites_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -117,7 +235,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_GetAllTokenRates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetTokenBlackWhites_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -162,7 +280,47 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_GetAllTokenAliases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetTokenInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetTokenInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetTokenInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetAllTokenInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetAllTokenInfos_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetAllTokenInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetTokenInfosByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -171,18 +329,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_GetAllTokenAliases_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetTokenInfosByDenom_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_GetAllTokenAliases_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetTokenInfosByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_GetAllTokenRates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetTokenBlackWhites_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -191,14 +349,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_GetAllTokenRates_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetTokenBlackWhites_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_GetAllTokenRates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetTokenBlackWhites_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -206,13 +364,21 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_GetAllTokenAliases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "aliases"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetTokenInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "info"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetAllTokenInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "infos"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_GetAllTokenRates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "rates"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetTokenInfosByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "infos_by_denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetTokenBlackWhites_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "black_whites"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( - forward_Query_GetAllTokenAliases_0 = runtime.ForwardResponseMessage + forward_Query_GetTokenInfo_0 = runtime.ForwardResponseMessage + + forward_Query_GetAllTokenInfos_0 = runtime.ForwardResponseMessage + + forward_Query_GetTokenInfosByDenom_0 = runtime.ForwardResponseMessage - forward_Query_GetAllTokenRates_0 = runtime.ForwardResponseMessage + forward_Query_GetTokenBlackWhites_0 = runtime.ForwardResponseMessage ) diff --git a/x/tokens/types/rate.pb.go b/x/tokens/types/rate.pb.go deleted file mode 100644 index 5d73fa6ab..000000000 --- a/x/tokens/types/rate.pb.go +++ /dev/null @@ -1,1084 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: kira/tokens/rate.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// 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 - -type TokenRate struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate" yaml:"fee_rate"` - FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` - Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` -} - -func (m *TokenRate) Reset() { *m = TokenRate{} } -func (m *TokenRate) String() string { return proto.CompactTextString(m) } -func (*TokenRate) ProtoMessage() {} -func (*TokenRate) Descriptor() ([]byte, []int) { - return fileDescriptor_d415c64b17c96dda, []int{0} -} -func (m *TokenRate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenRate.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 *TokenRate) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRate.Merge(m, src) -} -func (m *TokenRate) XXX_Size() int { - return m.Size() -} -func (m *TokenRate) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRate.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenRate proto.InternalMessageInfo - -func (m *TokenRate) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *TokenRate) GetFeePayments() bool { - if m != nil { - return m.FeePayments - } - return false -} - -func (m *TokenRate) GetStakeToken() bool { - if m != nil { - return m.StakeToken - } - return false -} - -func (m *TokenRate) GetInvalidated() bool { - if m != nil { - return m.Invalidated - } - return false -} - -type MsgUpsertTokenRate struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate" yaml:"rate"` - FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` - Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` - Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,8,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` -} - -func (m *MsgUpsertTokenRate) Reset() { *m = MsgUpsertTokenRate{} } -func (m *MsgUpsertTokenRate) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertTokenRate) ProtoMessage() {} -func (*MsgUpsertTokenRate) Descriptor() ([]byte, []int) { - return fileDescriptor_d415c64b17c96dda, []int{1} -} -func (m *MsgUpsertTokenRate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpsertTokenRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpsertTokenRate.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 *MsgUpsertTokenRate) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertTokenRate.Merge(m, src) -} -func (m *MsgUpsertTokenRate) XXX_Size() int { - return m.Size() -} -func (m *MsgUpsertTokenRate) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertTokenRate.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpsertTokenRate proto.InternalMessageInfo - -func (m *MsgUpsertTokenRate) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *MsgUpsertTokenRate) GetFeePayments() bool { - if m != nil { - return m.FeePayments - } - return false -} - -func (m *MsgUpsertTokenRate) GetStakeToken() bool { - if m != nil { - return m.StakeToken - } - return false -} - -func (m *MsgUpsertTokenRate) GetInvalidated() bool { - if m != nil { - return m.Invalidated - } - return false -} - -func (m *MsgUpsertTokenRate) GetProposer() github_com_cosmos_cosmos_sdk_types.AccAddress { - if m != nil { - return m.Proposer - } - return nil -} - -func init() { - proto.RegisterType((*TokenRate)(nil), "kira.tokens.TokenRate") - proto.RegisterType((*MsgUpsertTokenRate)(nil), "kira.tokens.MsgUpsertTokenRate") -} - -func init() { proto.RegisterFile("kira/tokens/rate.proto", fileDescriptor_d415c64b17c96dda) } - -var fileDescriptor_d415c64b17c96dda = []byte{ - // 430 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x94, 0xb1, 0x6e, 0xd4, 0x30, - 0x18, 0xc7, 0x2f, 0xf4, 0xda, 0xe6, 0x9c, 0x4a, 0x20, 0xab, 0x42, 0x16, 0x43, 0x72, 0x64, 0x40, - 0x59, 0x9a, 0x0c, 0x6c, 0x48, 0x0c, 0x97, 0x76, 0x41, 0xa8, 0x12, 0x44, 0xb0, 0x20, 0xa4, 0xc3, - 0x4d, 0xbe, 0x0b, 0x56, 0x1a, 0xdb, 0xb2, 0x0d, 0xe2, 0x9e, 0x80, 0x95, 0xb7, 0xe0, 0x55, 0x3a, - 0x76, 0x44, 0x0c, 0x11, 0xba, 0x7b, 0x03, 0x46, 0x26, 0x14, 0xbb, 0x69, 0x4f, 0x2c, 0xf4, 0xf6, - 0x4e, 0x71, 0x7e, 0xb6, 0xfe, 0xff, 0xef, 0xfb, 0xfe, 0x89, 0xd1, 0xc3, 0x86, 0x29, 0x9a, 0x19, - 0xd1, 0x00, 0xd7, 0x99, 0xa2, 0x06, 0x52, 0xa9, 0x84, 0x11, 0x38, 0xe8, 0x79, 0xea, 0xf8, 0xa3, - 0xc3, 0x5a, 0xd4, 0xc2, 0xf2, 0xac, 0x5f, 0xb9, 0x23, 0xf1, 0xf7, 0x1d, 0x34, 0x79, 0xd3, 0x1f, - 0x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0x41, 0x99, 0xff, 0x45, 0xf6, 0x1a, 0x8d, 0x37, 0xe2, 0x7a, 0xbe, - 0xf5, 0xb0, 0x02, 0xd7, 0x8b, 0x8b, 0xca, 0x4a, 0xdd, 0xe5, 0x74, 0xbb, 0x9c, 0xf0, 0x07, 0xe4, - 0x4b, 0x25, 0xa4, 0xd0, 0xa0, 0x88, 0x3f, 0xf5, 0x92, 0x83, 0xfc, 0xe4, 0xe6, 0xfb, 0x1f, 0x76, - 0xe2, 0x3f, 0x5d, 0x74, 0x74, 0x8b, 0x8a, 0x67, 0x65, 0x39, 0xab, 0x2a, 0x05, 0x5a, 0x17, 0xd7, - 0xaa, 0x79, 0x7e, 0xb1, 0x0a, 0xbd, 0xcb, 0x55, 0xe8, 0xfd, 0x5a, 0x85, 0xde, 0xb7, 0x75, 0x38, - 0xba, 0x5c, 0x87, 0xa3, 0x1f, 0xeb, 0x70, 0xf4, 0x2e, 0xd9, 0x90, 0x7c, 0xc9, 0x14, 0x3d, 0x16, - 0x0a, 0x32, 0x0d, 0x0d, 0x65, 0xd9, 0x97, 0xe1, 0x7e, 0xb0, 0xc2, 0x67, 0x7b, 0xf6, 0xf7, 0x7f, - 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xd1, 0xe1, 0x89, 0x3b, 0x04, 0x00, 0x00, -} - -func (m *TokenRate) 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 *TokenRate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Invalidated { - i-- - if m.Invalidated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.StakeToken { - i-- - if m.StakeToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - { - size := m.StakeMin.Size() - i -= size - if _, err := m.StakeMin.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.StakeCap.Size() - i -= size - if _, err := m.StakeCap.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.FeePayments { - i-- - if m.FeePayments { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - { - size := m.FeeRate.Size() - i -= size - if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintRate(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpsertTokenRate) 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 *MsgUpsertTokenRate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpsertTokenRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Proposer) > 0 { - i -= len(m.Proposer) - copy(dAtA[i:], m.Proposer) - i = encodeVarintRate(dAtA, i, uint64(len(m.Proposer))) - i-- - dAtA[i] = 0x42 - } - if m.Invalidated { - i-- - if m.Invalidated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.StakeToken { - i-- - if m.StakeToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - { - size := m.StakeMin.Size() - i -= size - if _, err := m.StakeMin.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.StakeCap.Size() - i -= size - if _, err := m.StakeCap.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.FeePayments { - i-- - if m.FeePayments { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - { - size := m.Rate.Size() - i -= size - if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintRate(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintRate(dAtA []byte, offset int, v uint64) int { - offset -= sovRate(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TokenRate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovRate(uint64(l)) - } - l = m.FeeRate.Size() - n += 1 + l + sovRate(uint64(l)) - if m.FeePayments { - n += 2 - } - l = m.StakeCap.Size() - n += 1 + l + sovRate(uint64(l)) - l = m.StakeMin.Size() - n += 1 + l + sovRate(uint64(l)) - if m.StakeToken { - n += 2 - } - if m.Invalidated { - n += 2 - } - return n -} - -func (m *MsgUpsertTokenRate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovRate(uint64(l)) - } - l = m.Rate.Size() - n += 1 + l + sovRate(uint64(l)) - if m.FeePayments { - n += 2 - } - l = m.StakeCap.Size() - n += 1 + l + sovRate(uint64(l)) - l = m.StakeMin.Size() - n += 1 + l + sovRate(uint64(l)) - if m.StakeToken { - n += 2 - } - if m.Invalidated { - n += 2 - } - l = len(m.Proposer) - if l > 0 { - n += 1 + l + sovRate(uint64(l)) - } - return n -} - -func sovRate(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRate(x uint64) (n int) { - return sovRate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TokenRate) 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 ErrIntOverflowRate - } - 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: TokenRate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRate: 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 ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - 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 FeeRate", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.FeePayments = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.StakeToken = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invalidated = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRate(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRate - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpsertTokenRate) 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 ErrIntOverflowRate - } - 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: MsgUpsertTokenRate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertTokenRate: 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 ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - 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 Rate", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.FeePayments = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.StakeToken = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invalidated = bool(v != 0) - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRate - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposer = append(m.Proposer[:0], dAtA[iNdEx:postIndex]...) - if m.Proposer == nil { - m.Proposer = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRate(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRate - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRate(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, ErrIntOverflowRate - } - 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, ErrIntOverflowRate - } - 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, ErrIntOverflowRate - } - 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, ErrInvalidLengthRate - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRate - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRate - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRate = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRate = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRate = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokens/types/token.pb.go b/x/tokens/types/token.pb.go new file mode 100644 index 000000000..135abe026 --- /dev/null +++ b/x/tokens/types/token.pb.go @@ -0,0 +1,1385 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/tokens/token.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// 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 + +type TokenInfo struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` + FeeEnabled bool `protobuf:"varint,4,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` + Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` + SupplyCap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=supply_cap,json=supplyCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply_cap"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeEnabled bool `protobuf:"varint,9,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,10,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,11,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,13,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,14,opt,name=decimals,proto3" json:"decimals,omitempty"` + Description string `protobuf:"bytes,15,opt,name=description,proto3" json:"description,omitempty"` + Website string `protobuf:"bytes,16,opt,name=website,proto3" json:"website,omitempty"` + Social string `protobuf:"bytes,17,opt,name=social,proto3" json:"social,omitempty"` + Holders uint64 `protobuf:"varint,18,opt,name=holders,proto3" json:"holders,omitempty"` + MintingFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,19,opt,name=minting_fee,json=mintingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"minting_fee"` + Owner string `protobuf:"bytes,20,opt,name=owner,proto3" json:"owner,omitempty"` + OwnerEditDisabled bool `protobuf:"varint,21,opt,name=owner_edit_disabled,json=ownerEditDisabled,proto3" json:"owner_edit_disabled,omitempty"` + NftMetadata string `protobuf:"bytes,22,opt,name=nft_metadata,json=nftMetadata,proto3" json:"nft_metadata,omitempty"` + NftHash string `protobuf:"bytes,23,opt,name=nft_hash,json=nftHash,proto3" json:"nft_hash,omitempty"` +} + +func (m *TokenInfo) Reset() { *m = TokenInfo{} } +func (m *TokenInfo) String() string { return proto.CompactTextString(m) } +func (*TokenInfo) ProtoMessage() {} +func (*TokenInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_0ed83e3668468753, []int{0} +} +func (m *TokenInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokenInfo.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 *TokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfo.Merge(m, src) +} +func (m *TokenInfo) XXX_Size() int { + return m.Size() +} +func (m *TokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenInfo proto.InternalMessageInfo + +func (m *TokenInfo) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *TokenInfo) GetTokenType() string { + if m != nil { + return m.TokenType + } + return "" +} + +func (m *TokenInfo) GetFeeEnabled() bool { + if m != nil { + return m.FeeEnabled + } + return false +} + +func (m *TokenInfo) GetStakeEnabled() bool { + if m != nil { + return m.StakeEnabled + } + return false +} + +func (m *TokenInfo) GetInactive() bool { + if m != nil { + return m.Inactive + } + return false +} + +func (m *TokenInfo) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *TokenInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TokenInfo) GetIcon() string { + if m != nil { + return m.Icon + } + return "" +} + +func (m *TokenInfo) GetDecimals() uint32 { + if m != nil { + return m.Decimals + } + return 0 +} + +func (m *TokenInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *TokenInfo) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *TokenInfo) GetSocial() string { + if m != nil { + return m.Social + } + return "" +} + +func (m *TokenInfo) GetHolders() uint64 { + if m != nil { + return m.Holders + } + return 0 +} + +func (m *TokenInfo) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *TokenInfo) GetOwnerEditDisabled() bool { + if m != nil { + return m.OwnerEditDisabled + } + return false +} + +func (m *TokenInfo) GetNftMetadata() string { + if m != nil { + return m.NftMetadata + } + return "" +} + +func (m *TokenInfo) GetNftHash() string { + if m != nil { + return m.NftHash + } + return "" +} + +func init() { + proto.RegisterType((*TokenInfo)(nil), "kira.tokens.TokenInfo") +} + +func init() { proto.RegisterFile("kira/tokens/token.proto", fileDescriptor_0ed83e3668468753) } + +var fileDescriptor_0ed83e3668468753 = []byte{ + // 578 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4f, 0x6f, 0xd3, 0x30, + 0x1c, 0x6d, 0x60, 0x6b, 0x9b, 0x5f, 0x37, 0xd8, 0xbc, 0xb1, 0x99, 0x49, 0xa4, 0x65, 0x48, 0xa8, + 0x17, 0x92, 0x03, 0x37, 0x8e, 0xdd, 0x1f, 0x51, 0xa1, 0x09, 0x29, 0xda, 0x89, 0x4b, 0xe4, 0x26, + 0xbf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c, 0x64, 0x91, + 0x61, 0xad, 0x28, 0x19, 0x78, 0xc3, 0xb5, 0x78, 0x09, 0xc9, 0x67, 0xe8, 0x95, 0x5c, 0x68, 0x2e, + 0xa6, 0x49, 0x8e, 0x48, 0x77, 0x1e, 0x75, 0x39, 0xa0, 0xb1, 0x38, 0x45, 0x34, 0xaf, 0x4a, 0x5e, + 0x0a, 0xac, 0xe9, 0xae, 0x7b, 0x55, 0x16, 0x90, 0x10, 0x76, 0x6c, 0x91, 0x60, 0xc6, 0x75, 0x92, + 0x71, 0xe5, 0x72, 0x7f, 0x61, 0x73, 0xdd, 0xb6, 0xd2, 0x49, 0xc6, 0xf5, 0x71, 0x23, 0x90, 0xd7, + 0xb0, 0x21, 0x72, 0x9d, 0x94, 0xa8, 0x59, 0xc6, 0x34, 0xa3, 0x7b, 0x2e, 0x05, 0x91, 0xeb, 0xb3, + 0x86, 0x22, 0x2f, 0xa1, 0x6b, 0xa6, 0xcc, 0x98, 0x9a, 0xd1, 0x7d, 0x17, 0x83, 0xc8, 0xf5, 0x47, + 0xa6, 0x66, 0xa3, 0xd1, 0xd5, 0x6d, 0xe0, 0x5d, 0xdf, 0x06, 0xde, 0xaf, 0xdb, 0xc0, 0xfb, 0x7e, + 0x17, 0xb4, 0xae, 0xef, 0x82, 0xd6, 0x8f, 0xbb, 0xa0, 0xf5, 0x65, 0x78, 0xef, 0x44, 0x9f, 0x78, + 0xcd, 0x8e, 0x64, 0x8d, 0x91, 0xc2, 0x39, 0xe3, 0xd1, 0xb7, 0xd5, 0xa7, 0x62, 0xce, 0x35, 0x69, + 0xdb, 0x2f, 0xe3, 0xfd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x09, 0x1a, 0x25, 0x8f, 0x70, 0x04, + 0x00, 0x00, +} + +func (m *TokenInfo) 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 *TokenInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NftHash) > 0 { + i -= len(m.NftHash) + copy(dAtA[i:], m.NftHash) + i = encodeVarintToken(dAtA, i, uint64(len(m.NftHash))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.NftMetadata) > 0 { + i -= len(m.NftMetadata) + copy(dAtA[i:], m.NftMetadata) + i = encodeVarintToken(dAtA, i, uint64(len(m.NftMetadata))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.OwnerEditDisabled { + i-- + if m.OwnerEditDisabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintToken(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + { + size := m.MintingFee.Size() + i -= size + if _, err := m.MintingFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + if m.Holders != 0 { + i = encodeVarintToken(dAtA, i, uint64(m.Holders)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if len(m.Social) > 0 { + i -= len(m.Social) + copy(dAtA[i:], m.Social) + i = encodeVarintToken(dAtA, i, uint64(len(m.Social))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintToken(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintToken(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x7a + } + if m.Decimals != 0 { + i = encodeVarintToken(dAtA, i, uint64(m.Decimals)) + i-- + dAtA[i] = 0x70 + } + if len(m.Icon) > 0 { + i -= len(m.Icon) + copy(dAtA[i:], m.Icon) + i = encodeVarintToken(dAtA, i, uint64(len(m.Icon))) + i-- + dAtA[i] = 0x6a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintToken(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x62 + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintToken(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x5a + } + if m.Inactive { + i-- + if m.Inactive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.StakeEnabled { + i-- + if m.StakeEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + { + size := m.StakeMin.Size() + i -= size + if _, err := m.StakeMin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size := m.StakeCap.Size() + i -= size + if _, err := m.StakeCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.SupplyCap.Size() + i -= size + if _, err := m.SupplyCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.Supply.Size() + i -= size + if _, err := m.Supply.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.FeeEnabled { + i-- + if m.FeeEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + { + size := m.FeeRate.Size() + i -= size + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.TokenType) > 0 { + i -= len(m.TokenType) + copy(dAtA[i:], m.TokenType) + i = encodeVarintToken(dAtA, i, uint64(len(m.TokenType))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintToken(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintToken(dAtA []byte, offset int, v uint64) int { + offset -= sovToken(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TokenInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + l = len(m.TokenType) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + l = m.FeeRate.Size() + n += 1 + l + sovToken(uint64(l)) + if m.FeeEnabled { + n += 2 + } + l = m.Supply.Size() + n += 1 + l + sovToken(uint64(l)) + l = m.SupplyCap.Size() + n += 1 + l + sovToken(uint64(l)) + l = m.StakeCap.Size() + n += 1 + l + sovToken(uint64(l)) + l = m.StakeMin.Size() + n += 1 + l + sovToken(uint64(l)) + if m.StakeEnabled { + n += 2 + } + if m.Inactive { + n += 2 + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + l = len(m.Icon) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + if m.Decimals != 0 { + n += 1 + sovToken(uint64(m.Decimals)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } + l = len(m.Social) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } + if m.Holders != 0 { + n += 2 + sovToken(uint64(m.Holders)) + } + l = m.MintingFee.Size() + n += 2 + l + sovToken(uint64(l)) + l = len(m.Owner) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } + if m.OwnerEditDisabled { + n += 3 + } + l = len(m.NftMetadata) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } + l = len(m.NftHash) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } + return n +} + +func sovToken(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozToken(x uint64) (n int) { + return sovToken(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *TokenInfo) 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 ErrIntOverflowToken + } + 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: TokenInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenInfo: 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 ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + 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 TokenType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FeeEnabled = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplyCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SupplyCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StakeEnabled = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Inactive = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Icon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + 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 ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimals |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Social", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Social = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Holders", wireType) + } + m.Holders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Holders |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintingFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MintingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerEditDisabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.OwnerEditDisabled = bool(v != 0) + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftMetadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NftMetadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NftHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipToken(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthToken + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipToken(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, ErrIntOverflowToken + } + 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, ErrIntOverflowToken + } + 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, ErrIntOverflowToken + } + 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, ErrInvalidLengthToken + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupToken + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthToken + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthToken = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowToken = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupToken = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/tokens/types/tx.pb.go b/x/tokens/types/tx.pb.go index 29abfaa9a..ece8c92f0 100644 --- a/x/tokens/types/tx.pb.go +++ b/x/tokens/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -28,21 +29,45 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type MsgUpsertTokenAliasResponse struct { +type MsgUpsertTokenInfo struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` + FeeEnabled bool `protobuf:"varint,4,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` + Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` + SupplyCap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=supply_cap,json=supplyCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply_cap"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeEnabled bool `protobuf:"varint,9,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,10,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,11,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,13,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,14,opt,name=decimals,proto3" json:"decimals,omitempty"` + Description string `protobuf:"bytes,15,opt,name=description,proto3" json:"description,omitempty"` + Website string `protobuf:"bytes,16,opt,name=website,proto3" json:"website,omitempty"` + Social string `protobuf:"bytes,17,opt,name=social,proto3" json:"social,omitempty"` + Holders uint64 `protobuf:"varint,18,opt,name=holders,proto3" json:"holders,omitempty"` + MintingFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,19,opt,name=minting_fee,json=mintingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"minting_fee"` + Owner string `protobuf:"bytes,20,opt,name=owner,proto3" json:"owner,omitempty"` + OwnerEditDisabled bool `protobuf:"varint,21,opt,name=owner_edit_disabled,json=ownerEditDisabled,proto3" json:"owner_edit_disabled,omitempty"` + NftMetadata string `protobuf:"bytes,22,opt,name=nft_metadata,json=nftMetadata,proto3" json:"nft_metadata,omitempty"` + NftHash string `protobuf:"bytes,23,opt,name=nft_hash,json=nftHash,proto3" json:"nft_hash,omitempty"` + Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,24,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` } -func (m *MsgUpsertTokenAliasResponse) Reset() { *m = MsgUpsertTokenAliasResponse{} } -func (m *MsgUpsertTokenAliasResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertTokenAliasResponse) ProtoMessage() {} -func (*MsgUpsertTokenAliasResponse) Descriptor() ([]byte, []int) { +func (m *MsgUpsertTokenInfo) Reset() { *m = MsgUpsertTokenInfo{} } +func (m *MsgUpsertTokenInfo) String() string { return proto.CompactTextString(m) } +func (*MsgUpsertTokenInfo) ProtoMessage() {} +func (*MsgUpsertTokenInfo) Descriptor() ([]byte, []int) { return fileDescriptor_9bac5a72e1a3117c, []int{0} } -func (m *MsgUpsertTokenAliasResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpsertTokenInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpsertTokenAliasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpsertTokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpsertTokenAliasResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpsertTokenInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -52,33 +77,159 @@ func (m *MsgUpsertTokenAliasResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *MsgUpsertTokenAliasResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertTokenAliasResponse.Merge(m, src) +func (m *MsgUpsertTokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpsertTokenInfo.Merge(m, src) } -func (m *MsgUpsertTokenAliasResponse) XXX_Size() int { +func (m *MsgUpsertTokenInfo) XXX_Size() int { return m.Size() } -func (m *MsgUpsertTokenAliasResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertTokenAliasResponse.DiscardUnknown(m) +func (m *MsgUpsertTokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpsertTokenInfo.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpsertTokenAliasResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpsertTokenInfo proto.InternalMessageInfo -type MsgUpsertTokenRateResponse struct { +func (m *MsgUpsertTokenInfo) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetTokenType() string { + if m != nil { + return m.TokenType + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetFeeEnabled() bool { + if m != nil { + return m.FeeEnabled + } + return false +} + +func (m *MsgUpsertTokenInfo) GetStakeEnabled() bool { + if m != nil { + return m.StakeEnabled + } + return false +} + +func (m *MsgUpsertTokenInfo) GetInactive() bool { + if m != nil { + return m.Inactive + } + return false +} + +func (m *MsgUpsertTokenInfo) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetIcon() string { + if m != nil { + return m.Icon + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetDecimals() uint32 { + if m != nil { + return m.Decimals + } + return 0 +} + +func (m *MsgUpsertTokenInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetSocial() string { + if m != nil { + return m.Social + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetHolders() uint64 { + if m != nil { + return m.Holders + } + return 0 +} + +func (m *MsgUpsertTokenInfo) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetOwnerEditDisabled() bool { + if m != nil { + return m.OwnerEditDisabled + } + return false +} + +func (m *MsgUpsertTokenInfo) GetNftMetadata() string { + if m != nil { + return m.NftMetadata + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetNftHash() string { + if m != nil { + return m.NftHash + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetProposer() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Proposer + } + return nil +} + +type MsgUpsertTokenInfoResponse struct { } -func (m *MsgUpsertTokenRateResponse) Reset() { *m = MsgUpsertTokenRateResponse{} } -func (m *MsgUpsertTokenRateResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertTokenRateResponse) ProtoMessage() {} -func (*MsgUpsertTokenRateResponse) Descriptor() ([]byte, []int) { +func (m *MsgUpsertTokenInfoResponse) Reset() { *m = MsgUpsertTokenInfoResponse{} } +func (m *MsgUpsertTokenInfoResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpsertTokenInfoResponse) ProtoMessage() {} +func (*MsgUpsertTokenInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9bac5a72e1a3117c, []int{1} } -func (m *MsgUpsertTokenRateResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpsertTokenInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpsertTokenRateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpsertTokenInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpsertTokenRateResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpsertTokenInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -88,17 +239,17 @@ func (m *MsgUpsertTokenRateResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *MsgUpsertTokenRateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertTokenRateResponse.Merge(m, src) +func (m *MsgUpsertTokenInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpsertTokenInfoResponse.Merge(m, src) } -func (m *MsgUpsertTokenRateResponse) XXX_Size() int { +func (m *MsgUpsertTokenInfoResponse) XXX_Size() int { return m.Size() } -func (m *MsgUpsertTokenRateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertTokenRateResponse.DiscardUnknown(m) +func (m *MsgUpsertTokenInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpsertTokenInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpsertTokenRateResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpsertTokenInfoResponse proto.InternalMessageInfo type MsgEthereumTx struct { TxType string `protobuf:"bytes,1,opt,name=tx_type,json=txType,proto3" json:"tx_type,omitempty"` @@ -205,8 +356,8 @@ func (m *MsgEthereumTxResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgEthereumTxResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgUpsertTokenAliasResponse)(nil), "kira.tokens.MsgUpsertTokenAliasResponse") - proto.RegisterType((*MsgUpsertTokenRateResponse)(nil), "kira.tokens.MsgUpsertTokenRateResponse") + proto.RegisterType((*MsgUpsertTokenInfo)(nil), "kira.tokens.MsgUpsertTokenInfo") + proto.RegisterType((*MsgUpsertTokenInfoResponse)(nil), "kira.tokens.MsgUpsertTokenInfoResponse") proto.RegisterType((*MsgEthereumTx)(nil), "kira.tokens.MsgEthereumTx") proto.RegisterType((*MsgEthereumTxResponse)(nil), "kira.tokens.MsgEthereumTxResponse") } @@ -214,30 +365,56 @@ func init() { func init() { proto.RegisterFile("kira/tokens/tx.proto", fileDescriptor_9bac5a72e1a3117c) } var fileDescriptor_9bac5a72e1a3117c = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcd, 0x4e, 0xea, 0x40, - 0x14, 0xc7, 0x29, 0x10, 0x6e, 0xee, 0xdc, 0x6b, 0x34, 0x13, 0x84, 0x66, 0xd4, 0x4a, 0xba, 0xb1, - 0xab, 0x36, 0xd1, 0x27, 0x10, 0xe3, 0x4a, 0xd9, 0x34, 0xb8, 0xd1, 0x44, 0x33, 0xc8, 0xb1, 0x6d, - 0xf8, 0x98, 0xc9, 0x9c, 0x21, 0x29, 0x3e, 0x05, 0x8f, 0xe5, 0x92, 0xa5, 0x4b, 0x03, 0x2f, 0x62, - 0xfa, 0x01, 0x16, 0xa2, 0xb2, 0x3b, 0xfd, 0xfd, 0xfe, 0x67, 0x4e, 0xe7, 0x64, 0x48, 0x7d, 0x10, - 0x29, 0xee, 0x69, 0x31, 0x80, 0x31, 0x7a, 0x3a, 0x76, 0xa5, 0x12, 0x5a, 0xd0, 0x7f, 0x09, 0x75, - 0x33, 0xca, 0xea, 0x81, 0x08, 0x44, 0xca, 0xbd, 0xa4, 0xca, 0x22, 0xac, 0x59, 0x6c, 0xe4, 0xc3, - 0x88, 0x63, 0x2e, 0x58, 0x51, 0x48, 0x25, 0xa4, 0x40, 0x3e, 0xcc, 0x5d, 0xa3, 0xe8, 0x14, 0xd7, - 0x90, 0x73, 0xb3, 0xc8, 0x5f, 0x14, 0xc0, 0x6b, 0x6e, 0xec, 0x13, 0x72, 0xd4, 0xc1, 0xe0, 0x4e, - 0x22, 0x28, 0xdd, 0x4d, 0xfc, 0x65, 0x32, 0xca, 0x07, 0x94, 0x62, 0x8c, 0x60, 0x1f, 0x13, 0xb6, - 0xa9, 0x7d, 0xae, 0x61, 0x6d, 0x43, 0xb2, 0xd7, 0xc1, 0xe0, 0x5a, 0x87, 0xa0, 0x60, 0x32, 0xea, - 0xc6, 0xb4, 0x49, 0xfe, 0xe8, 0xf8, 0x49, 0x4f, 0x25, 0x98, 0x46, 0xcb, 0x70, 0xfe, 0xfa, 0x35, - 0x1d, 0x77, 0xa7, 0x12, 0x68, 0x83, 0xd4, 0x10, 0xc6, 0x7d, 0x50, 0x66, 0x39, 0xe3, 0xd9, 0x17, - 0xa5, 0xa4, 0x1a, 0x72, 0x0c, 0xcd, 0x4a, 0x4a, 0xd3, 0x3a, 0x61, 0x7d, 0xae, 0xb9, 0x59, 0x6d, - 0x19, 0xce, 0x7f, 0x3f, 0xad, 0xed, 0x26, 0x39, 0xdc, 0x98, 0xb4, 0xfa, 0x85, 0xf3, 0x59, 0x99, - 0x54, 0x3a, 0x18, 0xd0, 0x47, 0x72, 0xb0, 0x7d, 0x09, 0xda, 0x72, 0x0b, 0x6b, 0x76, 0xbf, 0xb9, - 0x26, 0x73, 0x76, 0x25, 0x56, 0x73, 0xe8, 0x03, 0xd9, 0xdf, 0xda, 0x02, 0x3d, 0xfd, 0xa5, 0x39, - 0x09, 0xb0, 0xb3, 0x1d, 0x81, 0xf5, 0xe1, 0xb7, 0x84, 0x14, 0x96, 0xc8, 0xb6, 0xdb, 0xbe, 0x1c, - 0xb3, 0x7f, 0x76, 0xab, 0xd3, 0xda, 0xed, 0xb7, 0x85, 0x65, 0xcc, 0x17, 0x96, 0xf1, 0xb1, 0xb0, - 0x8c, 0xd9, 0xd2, 0x2a, 0xcd, 0x97, 0x56, 0xe9, 0x7d, 0x69, 0x95, 0xee, 0x9d, 0x20, 0xd2, 0xe1, - 0xa4, 0xe7, 0x3e, 0x8b, 0x91, 0x77, 0x13, 0x29, 0x7e, 0x25, 0x14, 0x78, 0x08, 0x03, 0x1e, 0x79, - 0xf1, 0xfa, 0x8d, 0x4e, 0x25, 0x60, 0xaf, 0x96, 0xbe, 0x8e, 0x8b, 0xcf, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x0d, 0xf3, 0x19, 0xdb, 0xbf, 0x02, 0x00, 0x00, + // 779 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x92, 0xd4, 0xb1, 0x9f, 0x1d, 0xd2, 0x4e, 0xd3, 0x66, 0xb0, 0xc0, 0x36, 0x8b, 0x04, + 0xbe, 0x74, 0x2d, 0xc1, 0x8d, 0x5b, 0xdd, 0xa4, 0xc2, 0x02, 0x0b, 0x69, 0x15, 0x2e, 0x70, 0x58, + 0xc6, 0xbb, 0x6f, 0xed, 0x91, 0x77, 0x67, 0x56, 0x3b, 0x13, 0x6a, 0xf3, 0x2b, 0xf8, 0x29, 0xfc, + 0x8c, 0x1e, 0x73, 0x44, 0x1c, 0x2c, 0x94, 0xfc, 0x83, 0x1e, 0x39, 0xa1, 0x99, 0xd9, 0x35, 0x4e, + 0x2a, 0x44, 0xd3, 0x93, 0xdf, 0xfb, 0xbe, 0x99, 0xef, 0xcd, 0xbc, 0x79, 0xfb, 0x19, 0x4e, 0x96, + 0xbc, 0x64, 0x23, 0x2d, 0x97, 0x28, 0xd4, 0x48, 0xaf, 0x82, 0xa2, 0x94, 0x5a, 0x92, 0xb6, 0x41, + 0x03, 0x87, 0x76, 0x4f, 0xe6, 0x72, 0x2e, 0x2d, 0x3e, 0x32, 0x91, 0x5b, 0xd2, 0xed, 0xee, 0x6e, + 0x2c, 0x4a, 0x59, 0x48, 0xc5, 0xb2, 0x8a, 0x3b, 0xbd, 0x25, 0x6a, 0x7e, 0x2a, 0x82, 0xee, 0x12, + 0x69, 0x89, 0xf8, 0x2b, 0x3a, 0xc6, 0xbf, 0x6a, 0x02, 0x99, 0xaa, 0xf9, 0x0f, 0x85, 0xc2, 0x52, + 0x5f, 0x98, 0x05, 0x13, 0x91, 0x4a, 0x72, 0x02, 0x0f, 0x12, 0x14, 0x32, 0xa7, 0xde, 0xc0, 0x1b, + 0xb6, 0x42, 0x97, 0x90, 0x4f, 0x00, 0xac, 0x46, 0xa4, 0xd7, 0x05, 0xd2, 0x0f, 0x2c, 0xd5, 0xb2, + 0xc8, 0xc5, 0xba, 0x40, 0x32, 0x81, 0x66, 0x8a, 0x18, 0x95, 0x4c, 0x23, 0xdd, 0x37, 0xe4, 0x38, + 0x78, 0xbd, 0xe9, 0xef, 0xfd, 0xb9, 0xe9, 0x7f, 0x3e, 0xe7, 0x7a, 0x71, 0x39, 0x0b, 0x62, 0x99, + 0x8f, 0x62, 0xa9, 0x72, 0xa9, 0xaa, 0x9f, 0x67, 0x2a, 0x59, 0x8e, 0x8c, 0x9a, 0x0a, 0xce, 0x30, + 0x0e, 0x0f, 0x53, 0xc4, 0x90, 0x69, 0x24, 0x7d, 0x68, 0x1b, 0x29, 0x14, 0x6c, 0x96, 0x61, 0x42, + 0x0f, 0x06, 0xde, 0xb0, 0x19, 0x42, 0x8a, 0x78, 0xee, 0x10, 0xf2, 0x12, 0x1a, 0xea, 0xb2, 0x28, + 0xb2, 0x35, 0x7d, 0x70, 0xef, 0x4a, 0x13, 0xa1, 0xc3, 0x6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0x99, 0xa1, 0xb1, 0x17, 0xdb, 0x77, 0x43, 0x63, 0x62, 0x83, 0xd9, + 0x5e, 0x18, 0xa3, 0xe8, 0x84, 0x36, 0xf6, 0x4f, 0xe1, 0xc9, 0xad, 0x4a, 0xf5, 0x11, 0xbe, 0xfc, + 0xdd, 0x83, 0xfd, 0xa9, 0x9a, 0x93, 0x9f, 0xe0, 0xf8, 0xae, 0xef, 0xf5, 0x83, 0x1d, 0x07, 0x0e, + 0xde, 0xbe, 0x46, 0xf7, 0x8b, 0xff, 0x59, 0x50, 0x17, 0x21, 0xdf, 0x01, 0xec, 0x5c, 0xb2, 0x7b, + 0x77, 0xdb, 0xbf, 0x5c, 0xd7, 0xff, 0x6f, 0xae, 0x56, 0x1b, 0x8f, 0x5f, 0x5f, 0xf7, 0xbc, 0xab, + 0xeb, 0x9e, 0xf7, 0xd7, 0x75, 0xcf, 0xfb, 0xed, 0xa6, 0xb7, 0x77, 0x75, 0xd3, 0xdb, 0xfb, 0xe3, + 0xa6, 0xb7, 0xf7, 0xe3, 0x70, 0xe7, 0x99, 0xbe, 0xe5, 0x25, 0x7b, 0x21, 0x4b, 0x1c, 0x29, 0x5c, + 0x32, 0x3e, 0x5a, 0x6d, 0xff, 0x0a, 0xcc, 0x63, 0xcd, 0x1a, 0xd6, 0xf1, 0xbf, 0xfa, 0x27, 0x00, + 0x00, 0xff, 0xff, 0x52, 0x92, 0xb4, 0x37, 0x7b, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -252,10 +429,8 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // UpsertTokenAlias defines a method to upsert token alias - UpsertTokenAlias(ctx context.Context, in *MsgUpsertTokenAlias, opts ...grpc.CallOption) (*MsgUpsertTokenAliasResponse, error) - // UpsertTokenRate defines a method to upsert token rate - UpsertTokenRate(ctx context.Context, in *MsgUpsertTokenRate, opts ...grpc.CallOption) (*MsgUpsertTokenRateResponse, error) + // UpsertTokenInfo defines a method to upsert token rate + UpsertTokenInfo(ctx context.Context, in *MsgUpsertTokenInfo, opts ...grpc.CallOption) (*MsgUpsertTokenInfoResponse, error) // EthereumTx defines a method to send ethereum transaction EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) } @@ -268,18 +443,9 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) UpsertTokenAlias(ctx context.Context, in *MsgUpsertTokenAlias, opts ...grpc.CallOption) (*MsgUpsertTokenAliasResponse, error) { - out := new(MsgUpsertTokenAliasResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Msg/UpsertTokenAlias", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpsertTokenRate(ctx context.Context, in *MsgUpsertTokenRate, opts ...grpc.CallOption) (*MsgUpsertTokenRateResponse, error) { - out := new(MsgUpsertTokenRateResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Msg/UpsertTokenRate", in, out, opts...) +func (c *msgClient) UpsertTokenInfo(ctx context.Context, in *MsgUpsertTokenInfo, opts ...grpc.CallOption) (*MsgUpsertTokenInfoResponse, error) { + out := new(MsgUpsertTokenInfoResponse) + err := c.cc.Invoke(ctx, "/kira.tokens.Msg/UpsertTokenInfo", in, out, opts...) if err != nil { return nil, err } @@ -297,10 +463,8 @@ func (c *msgClient) EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...g // MsgServer is the server API for Msg service. type MsgServer interface { - // UpsertTokenAlias defines a method to upsert token alias - UpsertTokenAlias(context.Context, *MsgUpsertTokenAlias) (*MsgUpsertTokenAliasResponse, error) - // UpsertTokenRate defines a method to upsert token rate - UpsertTokenRate(context.Context, *MsgUpsertTokenRate) (*MsgUpsertTokenRateResponse, error) + // UpsertTokenInfo defines a method to upsert token rate + UpsertTokenInfo(context.Context, *MsgUpsertTokenInfo) (*MsgUpsertTokenInfoResponse, error) // EthereumTx defines a method to send ethereum transaction EthereumTx(context.Context, *MsgEthereumTx) (*MsgEthereumTxResponse, error) } @@ -309,11 +473,8 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) UpsertTokenAlias(ctx context.Context, req *MsgUpsertTokenAlias) (*MsgUpsertTokenAliasResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpsertTokenAlias not implemented") -} -func (*UnimplementedMsgServer) UpsertTokenRate(ctx context.Context, req *MsgUpsertTokenRate) (*MsgUpsertTokenRateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpsertTokenRate not implemented") +func (*UnimplementedMsgServer) UpsertTokenInfo(ctx context.Context, req *MsgUpsertTokenInfo) (*MsgUpsertTokenInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpsertTokenInfo not implemented") } func (*UnimplementedMsgServer) EthereumTx(ctx context.Context, req *MsgEthereumTx) (*MsgEthereumTxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EthereumTx not implemented") @@ -323,38 +484,20 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_UpsertTokenAlias_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpsertTokenAlias) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpsertTokenAlias(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.tokens.Msg/UpsertTokenAlias", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpsertTokenAlias(ctx, req.(*MsgUpsertTokenAlias)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpsertTokenRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpsertTokenRate) +func _Msg_UpsertTokenInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpsertTokenInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).UpsertTokenRate(ctx, in) + return srv.(MsgServer).UpsertTokenInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kira.tokens.Msg/UpsertTokenRate", + FullMethod: "/kira.tokens.Msg/UpsertTokenInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpsertTokenRate(ctx, req.(*MsgUpsertTokenRate)) + return srv.(MsgServer).UpsertTokenInfo(ctx, req.(*MsgUpsertTokenInfo)) } return interceptor(ctx, in, info, handler) } @@ -382,12 +525,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "UpsertTokenAlias", - Handler: _Msg_UpsertTokenAlias_Handler, - }, - { - MethodName: "UpsertTokenRate", - Handler: _Msg_UpsertTokenRate_Handler, + MethodName: "UpsertTokenInfo", + Handler: _Msg_UpsertTokenInfo_Handler, }, { MethodName: "EthereumTx", @@ -398,7 +537,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "kira/tokens/tx.proto", } -func (m *MsgUpsertTokenAliasResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpsertTokenInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -408,20 +547,232 @@ func (m *MsgUpsertTokenAliasResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpsertTokenAliasResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpsertTokenInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpsertTokenAliasResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if len(m.NftHash) > 0 { + i -= len(m.NftHash) + copy(dAtA[i:], m.NftHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.NftHash))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.NftMetadata) > 0 { + i -= len(m.NftMetadata) + copy(dAtA[i:], m.NftMetadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.NftMetadata))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.OwnerEditDisabled { + i-- + if m.OwnerEditDisabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + { + size := m.MintingFee.Size() + i -= size + if _, err := m.MintingFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + if m.Holders != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Holders)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if len(m.Social) > 0 { + i -= len(m.Social) + copy(dAtA[i:], m.Social) + i = encodeVarintTx(dAtA, i, uint64(len(m.Social))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintTx(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x7a + } + if m.Decimals != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Decimals)) + i-- + dAtA[i] = 0x70 + } + if len(m.Icon) > 0 { + i -= len(m.Icon) + copy(dAtA[i:], m.Icon) + i = encodeVarintTx(dAtA, i, uint64(len(m.Icon))) + i-- + dAtA[i] = 0x6a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x62 + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintTx(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x5a + } + if m.Inactive { + i-- + if m.Inactive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.StakeEnabled { + i-- + if m.StakeEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + { + size := m.StakeMin.Size() + i -= size + if _, err := m.StakeMin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size := m.StakeCap.Size() + i -= size + if _, err := m.StakeCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.SupplyCap.Size() + i -= size + if _, err := m.SupplyCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.Supply.Size() + i -= size + if _, err := m.Supply.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.FeeEnabled { + i-- + if m.FeeEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + { + size := m.FeeRate.Size() + i -= size + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.TokenType) > 0 { + i -= len(m.TokenType) + copy(dAtA[i:], m.TokenType) + i = encodeVarintTx(dAtA, i, uint64(len(m.TokenType))) + 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 *MsgUpsertTokenRateResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpsertTokenInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -431,12 +782,12 @@ func (m *MsgUpsertTokenRateResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpsertTokenRateResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpsertTokenInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpsertTokenRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpsertTokenInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -529,16 +880,94 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgUpsertTokenAliasResponse) Size() (n int) { +func (m *MsgUpsertTokenInfo) 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.TokenType) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.FeeRate.Size() + n += 1 + l + sovTx(uint64(l)) + if m.FeeEnabled { + n += 2 + } + l = m.Supply.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.SupplyCap.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.StakeCap.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.StakeMin.Size() + n += 1 + l + sovTx(uint64(l)) + if m.StakeEnabled { + n += 2 + } + if m.Inactive { + n += 2 + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Icon) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Decimals != 0 { + n += 1 + sovTx(uint64(m.Decimals)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + l = len(m.Social) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + if m.Holders != 0 { + n += 2 + sovTx(uint64(m.Holders)) + } + l = m.MintingFee.Size() + n += 2 + l + sovTx(uint64(l)) + l = len(m.Owner) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + if m.OwnerEditDisabled { + n += 3 + } + l = len(m.NftMetadata) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + l = len(m.NftHash) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + l = len(m.Proposer) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } return n } -func (m *MsgUpsertTokenRateResponse) Size() (n int) { +func (m *MsgUpsertTokenInfoResponse) Size() (n int) { if m == nil { return 0 } @@ -587,7 +1016,7 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgUpsertTokenAliasResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -610,12 +1039,720 @@ func (m *MsgUpsertTokenAliasResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpsertTokenAliasResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpsertTokenInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertTokenAliasResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpsertTokenInfo: 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 TokenType", 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.TokenType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", 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 + } + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", 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.FeeEnabled = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", 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 + } + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplyCap", 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 + } + if err := m.SupplyCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", 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 + } + if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", 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 + } + if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", 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.StakeEnabled = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Inactive", 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.Inactive = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", 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.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Icon", 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.Icon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + 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 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", 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.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Social", 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.Social = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Holders", wireType) + } + m.Holders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Holders |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintingFee", 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 + } + if err := m.MintingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerEditDisabled", 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.OwnerEditDisabled = bool(v != 0) + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftMetadata", 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.NftMetadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftHash", 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.NftHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposer = append(m.Proposer[:0], dAtA[iNdEx:postIndex]...) + if m.Proposer == nil { + m.Proposer = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -637,7 +1774,7 @@ func (m *MsgUpsertTokenAliasResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpsertTokenRateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpsertTokenInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -660,10 +1797,10 @@ func (m *MsgUpsertTokenRateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpsertTokenRateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpsertTokenInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertTokenRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpsertTokenInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/tokens/types/types.go b/x/tokens/types/types.go index 299b31e5a..5217891a4 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -1,45 +1,65 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" ) -// NewTokenAlias generates a new token alias struct. -func NewTokenAlias( +// NewTokenInfo generates a new token rate struct. +func NewTokenInfo( + denom string, + tokenType string, + feeRate math.LegacyDec, + feeEnabled bool, + supply math.Int, + supplyCap math.Int, + stakeCap math.LegacyDec, + stakeMin math.Int, + stakeEnabled bool, + inactive bool, symbol string, name string, icon string, decimals uint32, - denoms []string, - invalidated bool, -) *TokenAlias { - return &TokenAlias{ - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, - Denoms: denoms, - Invalidated: invalidated, + description string, + website string, + social string, + holders uint64, + mintingFee math.Int, + owner string, + ownerEditDisabled bool, + nftMetadata string, + nftHash string, +) TokenInfo { + if tokenType == "adr43" { + decimals = 0 } -} - -// NewTokenRate generates a new token rate struct. -func NewTokenRate( - denom string, - feeRate sdk.Dec, - feePayments bool, - stakeCap sdk.Dec, - stakeMin sdk.Int, - stakeToken bool, - invalidated bool, -) *TokenRate { - return &TokenRate{ - Denom: denom, - FeeRate: feeRate, - FeePayments: feePayments, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeToken: stakeToken, - Invalidated: invalidated, + if tokenType == "adr20" { + nftHash = "" + nftMetadata = "" + } + return TokenInfo{ + Denom: denom, + TokenType: tokenType, + FeeRate: feeRate, + FeeEnabled: feeEnabled, + Supply: supply, + SupplyCap: supplyCap, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, + Description: description, + Website: website, + Social: social, + Holders: holders, + MintingFee: mintingFee, + Owner: owner, + OwnerEditDisabled: ownerEditDisabled, + NftMetadata: nftMetadata, + NftHash: nftHash, } } diff --git a/x/ubi/keeper/keeper.go b/x/ubi/keeper/keeper.go index 4edcc72d7..538e35bd3 100644 --- a/x/ubi/keeper/keeper.go +++ b/x/ubi/keeper/keeper.go @@ -15,16 +15,23 @@ type Keeper struct { bk types.BankKeeper sk types.SpendingKeeper dk types.DistrKeeper + tk types.TokensKeeper } // NewKeeper returns instance of a keeper -func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, bk types.BankKeeper, sk types.SpendingKeeper, dk types.DistrKeeper) Keeper { +func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, + bk types.BankKeeper, + sk types.SpendingKeeper, + dk types.DistrKeeper, + tk types.TokensKeeper, +) Keeper { return Keeper{ cdc: cdc, storeKey: storeKey, bk: bk, sk: sk, dk: dk, + tk: tk, } } diff --git a/x/ubi/keeper/ubi.go b/x/ubi/keeper/ubi.go index 2740358d5..44f7ddf6b 100644 --- a/x/ubi/keeper/ubi.go +++ b/x/ubi/keeper/ubi.go @@ -87,7 +87,7 @@ func (k Keeper) ProcessUBIRecord(ctx sdk.Context, record types.UBIRecord) error } coin := sdk.NewCoin(defaultDenom, amount) - err := k.bk.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(coin)) + err := k.tk.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(coin)) if err != nil { return err } diff --git a/x/ubi/types/expected_keepers.go b/x/ubi/types/expected_keepers.go index e2ef22d49..191d79534 100644 --- a/x/ubi/types/expected_keepers.go +++ b/x/ubi/types/expected_keepers.go @@ -3,6 +3,7 @@ package types import ( govtypes "github.com/KiraCore/sekai/x/gov/types" spendingtypes "github.com/KiraCore/sekai/x/spending/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,3 +23,9 @@ type SpendingKeeper interface { type DistrKeeper interface { InflationPossible(ctx sdk.Context) bool } + +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo +} diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 5f2233536..45c0b8729 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -3,6 +3,7 @@ package upgrade import ( "encoding/json" + sekaitypes "github.com/KiraCore/sekai/types" "github.com/KiraCore/sekai/x/upgrade/client/cli" "github.com/KiraCore/sekai/x/upgrade/keeper" "github.com/KiraCore/sekai/x/upgrade/types" @@ -41,6 +42,14 @@ func (b AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { // } func (b AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error { + genesis := types.GenesisState{} + err := marshaler.UnmarshalJSON(message, &genesis) + if err != nil { + return err + } + if sekaitypes.SekaiVersion != genesis.Version { + return types.ErrInvalidGenesisVersion + } return nil } @@ -90,6 +99,10 @@ func (am AppModule) InitGenesis( var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) + if genesisState.Version != sekaitypes.SekaiVersion { + panic(types.ErrInvalidGenesisVersion) + } + if genesisState.CurrentPlan != nil { am.upgradeKeeper.SaveCurrentPlan(ctx, *genesisState.CurrentPlan) } diff --git a/x/upgrade/types/errors.go b/x/upgrade/types/errors.go index b8c7c3e01..881cad9f7 100644 --- a/x/upgrade/types/errors.go +++ b/x/upgrade/types/errors.go @@ -5,5 +5,6 @@ import ( ) var ( - ErrInvalidUpgradeTime = errors.Register(ModuleName, 1, "invalid upgrade time") + ErrInvalidUpgradeTime = errors.Register(ModuleName, 1, "invalid upgrade time") + ErrInvalidGenesisVersion = errors.Register(ModuleName, 2, "invalid genesis version") ) diff --git a/x/upgrade/types/genesis.go b/x/upgrade/types/genesis.go index 48181e444..373c354df 100644 --- a/x/upgrade/types/genesis.go +++ b/x/upgrade/types/genesis.go @@ -1,8 +1,13 @@ package types +import ( + sekaitypes "github.com/KiraCore/sekai/types" +) + // DefaultGenesis returns the default CustomGo genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ + Version: sekaitypes.SekaiVersion, CurrentPlan: nil, NextPlan: nil, }