From 71a4ce8d7dc738b8f663ccf962bdf0f7864827b9 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 22 May 2024 08:38:24 +0800 Subject: [PATCH 01/14] use correct storekey for layer2 module --- app/app.go | 4 ++-- x/layer2/types/keys.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 0b4313cf..e89aea94 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,7 +311,7 @@ func NewInitApp( ) app.Layer2Keeper = layer2keeper.NewKeeper( - keys[collectivestypes.StoreKey], appCodec, + keys[layer2types.StoreKey], appCodec, app.BankKeeper, app.CustomStakingKeeper, app.CustomGovKeeper, diff --git a/x/layer2/types/keys.go b/x/layer2/types/keys.go index 3a59a287..ed073c9c 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 From 960c4c86fbbe1175bda12f2f612a968985240757 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 22 May 2024 09:08:30 +0800 Subject: [PATCH 02/14] fix typo for issuance config --- proto/kira/layer2/layer2.proto | 4 +- scripts/commands/layer2.sh | 4 +- x/layer2/client/cli/tx.go | 30 +- x/layer2/keeper/abci.go | 8 +- x/layer2/keeper/dapp_test.go | 4 +- .../keeper/lp_swap_redeem_convert_test.go | 8 +- x/layer2/keeper/msg_server_test.go | 6 +- x/layer2/proposal_handler.go | 2 +- x/layer2/types/layer2.go | 2 +- x/layer2/types/layer2.pb.go | 346 +++++++++--------- 10 files changed, 207 insertions(+), 207 deletions(-) diff --git a/proto/kira/layer2/layer2.proto b/proto/kira/layer2/layer2.proto index 24d96bf4..1dc47d2f 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) diff --git a/scripts/commands/layer2.sh b/scripts/commands/layer2.sh index 4c43209a..71101f95 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/x/layer2/client/cli/tx.go b/x/layer2/client/cli/tx.go index eda42524..03ec5fd1 100644 --- a/x/layer2/client/cli/tx.go +++ b/x/layer2/client/cli/tx.go @@ -28,7 +28,7 @@ const ( FlagControllerAccounts = "controller-accounts" FlagBinaryInfo = "binary-info" FlagLpPoolConfig = "lp-pool-config" - FlagIssuranceConfig = "issurance-config" + FlagIssuanceConfig = "issuance-config" FlagUpdateTimeMax = "update-time-max" FlagExecutorsMin = "executors-min" FlagExecutorsMax = "executors-max" @@ -157,14 +157,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) @@ -228,7 +228,7 @@ func GetTxCreateDappProposalCmd() *cobra.Command { }, Bin: []types.BinaryInfo{binaryInfo}, Pool: lpPoolConfig, - Issurance: issurance, + Issuance: issuance, UpdateTimeMax: updateMaxTime, ExecutorsMin: executorsMin, ExecutorsMax: executorsMax, @@ -265,7 +265,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.") @@ -728,14 +728,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) @@ -814,7 +814,7 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { }, Bin: []types.BinaryInfo{binaryInfo}, Pool: lpPoolConfig, - Issurance: issurance, + Issuance: issuance, UpdateTimeMax: updateMaxTime, ExecutorsMin: executorsMin, ExecutorsMax: executorsMax, @@ -852,7 +852,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.") diff --git a/x/layer2/keeper/abci.go b/x/layer2/keeper/abci.go index 1a93287e..ac5a7224 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) @@ -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 253bb748..ec98d642 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/lp_swap_redeem_convert_test.go b/x/layer2/keeper/lp_swap_redeem_convert_test.go index debb6d1d..21a87915 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(), @@ -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(), diff --git a/x/layer2/keeper/msg_server_test.go b/x/layer2/keeper/msg_server_test.go index 400b7e51..6b7542fe 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/proposal_handler.go b/x/layer2/proposal_handler.go index 59dfd07d..fe71efa8 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 diff --git a/x/layer2/types/layer2.go b/x/layer2/types/layer2.go index 22abd610..2afbe4ca 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 9f00317d..defa3221 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 } @@ -429,7 +429,7 @@ type Dapp struct { 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"` + 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"` @@ -550,11 +550,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 { @@ -1636,7 +1636,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 +1657,144 @@ func init() { func init() { proto.RegisterFile("kira/layer2/layer2.proto", fileDescriptor_4070283bbe72a11a) } var fileDescriptor_4070283bbe72a11a = []byte{ - // 2181 bytes of a gzipped FileDescriptorProto + // 2179 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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, 0x88, - 0x06, 0x67, 0x5c, 0xc3, 0x36, 0x99, 0x4b, 0x14, 0x8f, 0x44, 0x6c, 0x75, 0x7f, 0x25, 0x1b, 0xdb, - 0x71, 0xea, 0x65, 0x74, 0xfa, 0x94, 0x94, 0x12, 0xa9, 0x53, 0x54, 0x55, 0x78, 0x2b, 0x55, 0x39, - 0x1f, 0x0f, 0x57, 0x44, 0xe6, 0xd4, 0x8b, 0x1e, 0x8e, 0xeb, 0x2f, 0x4a, 0xa4, 0xb8, 0xc5, 0x92, - 0xe4, 0xc6, 0xb8, 0xae, 0x90, 0x99, 0x80, 0xc7, 0x32, 0xb2, 0x07, 0x64, 0x26, 0xb4, 0x46, 0xca, - 0x01, 0xd7, 0xbe, 0x12, 0x49, 0x2a, 0x64, 0x6c, 0xc3, 0x3b, 0x2a, 0x82, 0x83, 0x79, 0xce, 0xbb, - 0x5a, 0xa4, 0x59, 0x84, 0xb3, 0x29, 0xec, 0x12, 0xca, 0x9e, 0xcc, 0xe2, 0x0b, 0x63, 0x93, 0x29, - 0xbe, 0x60, 0xa1, 0x3b, 0x9b, 0x65, 0x0a, 0xcc, 0x30, 0x0c, 0xd2, 0xd7, 0xee, 0x9c, 0xc1, 0xc2, - 0x98, 0x7e, 0x46, 0xca, 0xfe, 0xf0, 0x62, 0xb8, 0x25, 0x4c, 0x66, 0x77, 0x2c, 0x99, 0x47, 0x2e, - 0x8e, 0xcd, 0xe5, 0x51, 0x0a, 0x6d, 0x90, 0x42, 0x57, 0xc4, 0xee, 0x7c, 0xad, 0xb0, 0x56, 0x7e, - 0xf4, 0xee, 0x18, 0x73, 0x98, 0xe5, 0x96, 0x08, 0x48, 0xfa, 0x98, 0x14, 0x13, 0x29, 0x43, 0x97, - 0xdc, 0x70, 0x71, 0x46, 0xd3, 0xd2, 0x72, 0x10, 0x4c, 0x3f, 0x23, 0xf3, 0x22, 0xcb, 0x16, 0xb7, - 0x8c, 0xcc, 0xf7, 0xc7, 0x98, 0x13, 0xb9, 0x94, 0xdd, 0xba, 0x9c, 0x44, 0x3f, 0x24, 0xcb, 0xfd, - 0x24, 0x60, 0x29, 0xef, 0x40, 0x9c, 0x3a, 0x11, 0x1b, 0xb8, 0x0b, 0x18, 0xb7, 0x45, 0x23, 0x3e, - 0x14, 0x11, 0xdf, 0x61, 0x03, 0xfa, 0x0d, 0xb2, 0xc8, 0x07, 0xdc, 0xef, 0xa7, 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, 0x9c, 0xbb, 0xef, 0xbe, 0x95, 0x0b, 0x73, 0xc0, 0x7f, - 0xc2, 0x39, 0xfd, 0x3a, 0x59, 0x48, 0x39, 0x8b, 0x3a, 0x8a, 0x6b, 0xae, 0x2e, 0xb8, 0xeb, 0x9a, - 0x4b, 0x0b, 0x32, 0xcf, 0x88, 0x00, 0x62, 0x8b, 0x8e, 0x09, 0xc4, 0x5d, 0xb4, 0xaa, 0x6c, 0x65, - 0x18, 0x87, 0x6f, 0x92, 0x25, 0x28, 0x26, 0x1d, 0x04, 0x25, 0x4c, 0x04, 0x6e, 0xb5, 0xe6, 0xac, - 0x95, 0xbc, 0x05, 0x90, 0xee, 0x88, 0x38, 0xdd, 0x67, 0x22, 0xa8, 0xff, 0xc2, 0x21, 0x0b, 0x47, - 0x9a, 0x2b, 0x88, 0x0b, 0xc6, 0x98, 0x92, 0x62, 0x5f, 0x73, 0x95, 0x95, 0x16, 0x18, 0xd3, 0xf7, - 0xc8, 0x7c, 0xc0, 0x92, 0xa4, 0x83, 0x35, 0xc7, 0x94, 0x97, 0x12, 0x08, 0x76, 0xa1, 0xee, 0x6c, - 0x92, 0x22, 0xa6, 0x57, 0xe1, 0xed, 0xd2, 0x0b, 0xc9, 0xf5, 0x3f, 0x15, 0xc8, 0x02, 0x98, 0xb0, - 0x97, 0x70, 0xc5, 0x52, 0x39, 0xb1, 0xa5, 0x33, 0xb1, 0x65, 0x95, 0x94, 0xa4, 0x05, 0x66, 0xe6, - 0x64, 0x73, 0x58, 0xcb, 0x2e, 0x0a, 0x9a, 0x54, 0xf2, 0xf2,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, 0xb7, 0xec, 0xfa, 0xef, 0x72, - 0x3b, 0xec, 0x69, 0x40, 0x75, 0x18, 0xdd, 0xda, 0x4c, 0xe0, 0x22, 0xdb, 0x87, 0x61, 0xf6, 0x20, - 0xb1, 0xd3, 0xf1, 0xfc, 0x2f, 0x4c, 0xe4, 0xff, 0xa7, 0xa4, 0xd4, 0x35, 0xfe, 0x65, 0xc7, 0x72, - 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, 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0xbc, 0x95, 0xaa, 0x9c, + 0x8f, 0x67, 0x2b, 0x22, 0x73, 0xe8, 0x45, 0x0f, 0xc7, 0xf5, 0x3f, 0x95, 0x48, 0x71, 0x8b, 0x25, + 0xc9, 0x8d, 0x61, 0x5d, 0x21, 0x33, 0x01, 0x8f, 0x65, 0x64, 0xcf, 0xc7, 0x4c, 0x68, 0x8d, 0x94, + 0x03, 0xae, 0x7d, 0x25, 0x92, 0x54, 0xc8, 0xd8, 0x46, 0x77, 0x54, 0x04, 0x07, 0xf3, 0x82, 0x77, + 0xb5, 0x48, 0xb3, 0x00, 0x67, 0x53, 0xd8, 0x25, 0x94, 0x3d, 0x99, 0x85, 0x17, 0xc6, 0x26, 0x51, + 0x7c, 0xc1, 0x42, 0x77, 0x36, 0x4b, 0x14, 0x98, 0x61, 0x14, 0xa4, 0xaf, 0xdd, 0x39, 0x83, 0x85, + 0x31, 0xfd, 0x3e, 0x29, 0xfb, 0xc3, 0x7b, 0xe1, 0x96, 0x30, 0x97, 0xdd, 0xb1, 0x5c, 0x1e, 0xb9, + 0x37, 0x36, 0x95, 0x47, 0x29, 0xb4, 0x41, 0x0a, 0x5d, 0x11, 0xbb, 0xf3, 0xb5, 0xc2, 0x5a, 0xf9, + 0xf1, 0xdd, 0x31, 0xe6, 0x30, 0xc9, 0x2d, 0x11, 0x90, 0xf4, 0x09, 0x29, 0x26, 0x52, 0x86, 0x2e, + 0xb9, 0xe1, 0xde, 0x8c, 0x66, 0xa5, 0xe5, 0x20, 0x98, 0x7e, 0x42, 0x4a, 0xc2, 0x26, 0x8b, 0x5b, + 0x46, 0xe2, 0xbb, 0x63, 0xc4, 0xf1, 0x4c, 0xb2, 0xd4, 0x9c, 0x42, 0xdf, 0x27, 0xcb, 0xfd, 0x24, + 0x60, 0x29, 0xef, 0x40, 0x90, 0x3a, 0x11, 0x1b, 0xb8, 0x0b, 0x18, 0xb4, 0x45, 0x23, 0x3e, 0x14, + 0x11, 0xdf, 0x61, 0x03, 0xfa, 0x75, 0xb2, 0xc8, 0x07, 0xdc, 0xef, 0xa7, 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, 0xd3, 0xb1, 0x61, 0xd3, 0xf1, 0xc1, + 0x1b, 0xa4, 0xe3, 0xa6, 0x14, 0xb1, 0x37, 0x8f, 0x2a, 0x36, 0x64, 0x1c, 0xc0, 0xa6, 0xbe, 0xe2, + 0x70, 0x19, 0x63, 0x74, 0xd4, 0xbd, 0x65, 0x36, 0xcd, 0x84, 0xe0, 0x26, 0x6d, 0x90, 0x59, 0x9d, + 0xb2, 0xb4, 0xaf, 0x5d, 0x5a, 0x73, 0xd6, 0x96, 0x26, 0x62, 0x06, 0xb9, 0x7b, 0x80, 0xcb, 0x9e, + 0x85, 0xd1, 0x3d, 0x52, 0xbe, 0x90, 0x29, 0xef, 0x9c, 0xf7, 0xa5, 0xea, 0x47, 0xee, 0xed, 0xb7, + 0xaa, 0x11, 0x04, 0x54, 0xfc, 0x10, 0x35, 0xd0, 0xfb, 0x56, 0x61, 0xc2, 0x95, 0x90, 0x81, 0xbb, + 0x82, 0x46, 0x22, 0x60, 0x1f, 0x25, 0xf4, 0x3d, 0xb2, 0x84, 0x00, 0x1e, 0x33, 0x3f, 0x8d, 0x78, + 0x9c, 0xba, 0xef, 0x98, 0x68, 0x81, 0xb4, 0x95, 0x09, 0xe9, 0x07, 0xe4, 0x56, 0x28, 0xce, 0xfb, + 0x22, 0x30, 0x1e, 0xeb, 0x94, 0xa9, 0xd4, 0xbd, 0x83, 0xc8, 0xca, 0xc8, 0xc2, 0x01, 0xc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0xa1, 0x61, 0x7a, + 0x9c, 0x67, 0x46, 0x11, 0x33, 0xa3, 0x3a, 0x96, 0x19, 0x76, 0xd3, 0x89, 0xc4, 0x70, 0xc9, 0x5c, + 0x8f, 0xa5, 0xfc, 0x05, 0xbb, 0xb4, 0x69, 0x96, 0x4d, 0xe9, 0xf7, 0x48, 0x45, 0xc6, 0xfe, 0x29, + 0x13, 0x71, 0x27, 0xe2, 0x5a, 0xb3, 0x1e, 0x87, 0x8c, 0x83, 0x8f, 0xde, 0xca, 0xba, 0x69, 0x61, + 0xd7, 0xb3, 0x16, 0x76, 0xbd, 0x19, 0x5f, 0x7a, 0xcb, 0x16, 0xbd, 0x63, 0xc1, 0x75, 0x49, 0x6e, + 0x8f, 0x38, 0xdb, 0x4c, 0x12, 0x25, 0x2f, 0x58, 0xf8, 0xda, 0x8b, 0xc4, 0x10, 0x98, 0x9f, 0x7b, + 0x3e, 0x07, 0xff, 0x85, 0xee, 0xd8, 0x69, 0x60, 0xef, 0x12, 0x11, 0xba, 0x69, 0x25, 0xf5, 0xbf, + 0x3b, 0x84, 0xb6, 0xf0, 0x6a, 0x09, 0x19, 0x7b, 0xbc, 0x27, 0x74, 0xaa, 0xd8, 0x6b, 0x6e, 0xee, + 0x47, 0x58, 0xb7, 0x2e, 0xb2, 0xfc, 0xb4, 0xcd, 0xad, 0xfb, 0xdf, 0x9f, 0x08, 0xb3, 0x8e, 0x15, + 0xed, 0x22, 0x8b, 0xdf, 0x47, 0x64, 0xc1, 0xef, 0x2b, 0x95, 0x93, 0x0b, 0xaf, 0x23, 0x03, 0x7a, + 0x84, 0x1c, 0xf3, 0x41, 0x9a, 0x93, 0x8b, 0xaf, 0x23, 0x03, 0xda, 0x4e, 0xea, 0x31, 0x79, 0x67, + 0x43, 0x89, 0xa0, 0xc7, 0x73, 0x37, 0xb7, 0x79, 0x98, 0x98, 0xca, 0x88, 0x5a, 0xf3, 0x92, 0x59, + 0xf4, 0x4a, 0x20, 0x80, 0x92, 0x4a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b9, 0x29, 0x10, + 0xf6, 0x08, 0xb2, 0x40, 0x64, 0x8c, 0xfa, 0x77, 0x49, 0x79, 0xe4, 0xb4, 0xff, 0x87, 0x65, 0x37, + 0x3e, 0x02, 0xea, 0xff, 0x74, 0x08, 0x39, 0x6e, 0xee, 0x78, 0xfc, 0xbc, 0xcf, 0x75, 0x4a, 0x3f, + 0x24, 0x73, 0xc6, 0x61, 0xf3, 0xc4, 0x7d, 0x13, 0x33, 0x32, 0x02, 0x16, 0x46, 0x7c, 0x1a, 0x76, + 0xc0, 0x2d, 0x9b, 0xd9, 0xc4, 0x88, 0xf0, 0x69, 0xf2, 0x1e, 0x59, 0xb2, 0x00, 0x9b, 0x42, 0x36, + 0xc1, 0x17, 0x8d, 0x34, 0x3b, 0x58, 0x38, 0x28, 0xae, 0x53, 0xa3, 0xc5, 0xbc, 0x71, 0x4a, 0x20, + 0x40, 0x1d, 0x0f, 0x49, 0x05, 0x17, 0xbb, 0x3c, 0xe6, 0x27, 0xc2, 0x17, 0x4c, 0x99, 0x8a, 0x59, + 0xf4, 0x96, 0x41, 0xbe, 0x31, 0x14, 0xd3, 0x0a, 0x29, 0xc0, 0x0d, 0x33, 0x8f, 0x11, 0x18, 0xe2, + 0x73, 0x1c, 0x9d, 0xd5, 0x89, 0x8c, 0x35, 0x47, 0x84, 0x08, 0xec, 0x31, 0xc1, 0x10, 0x24, 0x42, + 0xf9, 0xd6, 0x76, 0x18, 0x82, 0x44, 0x2b, 0xdf, 0x5a, 0x0a, 0x43, 0x90, 0x04, 0xca, 0xb7, 0x96, + 0xc1, 0xd0, 0xb0, 0x22, 0x6b, 0x07, 0x0c, 0x0d, 0xcb, 0xec, 0x8d, 0xac, 0xc8, 0xb0, 0x22, 0xfc, + 0xf2, 0x23, 0x2b, 0xaa, 0xff, 0xcc, 0x21, 0x85, 0xe3, 0xe6, 0x0e, 0x94, 0x03, 0xc5, 0xcf, 0x4d, + 0xbf, 0x66, 0x4c, 0x99, 0x53, 0xfc, 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c, + 0xf6, 0x72, 0xd5, 0xf9, 0xfc, 0xe5, 0xaa, 0xf3, 0xb7, 0x97, 0xab, 0xce, 0x6f, 0x5e, 0xad, 0x4e, + 0x7d, 0xfe, 0x6a, 0x75, 0xea, 0x2f, 0xaf, 0x56, 0xa7, 0x7e, 0xbc, 0x36, 0x52, 0xd1, 0x7f, 0x20, + 0x14, 0xdb, 0x94, 0x8a, 0x37, 0x34, 0x3f, 0x63, 0xa2, 0x31, 0xc8, 0xfe, 0x3f, 0xc4, 0xba, 0xde, + 0x9d, 0xc5, 0x86, 0xe9, 0xc9, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x32, 0xd7, 0x5f, 0xce, 0x5b, + 0x14, 0x00, 0x00, } func (this *AccountRange) Equal(that interface{}) bool { @@ -1927,14 +1927,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 +2014,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 { @@ -2773,7 +2773,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 +2783,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 @@ -2968,7 +2968,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 +3953,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 +4017,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)) @@ -5041,7 +5041,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 +5064,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 +5565,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 +5592,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 From dd1aa753c56cfc251dc089d1cd0e4de31375d795 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 28 May 2024 01:13:55 +0800 Subject: [PATCH 03/14] add genesis version verifier in validateGenesis --- x/upgrade/module.go | 9 +++++++++ x/upgrade/types/errors.go | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 5f223353..80b758fd 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 } diff --git a/x/upgrade/types/errors.go b/x/upgrade/types/errors.go index b8c7c3e0..881cad9f 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") ) From fe445d6ee05388a2740cd15d38410e1c6258f418 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 28 May 2024 01:29:56 +0800 Subject: [PATCH 04/14] add genesis verification in init genesis --- x/upgrade/module.go | 4 ++++ x/upgrade/types/genesis.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 80b758fd..45c0b872 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -99,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/genesis.go b/x/upgrade/types/genesis.go index 48181e44..373c354d 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, } From 42f2c3f552b53d0aef069e45023e7cdd7c0e771d Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 28 May 2024 23:31:36 +0800 Subject: [PATCH 05/14] refactor token alias and rate into token info --- app/ante/ante.go | 2 +- app/ante/ante_test.go | 6 +- app/app.go | 3 +- proto/kira/gov/permission.proto | 15 +- proto/kira/tokens/alias.proto | 28 - proto/kira/tokens/genesis.proto | 8 +- proto/kira/tokens/proposal.proto | 20 +- proto/kira/tokens/query.proto | 67 +- proto/kira/tokens/rate.proto | 54 - proto/kira/tokens/token.proto | 31 + proto/kira/tokens/tx.proto | 45 +- .../foreign-fee-payments-failure-return.sh | 4 +- scripts/commands/foreign-fee-payments.sh | 4 +- .../governance/poor-network-messages.sh | 2 +- scripts/commands/upsert-token-alias.sh | 4 +- scripts/commands/upsert-token-rates.sh | 4 +- scripts/sekai-env.sh | 21 +- scripts/sekai-utils.sh | 10 +- scripts/sekaidtestsetup.sh | 2 +- scripts/test-local/account-permissions.sh | 9 +- types/Msg.go | 8 +- types/Proposal.go | 6 +- x/basket/keeper/hooks.go | 6 +- x/collectives/keeper/collective.go | 2 +- x/collectives/keeper/collective_test.go | 2 +- x/collectives/types/expected_keepers.go | 2 +- x/feeprocessing/keeper/keeper.go | 4 +- x/feeprocessing/keeper/keeper_test.go | 45 +- x/feeprocessing/types/expected_keepers.go | 2 +- x/genutil/client/cli/init.go | 16 +- x/gov/abci_test.go | 59 +- x/gov/client/cli/util_test.go | 2 +- x/gov/genesis_test.go | 14 +- x/gov/handler_test.go | 41 - x/gov/keeper/grpc_query.go | 6 +- x/gov/types/genesis.go | 16 +- x/gov/types/permission.go | 24 +- x/gov/types/permission.pb.go | 6 +- x/multistaking/keeper/delegation.go | 14 +- x/multistaking/types/expected_keepers.go | 2 +- x/spending/types/events.go | 2 - x/staking/client/cli/tx.go | 2 +- x/tokens/client/cli/cli_test.go | 129 +- x/tokens/client/cli/query.go | 117 +- x/tokens/client/cli/tx.go | 244 +-- x/tokens/handler.go | 8 +- x/tokens/handler_test.go | 257 +-- x/tokens/keeper/alias.go | 106 - x/tokens/keeper/alias_test.go | 46 - x/tokens/keeper/grpc_query.go | 43 +- x/tokens/keeper/grpc_query_test.go | 74 +- x/tokens/keeper/keeper.go | 4 +- x/tokens/keeper/msg_server.go | 50 +- x/tokens/keeper/{rate.go => token_info.go} | 48 +- .../{rate_test.go => token_info_test.go} | 26 +- x/tokens/module.go | 11 +- x/tokens/proposal_handler.go | 42 +- x/tokens/types/alias.pb.go | 1016 --------- x/tokens/types/codec.go | 45 +- x/tokens/types/errors.go | 3 +- x/tokens/types/events.go | 3 +- x/tokens/types/genesis.go | 13 +- x/tokens/types/genesis.pb.go | 114 +- x/tokens/types/msg_alias.go | 59 - .../types/{msg_rate.go => msg_token_info.go} | 30 +- x/tokens/types/proposal.go | 66 +- x/tokens/types/proposal.pb.go | 591 ++---- x/tokens/types/query.pb.go | 1824 +++-------------- x/tokens/types/query.pb.gw.go | 222 +- x/tokens/types/rate.pb.go | 1084 ---------- x/tokens/types/token.pb.go | 783 +++++++ x/tokens/types/tx.pb.go | 777 +++++-- x/tokens/types/types.go | 35 +- 73 files changed, 2551 insertions(+), 5939 deletions(-) delete mode 100644 proto/kira/tokens/alias.proto delete mode 100644 proto/kira/tokens/rate.proto create mode 100644 proto/kira/tokens/token.proto delete mode 100644 x/tokens/keeper/alias.go delete mode 100644 x/tokens/keeper/alias_test.go rename x/tokens/keeper/{rate.go => token_info.go} (54%) rename x/tokens/keeper/{rate_test.go => token_info_test.go} (53%) delete mode 100644 x/tokens/types/alias.pb.go delete mode 100644 x/tokens/types/msg_alias.go rename x/tokens/types/{msg_rate.go => msg_token_info.go} (66%) delete mode 100644 x/tokens/types/rate.pb.go create mode 100644 x/tokens/types/token.pb.go diff --git a/app/ante/ante.go b/app/ante/ante.go index 0daf6ef5..39671fc7 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -329,7 +329,7 @@ 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")) } diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index 22617898..ce5f14a4 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -555,7 +555,7 @@ 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(), "foo", sdk.NewDec(1), @@ -564,6 +564,10 @@ func (suite *AnteTestSuite) TestPoorNetworkManagementDecorator() { sdk.ZeroInt(), false, false, + "FOO", + "Foo", + "", + 6, ), } 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 e89aea94..20614294 100644 --- a/app/app.go +++ b/app/app.go @@ -370,8 +370,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 1193f787..15727b22 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/tokens/alias.proto b/proto/kira/tokens/alias.proto deleted file mode 100644 index be0b4cdb..00000000 --- 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 785d97e6..2f039270 100644 --- a/proto/kira/tokens/genesis.proto +++ b/proto/kira/tokens/genesis.proto @@ -1,14 +1,12 @@ 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"; 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; + TokensWhiteBlack tokenBlackWhites = 2; } diff --git a/proto/kira/tokens/proposal.proto b/proto/kira/tokens/proposal.proto index fc660880..3eb948cd 100644 --- a/proto/kira/tokens/proposal.proto +++ b/proto/kira/tokens/proposal.proto @@ -6,26 +6,12 @@ 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\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // Exchange rate in terms of KEX token @@ -42,4 +28,8 @@ message ProposalUpsertTokenRates { ]; bool stake_token = 6; bool invalidated = 7; + string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) + string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 10; // Graphical Symbol (url link to graphics) + uint32 decimals = 11; // Integer number of max decimals } diff --git a/proto/kira/tokens/query.proto b/proto/kira/tokens/query.proto index 1710bf03..c5759cc8 100644 --- a/proto/kira/tokens/query.proto +++ b/proto/kira/tokens/query.proto @@ -1,8 +1,7 @@ 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"; @@ -11,66 +10,42 @@ 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; } -message AllTokenRatesRequest {} +message AllTokenInfosRequest {} -message AllTokenRatesResponse { - repeated kira.tokens.TokenRate data = 1; +message AllTokenInfosResponse { + repeated kira.tokens.TokenInfo data = 1; } -message TokenRatesByDenomRequest { +message TokenInfosByDenomRequest { repeated string denoms = 1; } -message TokenRatesByDenomResponse { - map data = 1; +message TokenInfosByDenomResponse { + map data = 1; } message TokenBlackWhitesRequest {} diff --git a/proto/kira/tokens/rate.proto b/proto/kira/tokens/rate.proto deleted file mode 100644 index 6095e616..00000000 --- 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 00000000..f9b3e386 --- /dev/null +++ b/proto/kira/tokens/token.proto @@ -0,0 +1,31 @@ +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 fee_rate = 2 [ + (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 + string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) + string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 10; // Graphical Symbol (url link to graphics) + uint32 decimals = 11; // Integer number of max decimals +} diff --git a/proto/kira/tokens/tx.proto b/proto/kira/tokens/tx.proto index ff2509d2..c3e5bb0f 100644 --- a/proto/kira/tokens/tx.proto +++ b/proto/kira/tokens/tx.proto @@ -3,25 +3,50 @@ 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 rate = 2 [ + (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 + string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) + string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 10; // Graphical Symbol (url link to graphics) + uint32 decimals = 11; // Integer number of max decimals + bytes proposer = 12 [ + (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 738f0fc5..a9e4fcf2 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 2da22c20..5930f9c1 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 4aa90d75..ff46c394 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/upsert-token-alias.sh b/scripts/commands/upsert-token-alias.sh index b75e8824..da4e6957 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 ad74e143..65c21c09 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 e457a8a9..0dfd5991 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 73870b88..899f5e88 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/sekaidtestsetup.sh b/scripts/sekaidtestsetup.sh index 1af683e5..600ad113 100755 --- a/scripts/sekaidtestsetup.sh +++ b/scripts/sekaidtestsetup.sh @@ -12,4 +12,4 @@ sekaid gentx-claim validator --keyring-backend=test --moniker="hello" --home=$HO cat $HOME/.sekaid/config/genesis.json | jq '.app_state["customgov"]["network_properties"]["minimum_proposal_end_time"]="30"' > $HOME/.sekaid/config/tmp_genesis.json && mv $HOME/.sekaid/config/tmp_genesis.json $HOME/.sekaid/config/genesis.json cat $HOME/.sekaid/config/genesis.json | jq '.app_state["customgov"]["network_properties"]["proposal_enactment_time"]="10"' > $HOME/.sekaid/config/tmp_genesis.json && mv $HOME/.sekaid/config/tmp_genesis.json $HOME/.sekaid/config/genesis.json -sekaid start --home=$HOME/.sekaid +# sekaid start --home=$HOME/.sekaid diff --git a/scripts/test-local/account-permissions.sh b/scripts/test-local/account-permissions.sh index abc103f0..85b4bd22 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 a629adea..0f29239d 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 0465bece..10eb5cd5 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/x/basket/keeper/hooks.go b/x/basket/keeper/hooks.go index d5cc09b0..8e803ef8 100644 --- a/x/basket/keeper/hooks.go +++ b/x/basket/keeper/hooks.go @@ -9,7 +9,7 @@ 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 { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) @@ -58,7 +58,7 @@ 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 { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) @@ -81,7 +81,7 @@ 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 { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) diff --git a/x/collectives/keeper/collective.go b/x/collectives/keeper/collective.go index 9af1470d..f8f447e9 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 2447e4f3..c70ba1f9 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 ba68ab1f..630b65e3 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/feeprocessing/keeper/keeper.go b/x/feeprocessing/keeper/keeper.go index d89bc626..ea6b64e5 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 7fcddd65..02e92992 100644 --- a/x/feeprocessing/keeper/keeper_test.go +++ b/x/feeprocessing/keeper/keeper_test.go @@ -43,32 +43,35 @@ func TestNewKeeper_Executions(t *testing.T) { executions := app.FeeProcessingKeeper.GetExecutionsStatus(ctx) require.True(t, len(executions) == 0) - msg1 := tokenstypes.NewMsgUpsertTokenRate( + msg1 := tokenstypes.NewMsgUpsertTokenInfo( addr, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) 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( + msg3 := tokenstypes.NewMsgUpsertTokenInfo( addr, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) 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 +82,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 +167,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 +177,16 @@ 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( + msg := tokenstypes.NewMsgUpsertTokenInfo( addr, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg) app.FeeProcessingKeeper.ProcessExecutionFeeReturn(ctx) @@ -206,19 +213,27 @@ 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( + msg2 := tokenstypes.NewMsgUpsertTokenInfo( addr2, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) - msg3 := tokenstypes.NewMsgUpsertTokenRate( + msg3 := tokenstypes.NewMsgUpsertTokenInfo( addr3, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) 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 ccedb6e9..ec29b138 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 33cf8037..0823d5c9 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -131,17 +131,7 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { } tokenGenState := tokenstypes.GetGenesisStateFromAppState(clientCtx.Codec, genesis) - tokenGenState.Aliases = []*tokenstypes.TokenAlias{ - { - Symbol: defaultDenom, - Name: defaultDenom, - Icon: "", - Decimals: 6, - Denoms: []string{defaultDenom}, - Invalidated: false, - }, - } - tokenGenState.Rates = []*tokenstypes.TokenRate{ + tokenGenState.TokenInfos = []*tokenstypes.TokenInfo{ { Denom: defaultDenom, FeeRate: sdk.OneDec(), @@ -150,6 +140,10 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { StakeMin: sdk.OneInt(), StakeToken: true, Invalidated: 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 4ac2091c..c35cd02a 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -440,57 +440,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,7 +453,7 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { proposalID, "title", "some desc", - tokenstypes.NewUpsertTokenRatesProposal( + tokenstypes.NewUpsertTokenInfosProposal( "btc", sdk.NewDec(1234), false, @@ -512,6 +461,10 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { sdk.ZeroInt(), false, false, + "BTC", + "Bitcoin", + "", + 9, ), time.Now(), time.Now().Add(10*time.Second), @@ -535,7 +488,7 @@ 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) diff --git a/x/gov/client/cli/util_test.go b/x/gov/client/cli/util_test.go index e32bbbf6..0092608e 100644 --- a/x/gov/client/cli/util_test.go +++ b/x/gov/client/cli/util_test.go @@ -208,7 +208,7 @@ func (s IntegrationTestSuite) SetNetworkPropertyProposal(property string, value func (s IntegrationTestSuite) UpsertRate(denom string, rate string, flagFeePayments 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), diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 24ca4785..d3819b6a 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 07260a93..1d39bb8d 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 0b92d491..c23d5db0 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 36e87ed1..fce155cb 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 054da240..1bc36809 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 2659611e..d1c6d8f4 100644 --- a/x/gov/types/permission.pb.go +++ b/x/gov/types/permission.pb.go @@ -42,7 +42,7 @@ const ( // 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. @@ -63,9 +63,9 @@ const ( // 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. diff --git a/x/multistaking/keeper/delegation.go b/x/multistaking/keeper/delegation.go index cdeb0237..a9883ac7 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,7 +216,7 @@ 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) + rate := k.tokenKeeper.GetTokenInfo(ctx, reward.Denom) if rate.StakeToken && reward.Amount.GTE(rate.StakeMin) && isWithinArray(reward.Denom, compoundInfo.CompoundDenoms) { autoCompoundRewards = autoCompoundRewards.Add(reward) } @@ -320,7 +320,7 @@ func (k Keeper) Delegate(ctx sdk.Context, msg *types.MsgDelegate) error { } for _, amount := range msg.Amounts { - rate := k.tokenKeeper.GetTokenRate(ctx, amount.Denom) + rate := k.tokenKeeper.GetTokenInfo(ctx, amount.Denom) if !rate.StakeToken { return types.ErrNotAllowedStakingToken } @@ -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 752358b6..f7bc5ab7 100644 --- a/x/multistaking/types/expected_keepers.go +++ b/x/multistaking/types/expected_keepers.go @@ -34,5 +34,5 @@ type BankKeeper 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/spending/types/events.go b/x/spending/types/events.go index 8815e01a..c6472587 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 9f2f8a7b..2e10f221 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 bd127c7c..feafbcf3 100644 --- a/x/tokens/client/cli/cli_test.go +++ b/x/tokens/client/cli/cli_test.go @@ -66,53 +66,13 @@ 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.FlagDenom, "ubtc"), @@ -130,7 +90,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,12 +111,12 @@ 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), @@ -185,43 +145,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 +182,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 fd8abf42..5637d6d9 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 dd0787e0..05cf6da0 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" @@ -46,187 +45,16 @@ 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 { - cmd := &cobra.Command{ - Use: "upsert-alias", - Short: "Upsert token alias", - 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") - } - - 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") - } - - denomsString, err := cmd.Flags().GetString(FlagDenoms) - 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 - } - } - - 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() - 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) - if err != nil { - return fmt.Errorf("invalid symbol: %w", err) - } - - name, err := cmd.Flags().GetString(FlagName) - if err != nil { - return fmt.Errorf("invalid name: %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) - } - - denoms, err := cmd.Flags().GetString(FlagDenoms) - if err != nil { - return fmt.Errorf("invalid denoms: %w", err) - } - - isInvalidated, err := cmd.Flags().GetBool(FlagInvalidated) - if err != nil { - return fmt.Errorf("invalid invalidated flag: %w", err) - } - - title, err := cmd.Flags().GetString(FlagTitle) - if err != nil { - return fmt.Errorf("invalid title: %w", err) - } - - description, err := cmd.Flags().GetString(FlagDescription) - if err != nil { - 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, - ), - ) - if err != nil { - return 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 { +// GetTxProposalUpsertTokenInfoCmd implement cli command for MsgUpsertTokenInfos +func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { cmd := &cobra.Command{ Use: "proposal-upsert-rate", Short: "Create a proposal to upsert token rate", @@ -296,11 +124,31 @@ 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, @@ -308,6 +156,10 @@ func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { stakeMin, stakeToken, isInvalidated, + symbol, + name, + icon, + decimals, ), ) if err != nil { @@ -337,6 +189,10 @@ 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") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) @@ -344,8 +200,8 @@ 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", @@ -405,7 +261,27 @@ 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") + } + + msg := types.NewMsgUpsertTokenInfo( clientCtx.FromAddress, denom, rate, @@ -414,6 +290,10 @@ func GetTxUpsertTokenRateCmd() *cobra.Command { stakeMin, stakeToken, isInvalidated, + symbol, + name, + icon, + decimals, ) err = msg.ValidateBasic() @@ -435,6 +315,10 @@ func GetTxUpsertTokenRateCmd() *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") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) diff --git a/x/tokens/handler.go b/x/tokens/handler.go index d3e6c20a..779e72f1 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 b1e294c5..0fd4c89c 100644 --- a/x/tokens/handler_test.go +++ b/x/tokens/handler_test.go @@ -4,7 +4,6 @@ import ( "bytes" "os" "strconv" - "strings" "testing" "time" @@ -51,78 +50,7 @@ func setPermissionToAddr(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context, ad return nil } -func TestNewHandler_MsgUpsertTokenAlias(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) - handlerErr string - }{ - { - name: "good permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenAlias, error) { - err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenAlias) - 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) { +func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) @@ -130,15 +58,15 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { tests := []struct { name string - constructor func(sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) + constructor func(sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) handlerErr string }{ { name: "good permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) { - err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenRate) + constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenInfo) require.NoError(t, err) - return tokenstypes.NewMsgUpsertTokenRate( + return tokenstypes.NewMsgUpsertTokenInfo( addr, "finney", sdk.NewDecWithPrec(1, 3), // 0.001 true, @@ -146,13 +74,17 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, ), 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, "finney", sdk.NewDecWithPrec(1, 3), // 0.001 true, @@ -160,14 +92,18 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, ), 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, "finney", sdk.NewDec(-1), // -1 true, @@ -175,16 +111,20 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, ), 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) + constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenInfo) require.NoError(t, err) - return tokenstypes.NewMsgUpsertTokenRate( + return tokenstypes.NewMsgUpsertTokenInfo( addr, "ukex", sdk.NewDec(10), true, @@ -192,6 +132,10 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, ), nil }, handlerErr: "bond denom rate is read-only", @@ -210,139 +154,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}) + ratesByDenom := app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{theMsg.Denom}) require.True(t, ratesByDenom[theMsg.Denom] != 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,7 +176,7 @@ func TestHandler_CreateProposalUpsertTokenRates_Errors(t *testing.T) { }{ { "Proposer does not have Perm", - tokenstypes.NewUpsertTokenRatesProposal( + tokenstypes.NewUpsertTokenInfosProposal( "btc", sdk.NewDec(1234), false, @@ -362,9 +184,10 @@ func TestHandler_CreateProposalUpsertTokenRates_Errors(t *testing.T) { sdk.ZeroInt(), false, false, + "BTC", "Bitcoin", "", 9, ), 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 +208,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 +219,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,7 +227,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { app.CustomGovKeeper.SetNetworkProperties(ctx, properties) handler := gov.NewHandler(app.CustomGovKeeper) - proposal := tokenstypes.NewUpsertTokenRatesProposal( + proposal := tokenstypes.NewUpsertTokenInfosProposal( "btc", sdk.NewDec(1234), false, @@ -412,6 +235,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { sdk.ZeroInt(), false, false, + "BTC", "Bitcoin", "", 9, ) msg, err := govtypes.NewMsgSubmitProposal(proposerAddr, "title", "some desc", proposal) require.NoError(t, err) @@ -430,7 +254,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { 1, "title", "some desc", - tokenstypes.NewUpsertTokenRatesProposal( + tokenstypes.NewUpsertTokenInfosProposal( "btc", sdk.NewDec(1234), false, @@ -438,6 +262,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { sdk.ZeroInt(), false, false, + "BTC", "Bitcoin", "", 9, ), 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 064c981d..00000000 --- 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 f9816181..00000000 --- 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/grpc_query.go b/x/tokens/keeper/grpc_query.go index 52090699..96c73aba 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,23 @@ 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, - }, nil -} - -func (q Querier) GetTokenRate(ctx context.Context, request *types.TokenRateRequest) (*types.TokenRateResponse, error) { - rate := q.keeper.GetTokenRate(sdk.UnwrapSDKContext(ctx), request.Denom) +func (q Querier) GetTokenInfo(ctx context.Context, request *types.TokenInfoRequest) (*types.TokenInfoResponse, error) { + rate := q.keeper.GetTokenInfo(sdk.UnwrapSDKContext(ctx), request.Denom) if rate == nil { - return &types.TokenRateResponse{Data: nil}, nil + return &types.TokenInfoResponse{Data: nil}, nil } - return &types.TokenRateResponse{Data: rate}, nil + return &types.TokenInfoResponse{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) { + rates := q.keeper.GetTokenInfosByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) + return &types.TokenInfosByDenomResponse{Data: rates}, 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(ctx context.Context, request *types.AllTokenInfosRequest) (*types.AllTokenInfosResponse, error) { + rates := q.keeper.GetAllTokenInfos(sdk.UnwrapSDKContext(ctx)) + return &types.AllTokenInfosResponse{Data: rates}, 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 63d7fa2f..3719de29 100644 --- a/x/tokens/keeper/grpc_query_test.go +++ b/x/tokens/keeper/grpc_query_test.go @@ -11,71 +11,15 @@ 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) @@ -83,15 +27,15 @@ func TestQuerier_GetTokenRate(t *testing.T) { require.Equal(t, true, resp.Data.FeePayments) } -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) @@ -100,15 +44,15 @@ func TestQuerier_GetTokenRatesByDenom(t *testing.T) { require.Equal(t, true, resp.Data["ukex"].FeePayments) } -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) diff --git a/x/tokens/keeper/keeper.go b/x/tokens/keeper/keeper.go index 986e1a89..f95bf99e 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/msg_server.go b/x/tokens/keeper/msg_server.go index 128a8fb1..48a85728 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,12 +37,12 @@ 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) + 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, @@ -84,6 +50,10 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo msg.StakeMin, msg.StakeToken, msg.Invalidated, + msg.Symbol, + msg.Name, + msg.Icon, + msg.Decimals, )) if err != nil { @@ -91,7 +61,7 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo } 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()), @@ -99,7 +69,7 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo ), ) - 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/token_info.go similarity index 54% rename from x/tokens/keeper/rate.go rename to x/tokens/keeper/token_info.go index a29fd83b..cfb6d432 100644 --- a/x/tokens/keeper/rate.go +++ b/x/tokens/keeper/token_info.go @@ -11,32 +11,32 @@ import ( "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) +// GetTokenInfo returns a token rate +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 } - rate := new(types.TokenRate) + rate := new(types.TokenInfo) 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 +// GetAllTokenInfos returns all list of token rate +func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []*types.TokenInfo { + var tokenRates []*types.TokenInfo // get iterator for token rates store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenRate) + iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenInfo) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - denom := strings.TrimPrefix(string(iterator.Key()), string(PrefixKeyTokenRate)) - tokenRate := k.GetTokenRate(ctx, denom) + denom := strings.TrimPrefix(string(iterator.Key()), string(PrefixKeyTokenInfo)) + tokenRate := k.GetTokenInfo(ctx, denom) if tokenRate != nil { tokenRates = append(tokenRates, tokenRate) } @@ -44,28 +44,28 @@ func (k Keeper) GetAllTokenRates(ctx sdk.Context) []*types.TokenRate { return tokenRates } -// GetTokenRatesByDenom returns all list of token rate -func (k Keeper) GetTokenRatesByDenom(ctx sdk.Context, denoms []string) map[string]*types.TokenRate { +// GetTokenInfosByDenom returns all list of token rate +func (k Keeper) GetTokenInfosByDenom(ctx sdk.Context, denoms []string) map[string]*types.TokenInfo { // get iterator for token aliases store := ctx.KVStore(k.storeKey) - tokenRatesMap := make(map[string]*types.TokenRate) + tokenRatesMap := make(map[string]*types.TokenInfo) for _, denom := range denoms { - denomTokenStoreID := append([]byte(PrefixKeyTokenRate), []byte(denom)...) + denomTokenStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) if store.Has(denomTokenStoreID) { - tokenRate := k.GetTokenRate(ctx, denom) + tokenRate := k.GetTokenInfo(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 { +// UpsertTokenInfo upsert a token rate to the registry +func (k Keeper) UpsertTokenInfo(ctx sdk.Context, rate types.TokenInfo) error { store := ctx.KVStore(k.storeKey) - // we use denom of TokenRate as an ID inside KVStore storage - tokenRateStoreID := append([]byte(PrefixKeyTokenRate), []byte(rate.Denom)...) + // we use denom of TokenInfo as an ID inside KVStore storage + tokenRateStoreID := append([]byte(PrefixKeyTokenInfo), []byte(rate.Denom)...) if rate.Denom == k.DefaultDenom(ctx) && store.Has(tokenRateStoreID) { return errors.New("bond denom rate is read-only") } @@ -73,7 +73,7 @@ func (k Keeper) UpsertTokenRate(ctx sdk.Context, rate types.TokenRate) error { store.Set(tokenRateStoreID, k.cdc.MustMarshal(&rate)) totalRewardsCap := sdk.ZeroDec() - rates := k.GetAllTokenRates(ctx) + rates := k.GetAllTokenInfos(ctx) for _, rate := range rates { totalRewardsCap = totalRewardsCap.Add(rate.StakeCap) } @@ -83,11 +83,11 @@ func (k Keeper) UpsertTokenRate(ctx sdk.Context, rate types.TokenRate) error { return nil } -// DeleteTokenRate delete token denom by denom -func (k Keeper) DeleteTokenRate(ctx sdk.Context, denom string) error { +// 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 DeleteTokenRate as an ID inside KVStore storage - tokenRateStoreID := append([]byte(PrefixKeyTokenRate), []byte(denom)...) + // we use symbol of DeleteTokenInfo as an ID inside KVStore storage + tokenRateStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) if !store.Has(tokenRateStoreID) { return fmt.Errorf("no rate registry is available for %s denom", denom) diff --git a/x/tokens/keeper/rate_test.go b/x/tokens/keeper/token_info_test.go similarity index 53% rename from x/tokens/keeper/rate_test.go rename to x/tokens/keeper/token_info_test.go index e6bf5ba9..a95b0bf1 100644 --- a/x/tokens/keeper/rate_test.go +++ b/x/tokens/keeper/token_info_test.go @@ -5,41 +5,41 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func (suite *KeeperTestSuite) TestTokenRates() { +func (suite *KeeperTestSuite) TestTokenInfos() { suite.SetupTest() ctx := suite.ctx // check initial token rate before registration - rate := suite.app.TokensKeeper.GetTokenRate(ctx, "stake") + rate := suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") suite.Require().Nil(rate) - rates := suite.app.TokensKeeper.GetAllTokenRates(ctx) + rates := suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 4) - rateMap := suite.app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{"stake"}) + rateMap := suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) suite.Require().Equal(len(rateMap), 0) suite.Require().Nil(rateMap["stake"]) // upsert token rate and check - newRate := types.TokenRate{ + newRate := types.TokenInfo{ Denom: "stake", FeeRate: sdk.NewDec(2), FeePayments: true, } - suite.app.TokensKeeper.UpsertTokenRate(ctx, newRate) - rate = suite.app.TokensKeeper.GetTokenRate(ctx, "stake") + suite.app.TokensKeeper.UpsertTokenInfo(ctx, newRate) + rate = suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") suite.Require().NotNil(rate) - rates = suite.app.TokensKeeper.GetAllTokenRates(ctx) + rates = suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 5) - rateMap = suite.app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{"stake"}) + 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.DeleteTokenRate(ctx, "stake") - rate = suite.app.TokensKeeper.GetTokenRate(ctx, "stake") + suite.app.TokensKeeper.DeleteTokenInfo(ctx, "stake") + rate = suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") suite.Require().Nil(rate) - rates = suite.app.TokensKeeper.GetAllTokenRates(ctx) + rates = suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 4) - rateMap = suite.app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{"stake"}) + rateMap = suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) suite.Require().Equal(len(rateMap), 0) suite.Require().Nil(rateMap["stake"]) } diff --git a/x/tokens/module.go b/x/tokens/module.go index 0359822e..9d3d84af 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 820b0004..3a78550a 100644 --- a/x/tokens/proposal_handler.go +++ b/x/tokens/proposal_handler.go @@ -8,44 +8,26 @@ 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) -} - -type ApplyUpsertTokenRatesProposalHandler struct { - keeper keeper.Keeper -} - -func NewApplyUpsertTokenRatesProposalHandler(keeper keeper.Keeper) *ApplyUpsertTokenRatesProposalHandler { - return &ApplyUpsertTokenRatesProposalHandler{keeper: keeper} +func NewApplyUpsertTokenInfosProposalHandler(keeper keeper.Keeper) *ApplyUpsertTokenInfosProposalHandler { + return &ApplyUpsertTokenInfosProposalHandler{keeper: keeper} } -func (a ApplyUpsertTokenRatesProposalHandler) ProposalType() string { - return kiratypes.ProposalTypeUpsertTokenRates +func (a ApplyUpsertTokenInfosProposalHandler) ProposalType() string { + return kiratypes.ProposalTypeUpsertTokenInfos } -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) - rate := tokenstypes.NewTokenRate(p.Denom, p.Rate, p.FeePayments, p.StakeCap, p.StakeMin, p.StakeToken, p.Invalidated) - return a.keeper.UpsertTokenRate(ctx, *rate) + rate := tokenstypes.NewTokenInfo( + p.Denom, p.Rate, p.FeePayments, p.StakeCap, p.StakeMin, p.StakeToken, p.Invalidated, + p.Symbol, p.Name, p.Icon, p.Decimals, + ) + return a.keeper.UpsertTokenInfo(ctx, *rate) } type ApplyWhiteBlackChangeProposalHandler struct { diff --git a/x/tokens/types/alias.pb.go b/x/tokens/types/alias.pb.go deleted file mode 100644 index 61653c40..00000000 --- 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, 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0x0f, 0xb6, 0x4d, 0xf0, 0xbd, 0x1c, - 0x8d, 0x53, 0x55, 0x3d, 0x3c, 0xce, 0xa2, 0x04, 0x34, 0x4b, 0x00, 0x35, 0xe0, 0xe6, 0x18, 0xa3, - 0xc8, 0x58, 0x35, 0x2f, 0x25, 0x46, 0x93, 0x24, 0x99, 0x08, 0x61, 0x24, 0x62, 0xbc, 0xa3, 0x4e, - 0xa7, 0xef, 0x2b, 0x8f, 0x2c, 0x56, 0x1e, 0xf9, 0x5c, 0x79, 0xe4, 0x75, 0xed, 0xb5, 0x16, 0x6b, - 0xaf, 0xf5, 0xb1, 0xf6, 0x5a, 0x77, 0xe1, 0x1e, 0xf2, 0x4a, 0x19, 0x7e, 0x01, 0x46, 0x32, 0x94, - 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 c031db0d..b0a6c63e 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 21489863..8e175305 100644 --- a/x/tokens/types/errors.go +++ b/x/tokens/types/errors.go @@ -4,8 +4,7 @@ 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") ) diff --git a/x/tokens/types/events.go b/x/tokens/types/events.go index df7b5dfc..bd5e1625 100644 --- a/x/tokens/types/events.go +++ b/x/tokens/types/events.go @@ -2,8 +2,7 @@ package types // tokens module events const ( - EventTypeUpsertTokenAlias = "upsert_token_alias" - EventTypeUpsertTokenRate = "upsert_token_rate" + EventTypeUpsertTokenInfo = "upsert_token_rate" AttributeKeyDescription = "proposal_id" AttributeKeyDenom = "proposal_type" diff --git a/x/tokens/types/genesis.go b/x/tokens/types/genesis.go index 49ecce7e..9c40adda 100644 --- a/x/tokens/types/genesis.go +++ b/x/tokens/types/genesis.go @@ -10,14 +10,11 @@ import ( // DefaultGenesis returns the default CustomGo genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - Aliases: []*TokenAlias{ - NewTokenAlias("KEX", "Kira", "", 6, []string{"ukex", "mkex"}, false), - }, - 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 + TokenInfos: []*TokenInfo{ + NewTokenInfo("ukex", sdk.NewDec(1), true, sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false, "KEX", "KEX", "", 6), // 1 + NewTokenInfo("ubtc", sdk.NewDec(10), true, sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false, "BTC", "Bitcoin", "", 9), // 10 + NewTokenInfo("xeth", sdk.NewDecWithPrec(1, 1), true, sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false, "ETH", "Ethereum", "", 18), // 0.1 + NewTokenInfo("frozen", sdk.NewDecWithPrec(1, 1), true, sdk.ZeroDec(), sdk.OneInt(), false, false, "FROZEN", "FROZEN", "", 6), // 0.1 }, TokenBlackWhites: &TokensWhiteBlack{ Whitelisted: []string{"ukex"}, diff --git a/x/tokens/types/genesis.pb.go b/x/tokens/types/genesis.pb.go index 36a06b64..e34fbedc 100644 --- a/x/tokens/types/genesis.pb.go +++ b/x/tokens/types/genesis.pb.go @@ -23,9 +23,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,omitempty"` + TokenBlackWhites *TokensWhiteBlack `protobuf:"bytes,2,opt,name=tokenBlackWhites,proto3" json:"tokenBlackWhites,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -61,16 +60,9 @@ 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 nil -} - -func (m *GenesisState) GetRates() []*TokenRate { - if m != nil { - return m.Rates + return m.TokenInfos } return nil } @@ -89,23 +81,21 @@ func init() { func init() { proto.RegisterFile("kira/tokens/genesis.proto", fileDescriptor_d3cbd9121e22d5d1) } var fileDescriptor_d3cbd9121e22d5d1 = []byte{ - // 254 bytes of a gzipped FileDescriptorProto + // 223 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, + 0x81, 0x29, 0x88, 0x2a, 0x29, 0x09, 0x64, 0x89, 0xb4, 0xa2, 0xd4, 0xd4, 0xaa, 0x54, 0x88, 0x8c, + 0xd2, 0x44, 0x46, 0x2e, 0x1e, 0x77, 0x88, 0x89, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, 0x66, 0x5c, + 0x5c, 0x60, 0x75, 0x9e, 0x79, 0x69, 0xf9, 0xc5, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x62, + 0x7a, 0x48, 0xb6, 0xe8, 0x85, 0xc0, 0xa4, 0x83, 0x90, 0x54, 0x0a, 0x79, 0x72, 0x09, 0x80, 0x79, + 0x4e, 0x39, 0x89, 0xc9, 0xd9, 0xe1, 0x19, 0x99, 0x25, 0xa9, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, + 0xdc, 0x46, 0xb2, 0x98, 0xba, 0x8b, 0xc1, 0x0a, 0xc0, 0x4a, 0x83, 0x30, 0xb4, 0x39, 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, 0xdc, 0xdf, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xef, + 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x08, 0x3c, 0x1f, 0x3b, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -138,26 +128,12 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } - if len(m.Rates) > 0 { - for iNdEx := len(m.Rates) - 1; iNdEx >= 0; iNdEx-- { + if len(m.TokenInfos) > 0 { + for iNdEx := len(m.TokenInfos) - 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 - } - } - if len(m.Aliases) > 0 { - for iNdEx := len(m.Aliases) - 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,14 +164,8 @@ 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)) } @@ -244,7 +214,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 +241,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) } diff --git a/x/tokens/types/msg_alias.go b/x/tokens/types/msg_alias.go deleted file mode 100644 index 267f615f..00000000 --- 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_token_info.go similarity index 66% rename from x/tokens/types/msg_rate.go rename to x/tokens/types/msg_token_info.go index 689ab4c1..cadb1056 100644 --- a/x/tokens/types/msg_rate.go +++ b/x/tokens/types/msg_token_info.go @@ -9,11 +9,11 @@ import ( ) var ( - _ sdk.Msg = &MsgUpsertTokenRate{} + _ sdk.Msg = &MsgUpsertTokenInfo{} ) -// NewMsgUpsertTokenRate returns an instance of MsgUpserTokenRate -func NewMsgUpsertTokenRate( +// NewMsgUpsertTokenInfo returns an instance of MsgUpserTokenInfo +func NewMsgUpsertTokenInfo( proposer sdk.AccAddress, denom string, rate sdk.Dec, @@ -22,8 +22,12 @@ func NewMsgUpsertTokenRate( stakeMin sdk.Int, stakeToken bool, invalidated bool, -) *MsgUpsertTokenRate { - return &MsgUpsertTokenRate{ + symbol string, + name string, + icon string, + decimals uint32, +) *MsgUpsertTokenInfo { + return &MsgUpsertTokenInfo{ Proposer: proposer, Denom: denom, Rate: rate, @@ -32,21 +36,25 @@ func NewMsgUpsertTokenRate( StakeMin: stakeMin, StakeToken: stakeToken, Invalidated: invalidated, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } // Route returns route -func (m *MsgUpsertTokenRate) Route() string { +func (m *MsgUpsertTokenInfo) Route() string { return ModuleName } // Type returns return message type -func (m *MsgUpsertTokenRate) Type() string { - return types.MsgTypeUpsertTokenRate +func (m *MsgUpsertTokenInfo) Type() string { + return types.MsgTypeUpsertTokenInfo } // ValidateBasic returns basic validation result -func (m *MsgUpsertTokenRate) ValidateBasic() error { +func (m *MsgUpsertTokenInfo) ValidateBasic() error { if m.Denom == appparams.DefaultDenom { return errors.New("bond denom rate is read-only") } @@ -67,13 +75,13 @@ func (m *MsgUpsertTokenRate) ValidateBasic() error { } // GetSignBytes returns to sign bytes -func (m *MsgUpsertTokenRate) GetSignBytes() []byte { +func (m *MsgUpsertTokenInfo) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(m) return sdk.MustSortJSON(bz) } // GetSigners returns signers -func (m *MsgUpsertTokenRate) GetSigners() []sdk.AccAddress { +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 82a7ebef..ea6823fe 100644 --- a/x/tokens/types/proposal.go +++ b/x/tokens/types/proposal.go @@ -9,47 +9,11 @@ import ( ) var ( - _ types.Content = &ProposalUpsertTokenAlias{} - _ types.Content = &ProposalUpsertTokenRates{} + _ types.Content = &ProposalUpsertTokenInfo{} _ types.Content = &ProposalTokensWhiteBlackChange{} ) -func NewUpsertTokenAliasProposal( - 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( +func NewUpsertTokenInfosProposal( denom string, rate sdk.Dec, feePayments bool, @@ -57,8 +21,12 @@ func NewUpsertTokenRatesProposal( stakeMin sdk.Int, stakeToken bool, isInvalidated bool, -) *ProposalUpsertTokenRates { - return &ProposalUpsertTokenRates{ + symbol string, + name string, + icon string, + decimals uint32, +) *ProposalUpsertTokenInfo { + return &ProposalUpsertTokenInfo{ Denom: denom, Rate: rate, FeePayments: feePayments, @@ -66,23 +34,27 @@ func NewUpsertTokenRatesProposal( StakeMin: stakeMin, StakeToken: stakeToken, Invalidated: isInvalidated, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } -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 03b06298..93e33411 100644 --- a/x/tokens/types/proposal.pb.go +++ b/x/tokens/types/proposal.pb.go @@ -25,27 +25,32 @@ 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"` + 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"` + 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"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,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 +60,119 @@ 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.Symbol - } - return "" -} - -func (m *ProposalUpsertTokenAlias) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ProposalUpsertTokenAlias) GetIcon() string { - if m != nil { - return m.Icon + return m.Denom } return "" } -func (m *ProposalUpsertTokenAlias) GetDecimals() uint32 { +func (m *ProposalUpsertTokenInfo) GetFeePayments() bool { if m != nil { - return m.Decimals + return m.FeePayments } - return 0 + return false } -func (m *ProposalUpsertTokenAlias) GetDenoms() []string { +func (m *ProposalUpsertTokenInfo) GetStakeToken() bool { if m != nil { - return m.Denoms + return m.StakeToken } - return nil + return false } -func (m *ProposalUpsertTokenAlias) GetInvalidated() bool { +func (m *ProposalUpsertTokenInfo) GetInvalidated() bool { if m != nil { return m.Invalidated } return false } -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 *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 *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) -} - -var xxx_messageInfo_ProposalUpsertTokenRates proto.InternalMessageInfo - -func (m *ProposalUpsertTokenRates) GetDenom() string { +func (m *ProposalUpsertTokenInfo) GetSymbol() string { if m != nil { - return m.Denom + return m.Symbol } return "" } -func (m *ProposalUpsertTokenRates) GetFeePayments() bool { +func (m *ProposalUpsertTokenInfo) GetName() string { if m != nil { - return m.FeePayments + return m.Name } - return false + return "" } -func (m *ProposalUpsertTokenRates) GetStakeToken() bool { +func (m *ProposalUpsertTokenInfo) GetIcon() string { if m != nil { - return m.StakeToken + return m.Icon } - return false + return "" } -func (m *ProposalUpsertTokenRates) GetInvalidated() bool { +func (m *ProposalUpsertTokenInfo) GetDecimals() uint32 { if m != nil { - return m.Invalidated + return m.Decimals } - return false + return 0 } 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, 0x6b, 0x1d, 0x10, 0xc8, 0x3a, 0xa1, 0xd0, 0x21, 0x09, 0x19, 0x50, 0x97, - 0x6b, 0x06, 0xb6, 0x93, 0x18, 0x48, 0x59, 0x10, 0x42, 0x3a, 0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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, -} - -func (this *ProposalUpsertTokenAlias) Equal(that interface{}) bool { + // 428 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x8e, 0xd3, 0x30, + 0x18, 0xc7, 0x1b, 0xe8, 0xf5, 0x5a, 0x07, 0x04, 0xb2, 0x4e, 0x60, 0x3a, 0x24, 0xa5, 0x03, 0xea, + 0x72, 0xc9, 0xc0, 0x76, 0x63, 0xca, 0x72, 0x42, 0x48, 0xa7, 0x08, 0x16, 0x96, 0xca, 0x4d, 0xbe, + 0x16, 0x2b, 0xb1, 0x3f, 0x2b, 0x36, 0x88, 0xbe, 0x01, 0x23, 0x8f, 0xc0, 0x43, 0xf0, 0x10, 0x27, + 0xa6, 0x1b, 0x11, 0x43, 0x85, 0xda, 0x85, 0x99, 0x27, 0x40, 0xb1, 0x73, 0xc7, 0xe9, 0xb6, 0x4e, + 0xf9, 0xfe, 0xbf, 0x7f, 0xf2, 0xfd, 0x95, 0xbf, 0x4d, 0xc6, 0x95, 0x68, 0x78, 0x6a, 0xb1, 0x02, + 0x65, 0x52, 0xdd, 0xa0, 0x46, 0xc3, 0xeb, 0x44, 0x37, 0x68, 0x91, 0x86, 0xad, 0x97, 0x78, 0x6f, + 0x7c, 0xb2, 0xc6, 0x35, 0x3a, 0x9e, 0xb6, 0x93, 0x7f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xd8, 0x97, + 0x70, 0x0b, 0xd1, 0x27, 0x64, 0x60, 0x36, 0x72, 0x89, 0x35, 0x1b, 0xba, 0x23, 0xe8, 0x14, 0xa5, + 0xa4, 0xaf, 0xb8, 0x04, 0x36, 0x72, 0xd4, 0xcd, 0x2d, 0x13, 0x05, 0x2a, 0x46, 0x3c, 0x6b, 0x67, + 0x3a, 0x26, 0xc3, 0x12, 0x0a, 0x21, 0x79, 0x6d, 0x58, 0x38, 0x09, 0x66, 0x0f, 0xf3, 0x1b, 0x7d, + 0xf6, 0xe8, 0xcf, 0xb7, 0x38, 0xf8, 0xf1, 0xfd, 0xf4, 0x78, 0x8e, 0xca, 0x82, 0xb2, 0x59, 0x76, + 0xb9, 0x8b, 0x82, 0xab, 0x5d, 0x14, 0xfc, 0xde, 0x45, 0xc1, 0xd7, 0x7d, 0xd4, 0xbb, 0xda, 0x47, + 0xbd, 0x9f, 0xfb, 0xa8, 0xf7, 0x7e, 0x76, 0xab, 0x8f, 0xd7, 0xa2, 0xe1, 0x73, 0x6c, 0x20, 0x35, + 0x50, 0x71, 0x91, 0x7e, 0xbe, 0xbe, 0x95, 0xae, 0x95, 0xe5, 0xc0, 0xdd, 0xaa, 0x97, 0xff, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xfe, 0x9b, 0x3a, 0xa5, 0xb1, 0x02, 0x00, 0x00, +} + +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 +184,42 @@ func (this *ProposalUpsertTokenAlias) Equal(that interface{}) bool { } else if this == nil { return false } - if this.Symbol != that1.Symbol { - return false - } - if this.Name != that1.Name { - return false - } - if this.Icon != that1.Icon { - return false - } - if this.Decimals != that1.Decimals { + if this.Denom != that1.Denom { return false } - if len(this.Denoms) != len(that1.Denoms) { + if !this.Rate.Equal(that1.Rate) { return false } - for i := range this.Denoms { - if this.Denoms[i] != that1.Denoms[i] { - return false - } - } - if this.Invalidated != that1.Invalidated { + if this.FeePayments != that1.FeePayments { return false } - return true -} -func (this *ProposalUpsertTokenRates) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProposalUpsertTokenRates) - if !ok { - that2, ok := that.(ProposalUpsertTokenRates) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { + if !this.StakeCap.Equal(that1.StakeCap) { return false } - if this.Denom != that1.Denom { + if !this.StakeMin.Equal(that1.StakeMin) { return false } - if !this.Rate.Equal(that1.Rate) { + if this.StakeToken != that1.StakeToken { return false } - if this.FeePayments != that1.FeePayments { + if this.Invalidated != that1.Invalidated { return false } - if !this.StakeCap.Equal(that1.StakeCap) { + if this.Symbol != that1.Symbol { return false } - if !this.StakeMin.Equal(that1.StakeMin) { + if this.Name != that1.Name { return false } - if this.StakeToken != that1.StakeToken { + if this.Icon != that1.Icon { return false } - if this.Invalidated != that1.Invalidated { + if this.Decimals != that1.Decimals { 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,84 +229,42 @@ 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 { - 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 = encodeVarintProposal(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } if m.Decimals != 0 { i = encodeVarintProposal(dAtA, i, uint64(m.Decimals)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x58 } 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] = 0x52 } 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] = 0x4a } 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 + dAtA[i] = 0x42 } - 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 - } - 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 { i-- if m.Invalidated { @@ -475,40 +346,7 @@ func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *ProposalUpsertTokenAlias) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Icon) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - 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)) - } - } - if m.Invalidated { - n += 2 - } - return n -} - -func (m *ProposalUpsertTokenRates) Size() (n int) { +func (m *ProposalUpsertTokenInfo) Size() (n int) { if m == nil { return 0 } @@ -533,6 +371,21 @@ func (m *ProposalUpsertTokenRates) Size() (n int) { if m.Invalidated { n += 2 } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Icon) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.Decimals != 0 { + n += 1 + sovProposal(uint64(m.Decimals)) + } return n } @@ -542,7 +395,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 +418,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 +454,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 Rate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -633,13 +486,15 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -649,29 +504,17 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(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.Icon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.FeePayments = bool(v != 0) case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) } - m.Decimals = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -681,14 +524,29 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Decimals |= uint32(b&0x7F) << shift + 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.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 Denoms", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -716,11 +574,13 @@ 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.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 Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -737,62 +597,12 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { break } } - m.Invalidated = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > 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 - } - } - 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: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + m.StakeToken = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -802,27 +612,15 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(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.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: + m.Invalidated = bool(v != 0) + 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 Symbol", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -850,33 +648,11 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Symbol = string(dAtA[iNdEx:postIndex]) 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 ErrIntOverflowProposal - } - 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: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -904,13 +680,11 @@ 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.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 10: 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,35 +712,13 @@ 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 6: + case 11: 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 ErrIntOverflowProposal - } - 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) + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) } - var v int + m.Decimals = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -976,12 +728,11 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Decimals |= uint32(b&0x7F) << shift if b < 0x80 { break } } - m.Invalidated = bool(v != 0) 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 e878417d..9d48a34f 100644 --- a/x/tokens/types/query.pb.go +++ b/x/tokens/types/query.pb.go @@ -29,22 +29,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,41 +54,41 @@ 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"` } -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 { +func (m *TokenInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenAliasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenAliasResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -98,40 +98,40 @@ func (m *TokenAliasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *TokenAliasResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasResponse.Merge(m, src) +func (m *TokenInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfoResponse.Merge(m, src) } -func (m *TokenAliasResponse) XXX_Size() int { +func (m *TokenInfoResponse) XXX_Size() int { return m.Size() } -func (m *TokenAliasResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasResponse.DiscardUnknown(m) +func (m *TokenInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_TokenAliasResponse proto.InternalMessageInfo +var xxx_messageInfo_TokenInfoResponse proto.InternalMessageInfo -func (m *TokenAliasResponse) GetData() *TokenAlias { +func (m *TokenInfoResponse) GetData() *TokenInfo { if m != nil { return m.Data } return nil } -type AllTokenAliasesRequest struct { +type AllTokenInfosRequest struct { } -func (m *AllTokenAliasesRequest) Reset() { *m = AllTokenAliasesRequest{} } -func (m *AllTokenAliasesRequest) String() string { return proto.CompactTextString(m) } -func (*AllTokenAliasesRequest) ProtoMessage() {} -func (*AllTokenAliasesRequest) Descriptor() ([]byte, []int) { +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 *AllTokenAliasesRequest) XXX_Unmarshal(b []byte) error { +func (m *AllTokenInfosRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AllTokenAliasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AllTokenInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AllTokenAliasesRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_AllTokenInfosRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -141,36 +141,34 @@ func (m *AllTokenAliasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *AllTokenAliasesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenAliasesRequest.Merge(m, src) +func (m *AllTokenInfosRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllTokenInfosRequest.Merge(m, src) } -func (m *AllTokenAliasesRequest) XXX_Size() int { +func (m *AllTokenInfosRequest) XXX_Size() int { return m.Size() } -func (m *AllTokenAliasesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenAliasesRequest.DiscardUnknown(m) +func (m *AllTokenInfosRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AllTokenInfosRequest.DiscardUnknown(m) } -var xxx_messageInfo_AllTokenAliasesRequest proto.InternalMessageInfo +var xxx_messageInfo_AllTokenInfosRequest 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"` +type AllTokenInfosResponse struct { + Data []*TokenInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` } -func (m *AllTokenAliasesResponse) Reset() { *m = AllTokenAliasesResponse{} } -func (m *AllTokenAliasesResponse) String() string { return proto.CompactTextString(m) } -func (*AllTokenAliasesResponse) ProtoMessage() {} -func (*AllTokenAliasesResponse) Descriptor() ([]byte, []int) { +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 *AllTokenAliasesResponse) XXX_Unmarshal(b []byte) error { +func (m *AllTokenInfosResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AllTokenAliasesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AllTokenInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AllTokenAliasesResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_AllTokenInfosResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -180,55 +178,41 @@ func (m *AllTokenAliasesResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *AllTokenAliasesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenAliasesResponse.Merge(m, src) +func (m *AllTokenInfosResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllTokenInfosResponse.Merge(m, src) } -func (m *AllTokenAliasesResponse) XXX_Size() int { +func (m *AllTokenInfosResponse) XXX_Size() int { return m.Size() } -func (m *AllTokenAliasesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenAliasesResponse.DiscardUnknown(m) +func (m *AllTokenInfosResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AllTokenInfosResponse.DiscardUnknown(m) } -var xxx_messageInfo_AllTokenAliasesResponse proto.InternalMessageInfo +var xxx_messageInfo_AllTokenInfosResponse proto.InternalMessageInfo -func (m *AllTokenAliasesResponse) GetData() []*TokenAlias { +func (m *AllTokenInfosResponse) GetData() []*TokenInfo { 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 { +type TokenInfosByDenomRequest 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) { +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 *TokenAliasesByDenomRequest) XXX_Unmarshal(b []byte) error { +func (m *TokenInfosByDenomRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenAliasesByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfosByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenAliasesByDenomRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfosByDenomRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -238,297 +222,41 @@ func (m *TokenAliasesByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *TokenAliasesByDenomRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasesByDenomRequest.Merge(m, src) +func (m *TokenInfosByDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfosByDenomRequest.Merge(m, src) } -func (m *TokenAliasesByDenomRequest) XXX_Size() int { +func (m *TokenInfosByDenomRequest) XXX_Size() int { return m.Size() } -func (m *TokenAliasesByDenomRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasesByDenomRequest.DiscardUnknown(m) +func (m *TokenInfosByDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfosByDenomRequest.DiscardUnknown(m) } -var xxx_messageInfo_TokenAliasesByDenomRequest proto.InternalMessageInfo +var xxx_messageInfo_TokenInfosByDenomRequest proto.InternalMessageInfo -func (m *TokenAliasesByDenomRequest) GetDenoms() []string { +func (m *TokenInfosByDenomRequest) 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"` +type TokenInfosByDenomResponse struct { + Data map[string]*TokenInfo `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) { +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 *TokenAliasesByDenomResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenAliasesByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenAliasesByDenomResponse.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 *TokenAliasesByDenomResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasesByDenomResponse.Merge(m, src) -} -func (m *TokenAliasesByDenomResponse) XXX_Size() int { - return m.Size() -} -func (m *TokenAliasesByDenomResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasesByDenomResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenAliasesByDenomResponse proto.InternalMessageInfo - -func (m *TokenAliasesByDenomResponse) GetData() map[string]*TokenAlias { - 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 { - if m != nil { - return m.Data - } - return nil -} - -type AllTokenRatesRequest 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 *AllTokenRatesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AllTokenRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AllTokenRatesRequest.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 *AllTokenRatesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenRatesRequest.Merge(m, src) -} -func (m *AllTokenRatesRequest) XXX_Size() int { - return m.Size() -} -func (m *AllTokenRatesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenRatesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AllTokenRatesRequest proto.InternalMessageInfo - -type AllTokenRatesResponse struct { - Data []*TokenRate `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` -} - -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 *AllTokenRatesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AllTokenRatesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AllTokenRatesResponse.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 *AllTokenRatesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenRatesResponse.Merge(m, src) -} -func (m *AllTokenRatesResponse) XXX_Size() int { - return m.Size() -} -func (m *AllTokenRatesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenRatesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AllTokenRatesResponse proto.InternalMessageInfo - -func (m *AllTokenRatesResponse) GetData() []*TokenRate { - if m != nil { - return m.Data - } - return nil -} - -type TokenRatesByDenomRequest 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 *TokenRatesByDenomRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenRatesByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenRatesByDenomRequest.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 *TokenRatesByDenomRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRatesByDenomRequest.Merge(m, src) -} -func (m *TokenRatesByDenomRequest) XXX_Size() int { - return m.Size() -} -func (m *TokenRatesByDenomRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRatesByDenomRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenRatesByDenomRequest proto.InternalMessageInfo - -func (m *TokenRatesByDenomRequest) 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"` -} - -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 *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 +266,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]*TokenInfo { if m != nil { return m.Data } @@ -564,7 +292,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) @@ -601,7 +329,7 @@ func (m *TokenBlackWhitesResponse) Reset() { *m = TokenBlackWhitesRespon 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) @@ -638,20 +366,13 @@ func (m *TokenBlackWhitesResponse) GetData() *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]*TokenInfo)(nil), "kira.tokens.TokenInfosByDenomResponse.DataEntry") proto.RegisterType((*TokenBlackWhitesRequest)(nil), "kira.tokens.TokenBlackWhitesRequest") proto.RegisterType((*TokenBlackWhitesResponse)(nil), "kira.tokens.TokenBlackWhitesResponse") } @@ -659,52 +380,41 @@ 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, 0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 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, + // 544 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x13, 0x52, 0x29, 0x53, 0x0e, 0xe9, 0x36, 0xa4, 0x89, 0x4b, 0x2c, 0x6a, 0x28, 0x8a, + 0x10, 0xb2, 0x21, 0x5c, 0x10, 0x17, 0x44, 0x1a, 0x54, 0x21, 0x84, 0x10, 0x11, 0x12, 0x12, 0x97, + 0x68, 0xd3, 0x6e, 0x1d, 0xcb, 0xae, 0x37, 0xf5, 0xae, 0x01, 0x73, 0x44, 0xe2, 0xc2, 0x09, 0x89, + 0x3f, 0xe1, 0x2b, 0x38, 0x56, 0xe2, 0xc2, 0x11, 0x25, 0xfc, 0x06, 0x12, 0xf2, 0xee, 0xc6, 0xb5, +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73, 0x21, 0x26, 0xb3, + 0x4a, 0x74, 0xab, 0x48, 0x52, 0x34, 0x81, 0xbe, 0xbb, 0x02, 0xa5, 0x94, 0xec, 0x08, 0x25, 0xdb, + 0xa8, 0x9d, 0x53, 0x32, 0x4e, 0x90, 0xa3, 0xf7, 0x02, 0xda, 0xef, 0xff, 0x98, 0x19, 0xda, 0xe9, + 0xcc, 0xd0, 0x7e, 0xcf, 0x0c, 0xed, 0xeb, 0xdc, 0x28, 0x9d, 0xce, 0x8d, 0xd2, 0xaf, 0xb9, 0x51, + 0x7a, 0xdb, 0x75, 0x5c, 0x3e, 0x89, 0xc6, 0xd6, 0x01, 0x3d, 0xb6, 0x9f, 0xbb, 0x21, 0xde, 0xa3, + 0x21, 0xb1, 0x19, 0xf1, 0xb0, 0x6b, 0x7f, 0x48, 0x9f, 0xac, 0x78, 0x4a, 0xd8, 0x78, 0x4d, 0xbc, + 0x32, 0x0f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x81, 0x7d, 0x12, 0xf4, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -719,14 +429,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 +445,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 +483,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 +495,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) GetTokenInfo(ctx context.Context, req *TokenInfoRequest) (*TokenInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTokenInfo not implemented") } -func (*UnimplementedQueryServer) GetAllTokenAliases(ctx context.Context, req *AllTokenAliasesRequest) (*AllTokenAliasesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAllTokenAliases not implemented") +func (*UnimplementedQueryServer) GetAllTokenInfos(ctx context.Context, req *AllTokenInfosRequest) (*AllTokenInfosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllTokenInfos 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) GetAllTokenRates(ctx context.Context, req *AllTokenRatesRequest) (*AllTokenRatesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAllTokenRates 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 +512,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 +589,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 +609,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 +619,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,12 +649,12 @@ 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 @@ -1074,7 +674,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 +684,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 +697,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 +707,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 +734,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 +744,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 +766,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 +776,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 @@ -1229,7 +815,7 @@ func (m *TokenAliasesByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *TokenRateRequest) Marshal() (dAtA []byte, err error) { +func (m *TokenBlackWhitesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1239,218 +825,12 @@ func (m *TokenRateRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenRateRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenBlackWhitesRequest) 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]) - 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 *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 - } - 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 *TokenBlackWhitesRequest) 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 *TokenBlackWhitesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenBlackWhitesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenBlackWhitesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1504,20 +884,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 } @@ -1530,7 +910,7 @@ func (m *TokenAliasResponse) Size() (n int) { return n } -func (m *AllTokenAliasesRequest) Size() (n int) { +func (m *AllTokenInfosRequest) Size() (n int) { if m == nil { return 0 } @@ -1539,7 +919,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 +931,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 +949,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 } @@ -1599,20 +971,16 @@ func (m *TokenAliasesByDenomResponse) Size() (n int) { return n } -func (m *TokenRateRequest) Size() (n int) { +func (m *TokenBlackWhitesRequest) 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) { +func (m *TokenBlackWhitesResponse) Size() (n int) { if m == nil { return 0 } @@ -1625,723 +993,13 @@ func (m *TokenRateResponse) Size() (n int) { 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 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 - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenAliasesByDenomRequest) 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: TokenAliasesByDenomRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasesByDenomRequest: 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) - } - 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.Denoms = append(m.Denoms, 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 *TokenAliasesByDenomResponse) 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: TokenAliasesByDenomResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasesByDenomResponse: 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 = 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[mapkey] = mapvalue - 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 *TokenRateRequest) Unmarshal(dAtA []byte) error { +func (m *TokenInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2364,10 +1022,10 @@ func (m *TokenRateRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenRateRequest: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRateRequest: 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: @@ -2423,7 +1081,7 @@ func (m *TokenRateRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *TokenRateResponse) Unmarshal(dAtA []byte) error { +func (m *TokenInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2446,10 +1104,10 @@ func (m *TokenRateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenRateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRateResponse: 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: @@ -2482,7 +1140,7 @@ func (m *TokenRateResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Data == nil { - m.Data = &TokenRate{} + m.Data = &TokenInfo{} } if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2509,7 +1167,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 +1190,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 +1217,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 +1240,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 +1275,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, &TokenInfo{}) if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2643,7 +1301,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 +1324,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 +1383,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 +1406,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 +1442,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]*TokenInfo) } var mapkey string - var mapvalue *TokenRate + var mapvalue *TokenInfo for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -2861,7 +1519,7 @@ func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &TokenRate{} + mapvalue = &TokenInfo{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } diff --git a/x/tokens/types/query.pb.gw.go b/x/tokens/types/query.pb.gw.go index 6874cb6a..bce99add 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 5d73fa6a..00000000 --- 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,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5b, 0xa9, 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 00000000..24b5424d --- /dev/null +++ b/x/tokens/types/token.pb.go @@ -0,0 +1,783 @@ +// 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"` + 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"` + 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"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,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) GetFeePayments() bool { + if m != nil { + return m.FeePayments + } + return false +} + +func (m *TokenInfo) GetStakeToken() bool { + if m != nil { + return m.StakeToken + } + return false +} + +func (m *TokenInfo) GetInvalidated() bool { + if m != nil { + return m.Invalidated + } + 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 init() { + proto.RegisterType((*TokenInfo)(nil), "kira.tokens.TokenInfo") +} + +func init() { proto.RegisterFile("kira/tokens/token.proto", fileDescriptor_0ed83e3668468753) } + +var fileDescriptor_0ed83e3668468753 = []byte{ + // 391 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0xae, 0xd3, 0x30, + 0x14, 0x86, 0x13, 0xee, 0xbd, 0xbd, 0x89, 0x03, 0x12, 0xb2, 0x2a, 0xb0, 0x3a, 0x24, 0xa1, 0x03, + 0xca, 0x42, 0x32, 0xb0, 0x31, 0xa6, 0x2c, 0x15, 0x42, 0x42, 0x11, 0x13, 0x4b, 0xe5, 0x26, 0x27, + 0xc5, 0x4a, 0x6c, 0x47, 0xb1, 0x41, 0xe4, 0x2d, 0x78, 0xac, 0x8e, 0x1d, 0x11, 0x43, 0x85, 0xda, + 0x17, 0x40, 0x3c, 0x01, 0xb2, 0x53, 0x4a, 0x75, 0xb7, 0x4e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0x99, + 0xc0, 0x11, 0x0a, 0x46, 0x6e, 0x93, 0x27, 0x13, 0x3b, 0x23, 0xb2, 0xc8, 0x46, 0x8d, 0x63, 0x14, + 0x30, 0xf1, 0x95, 0xb6, 0xac, 0xa2, 0x1a, 0x2a, 0x72, 0x3f, 0x86, 0x70, 0x81, 0xf0, 0x33, 0x34, + 0x51, 0x03, 0x5f, 0xcb, 0x96, 0x78, 0xf6, 0x27, 0x4e, 0x15, 0xc6, 0xe8, 0x56, 0x50, 0x0e, 0xc4, + 0xb7, 0xd4, 0x6a, 0xc3, 0x58, 0x29, 0x05, 0x41, 0x23, 0x33, 0x1a, 0xcf, 0x90, 0x57, 0x41, 0xc9, + 0x38, 0x6d, 0x15, 0x09, 0x62, 0x37, 0x79, 0x52, 0x9c, 0xeb, 0x3c, 0xdf, 0x1e, 0x42, 0x77, 0x77, + 0x08, 0xdd, 0x5f, 0x87, 0xd0, 0xfd, 0x7e, 0x0c, 0x9d, 0xdd, 0x31, 0x74, 0x7e, 0x1c, 0x43, 0xe7, + 0x53, 0x72, 0x31, 0xfe, 0x3b, 0xd6, 0xd3, 0x85, 0xec, 0x21, 0x53, 0xd0, 0x50, 0x96, 0x7d, 0x3b, + 0xef, 0x97, 0x09, 0x61, 0x3d, 0xb1, 0xdb, 0xf3, 0xfa, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, + 0x8c, 0x89, 0xbc, 0x7b, 0x02, 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 m.Decimals != 0 { + i = encodeVarintToken(dAtA, i, uint64(m.Decimals)) + i-- + dAtA[i] = 0x58 + } + 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] = 0x52 + } + 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] = 0x4a + } + 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] = 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 = encodeVarintToken(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 = encodeVarintToken(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 = encodeVarintToken(dAtA, i, uint64(size)) + } + 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 = m.FeeRate.Size() + n += 1 + l + sovToken(uint64(l)) + if m.FeePayments { + n += 2 + } + l = m.StakeCap.Size() + n += 1 + l + sovToken(uint64(l)) + l = m.StakeMin.Size() + n += 1 + l + sovToken(uint64(l)) + if m.StakeToken { + n += 2 + } + if m.Invalidated { + 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)) + } + 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 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 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 ErrIntOverflowToken + } + 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 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 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 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 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 ErrIntOverflowToken + } + 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 ErrIntOverflowToken + } + 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 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 9: + 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 10: + 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 11: + 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 + } + } + 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 29abfaa9..9b94a136 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,33 @@ 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"` + 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"` + 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"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,12,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 +65,96 @@ 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) GetFeePayments() bool { + if m != nil { + return m.FeePayments + } + return false +} + +func (m *MsgUpsertTokenInfo) GetStakeToken() bool { + if m != nil { + return m.StakeToken + } + return false +} + +func (m *MsgUpsertTokenInfo) GetInvalidated() bool { + if m != nil { + return m.Invalidated + } + 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) GetProposer() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Proposer + } + return nil } -func (m *MsgUpsertTokenRateResponse) Reset() { *m = MsgUpsertTokenRateResponse{} } -func (m *MsgUpsertTokenRateResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertTokenRateResponse) ProtoMessage() {} -func (*MsgUpsertTokenRateResponse) Descriptor() ([]byte, []int) { +type MsgUpsertTokenInfoResponse struct { +} + +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 +164,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 +281,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 +290,44 @@ 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, + // 587 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0x6e, 0x58, 0xd7, 0xb5, 0x6e, 0xa7, 0x21, 0x6b, 0x30, 0x2b, 0x42, 0x49, 0xc9, 0x01, 0x7a, + 0x59, 0x22, 0xc1, 0x8d, 0xdb, 0xb2, 0x71, 0x98, 0xa0, 0x12, 0x8a, 0xc6, 0x05, 0x0e, 0xc5, 0x4b, + 0x5e, 0xd3, 0xa8, 0x8d, 0x1d, 0xd9, 0x1e, 0x6a, 0xf9, 0x15, 0xfc, 0x14, 0x7e, 0xc6, 0x8e, 0x3b, + 0x70, 0x40, 0x1c, 0x2a, 0xd4, 0xfe, 0x83, 0x1d, 0x39, 0xa1, 0x38, 0x69, 0x97, 0x75, 0x42, 0xb0, + 0x93, 0xdf, 0x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x05, 0x60, 0x11, 0x88, 0xc2, 0x73, 0x41, 0x99, 0xe5, 0x1d, 0x8f, 0xa8, 0x1c, 0x69, 0xf7, 0xb4, + 0x02, 0x1d, 0xe7, 0x58, 0x44, 0x15, 0xd5, 0x8e, 0xe9, 0x04, 0x3a, 0x76, 0x0e, 0xd0, 0xa3, 0x5b, + 0x4a, 0xab, 0x4f, 0x78, 0xf1, 0xcd, 0x40, 0x5b, 0x7d, 0x19, 0xe3, 0x8f, 0x68, 0x6f, 0xd3, 0xfb, + 0xb6, 0x5b, 0x79, 0x85, 0xee, 0xdd, 0x36, 0xcc, 0xe7, 0xff, 0xd8, 0xb0, 0x12, 0xc1, 0x6f, 0x11, + 0xaa, 0x34, 0x69, 0x6e, 0x1e, 0xbb, 0xe1, 0x4c, 0xe7, 0xef, 0xdc, 0xaa, 0x9a, 0xef, 0x5f, 0x2e, + 0x2c, 0xe3, 0x6a, 0x61, 0x19, 0xbf, 0x16, 0x96, 0xf1, 0x75, 0x69, 0xd5, 0xae, 0x96, 0x56, 0xed, + 0xc7, 0xd2, 0xaa, 0x7d, 0xe8, 0x55, 0xae, 0xe9, 0x4d, 0x22, 0xe8, 0x31, 0x17, 0xe0, 0x49, 0x18, + 0xd3, 0xc4, 0x9b, 0xae, 0x7f, 0x07, 0xf9, 0x65, 0x9d, 0x37, 0xf4, 0xab, 0x7f, 0xf9, 0x27, 0x00, + 0x00, 0xff, 0xff, 0x8b, 0xa1, 0xd0, 0xfc, 0x7f, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -252,10 +342,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 +356,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 +376,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 +386,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 +397,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) +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).UpsertTokenAlias(ctx, in) + return srv.(MsgServer).UpsertTokenInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kira.tokens.Msg/UpsertTokenAlias", + FullMethod: "/kira.tokens.Msg/UpsertTokenInfo", } 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) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpsertTokenRate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.tokens.Msg/UpsertTokenRate", - } - 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 +438,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 +450,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 +460,120 @@ 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] = 0x62 + } + if m.Decimals != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Decimals)) + i-- + dAtA[i] = 0x58 + } + 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] = 0x52 + } + 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] = 0x4a + } + 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] = 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 = encodeVarintTx(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 = encodeVarintTx(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 = encodeVarintTx(dAtA, i, uint64(size)) + } + 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 +583,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 +681,54 @@ 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 = m.Rate.Size() + n += 1 + l + sovTx(uint64(l)) + if m.FeePayments { + n += 2 + } + l = m.StakeCap.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.StakeMin.Size() + n += 1 + l + sovTx(uint64(l)) + if m.StakeToken { + n += 2 + } + if m.Invalidated { + 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.Proposer) + if l > 0 { + n += 1 + 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 +777,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 +800,355 @@ 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 Rate", 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.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 ErrIntOverflowTx + } + 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 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 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 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 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 ErrIntOverflowTx + } + 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 ErrIntOverflowTx + } + 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 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 9: + 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 10: + 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 11: + 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 12: + 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 +1170,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 +1193,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 299b31e5..4a588e83 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -4,27 +4,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// NewTokenAlias generates a new token alias struct. -func NewTokenAlias( - 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, - } -} - -// NewTokenRate generates a new token rate struct. -func NewTokenRate( +// NewTokenInfo generates a new token rate struct. +func NewTokenInfo( denom string, feeRate sdk.Dec, feePayments bool, @@ -32,8 +13,12 @@ func NewTokenRate( stakeMin sdk.Int, stakeToken bool, invalidated bool, -) *TokenRate { - return &TokenRate{ + symbol string, + name string, + icon string, + decimals uint32, +) *TokenInfo { + return &TokenInfo{ Denom: denom, FeeRate: feeRate, FeePayments: feePayments, @@ -41,5 +26,9 @@ func NewTokenRate( StakeMin: stakeMin, StakeToken: stakeToken, Invalidated: invalidated, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } From 22ab369e18e9f14b65e4b807915c29df65d7260d Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 29 May 2024 21:38:17 +0800 Subject: [PATCH 06/14] tokens module refactoring and token minting in other modules to use tokens module --- app/app.go | 11 +- proto/kira/tokens/genesis.proto | 5 +- proto/kira/tokens/query.proto | 8 +- x/basket/keeper/keeper.go | 5 +- x/basket/keeper/mint_burn_swap.go | 2 +- x/basket/types/expected_keepers.go | 8 + x/genutil/client/cli/init.go | 2 +- x/gov/types/permission.pb.go | 223 +++++++++++------------ x/layer2/keeper/abci.go | 2 +- x/layer2/keeper/keeper.go | 9 +- x/layer2/keeper/msg_server.go | 2 +- x/layer2/types/expected_keepers.go | 7 + x/multistaking/keeper/delegation.go | 2 +- x/multistaking/types/expected_keepers.go | 3 +- x/recovery/keeper/keeper.go | 3 + x/recovery/keeper/msg_server.go | 2 +- x/recovery/types/expected_keepers.go | 7 + x/tokens/handler_test.go | 2 +- x/tokens/keeper/freeze.go | 36 ++-- x/tokens/keeper/freeze_test.go | 4 +- x/tokens/keeper/grpc_query.go | 34 ++-- x/tokens/keeper/grpc_query_test.go | 12 +- x/tokens/keeper/mint.go | 29 +++ x/tokens/keeper/msg_server.go | 2 +- x/tokens/keeper/token_info.go | 29 ++- x/tokens/keeper/token_info_test.go | 8 +- x/tokens/module.go | 2 +- x/tokens/proposal_handler.go | 2 +- x/tokens/types/expected_keepers.go | 2 + x/tokens/types/genesis.go | 4 +- x/tokens/types/genesis.pb.go | 68 ++++--- x/tokens/types/query.pb.go | 209 ++++++++++++--------- x/tokens/types/types.go | 4 +- x/ubi/keeper/keeper.go | 9 +- x/ubi/keeper/ubi.go | 2 +- x/ubi/types/expected_keepers.go | 7 + 36 files changed, 439 insertions(+), 327 deletions(-) create mode 100644 x/tokens/keeper/mint.go diff --git a/app/app.go b/app/app.go index 20614294..de96cb96 100644 --- a/app/app.go +++ b/app/app.go @@ -316,6 +316,7 @@ func NewInitApp( app.CustomStakingKeeper, app.CustomGovKeeper, app.SpendingKeeper, + app.TokensKeeper, ) app.UpgradeKeeper = upgradekeeper.NewKeeper(keys[upgradetypes.StoreKey], appCodec, app.CustomStakingKeeper) @@ -346,6 +347,7 @@ func NewInitApp( app.CollectivesKeeper, app.SpendingKeeper, app.CustodyKeeper, + app.TokensKeeper, ) app.DistrKeeper = distributorkeeper.NewKeeper( @@ -354,7 +356,14 @@ func NewInitApp( app.CustomStakingKeeper, app.CustomGovKeeper, app.MultiStakingKeeper, app.RecoveryKeeper) 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{ diff --git a/proto/kira/tokens/genesis.proto b/proto/kira/tokens/genesis.proto index 2f039270..785b0879 100644 --- a/proto/kira/tokens/genesis.proto +++ b/proto/kira/tokens/genesis.proto @@ -1,12 +1,13 @@ syntax = "proto3"; package kira.tokens; +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.TokenInfo tokenInfos = 1; - TokensWhiteBlack tokenBlackWhites = 2; + repeated kira.tokens.TokenInfo tokenInfos = 1 [ (gogoproto.nullable) = false ]; + TokensWhiteBlack tokenBlackWhites = 2 [ (gogoproto.nullable) = false ]; } diff --git a/proto/kira/tokens/query.proto b/proto/kira/tokens/query.proto index c5759cc8..82dbbb62 100644 --- a/proto/kira/tokens/query.proto +++ b/proto/kira/tokens/query.proto @@ -5,6 +5,7 @@ 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"; @@ -32,12 +33,13 @@ message TokenInfoRequest { message TokenInfoResponse { kira.tokens.TokenInfo data = 1; + cosmos.base.v1beta1.Coin supply = 2 [(gogoproto.nullable) = false]; } message AllTokenInfosRequest {} message AllTokenInfosResponse { - repeated kira.tokens.TokenInfo data = 1; + repeated TokenInfoResponse data = 1 [ (gogoproto.nullable) = false ]; } message TokenInfosByDenomRequest { @@ -45,10 +47,10 @@ message TokenInfosByDenomRequest { } message TokenInfosByDenomResponse { - map data = 1; + 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/x/basket/keeper/keeper.go b/x/basket/keeper/keeper.go index d63e275c..e3c9a451 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 c0fd30c7..3e211f5d 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 } diff --git a/x/basket/types/expected_keepers.go b/x/basket/types/expected_keepers.go index 98ed046f..389d633b 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,10 @@ 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 + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo + GetAllTokenInfos(ctx sdk.Context) []tokenstypes.TokenInfo +} diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index 0823d5c9..d48173a5 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -131,7 +131,7 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { } tokenGenState := tokenstypes.GetGenesisStateFromAppState(clientCtx.Codec, genesis) - tokenGenState.TokenInfos = []*tokenstypes.TokenInfo{ + tokenGenState.TokenInfos = []tokenstypes.TokenInfo{ { Denom: defaultDenom, FeeRate: sdk.OneDec(), diff --git a/x/gov/types/permission.pb.go b/x/gov/types/permission.pb.go index d1c6d8f4..4b8a6311 100644 --- a/x/gov/types/permission.pb.go +++ b/x/gov/types/permission.pb.go @@ -37,8 +37,6 @@ 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 @@ -54,10 +52,6 @@ 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 @@ -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, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x99, 0xdb, 0x76, 0xd3, 0x46, - 0x17, 0xc7, 0x93, 0xef, 0xa3, 0x14, 0xa6, 0x14, 0x5c, 0x43, 0x43, 0x18, 0x88, 0x33, 0x39, 0x9f, - 0xc0, 0x86, 0x04, 0xd2, 0x52, 0x5a, 0xa8, 0x6c, 0x8f, 0x63, 0x13, 0xdb, 0xf2, 0x92, 0xe4, 0x18, - 0xd2, 0xb2, 0x5c, 0xe1, 0x0c, 0x8e, 0x6a, 0xc5, 0x72, 0x25, 0x85, 0x43, 0x1f, 0xa0, 0xab, 0x4b, - 0x57, 0x7d, 0x01, 0x5d, 0xf5, 0x65, 0x7a, 0xc9, 0x65, 0x2f, 0xbb, 0xe0, 0x45, 0xba, 0x24, 0xdb, - 0x1a, 0x8d, 0x2c, 0xd9, 0x4a, 0xaf, 0x38, 0xd8, 0xf3, 0xfb, 0xef, 0xbd, 0x67, 0xef, 0x99, 0xbd, - 0xc7, 0xe0, 0x46, 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 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, 0x23, 0x79, 0x0f, 0xcc, 0xfa, 0x23, 0x58, 0xe4, 0xaa, 0x7b, 0xb8, 0x29, - 0x3d, 0x6b, 0x16, 0x30, 0x4e, 0x7c, 0x0a, 0xaf, 0x5a, 0x36, 0xba, 0xe2, 0xc6, 0xef, 0x58, 0xee, - 0xb6, 0x89, 0xf4, 0xb6, 0x40, 0x48, 0xf2, 0x21, 0xb8, 0x15, 0xa5, 0x27, 0x70, 0x12, 0x4e, 0x5c, - 0x80, 0xd7, 0x2d, 0x1b, 0x5d, 0x0d, 0xc8, 0x09, 0xb2, 0x49, 0x92, 0x69, 0x30, 0x33, 0xba, 0x54, - 0xe0, 0xcb, 0x38, 0x71, 0x11, 0x26, 0x2d, 0x1b, 0x5d, 0xa6, 0x8b, 0x04, 0x4d, 0x25, 0xc9, 0x17, - 0x20, 0xe3, 0xb7, 0x4e, 0xc0, 0x9c, 0x84, 0x87, 0xcb, 0xf2, 0x9c, 0xc4, 0x35, 0x05, 0xbc, 0x57, - 0x12, 0x25,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, 0xad, 0xa1, 0x98, 0xc7, 0xda, 0xa9, 0x99, 0xd5, 0xba, 0x47, 0xe1, 0x6f, 0x6b, - 0xce, 0x1e, 0xe1, 0x67, 0x38, 0x57, 0x77, 0x87, 0x9f, 0x02, 0xf6, 0xbf, 0x22, 0xe5, 0x83, 0x6f, - 0x6b, 0x22, 0x31, 0xf1, 0x5b, 0xd2, 0x3a, 0x75, 0x86, 0x9f, 0x02, 0x21, 0x63, 0xdf, 0xd6, 0xc6, - 0x81, 0x31, 0xfb, 0xb6, 0x16, 0x85, 0x85, 0xe7, 0x7e, 0xff, 0x33, 0x35, 0x95, 0x7d, 0xf2, 0xd7, - 0x87, 0xd4, 0xf4, 0xfb, 0x0f, 0xa9, 0xe9, 0x7f, 0x3e, 0xa4, 0xa6, 0xff, 0xf8, 0x98, 0x9a, 0x7a, - 0xff, 0x31, 0x35, 0xf5, 0xf7, 0xc7, 0xd4, 0xd4, 0xe1, 0x4a, 0x5b, 0x31, 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, 0xe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 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,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, + 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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, 0xd1, + 0x1a, 0x9a, 0x79, 0x4c, 0x4f, 0xcd, 0x2c, 0xed, 0x1d, 0x05, 0x1e, 0xc1, 0x7c, 0x33, 0x16, 0x7e, + 0x86, 0x73, 0x75, 0x77, 0xf8, 0x29, 0x60, 0xff, 0x2b, 0x52, 0x9e, 0x3d, 0x82, 0x79, 0x03, 0x16, + 0x7e, 0x4b, 0x5a, 0xa7, 0xce, 0xf0, 0x53, 0x20, 0xbe, 0x17, 0xa4, 0x3a, 0x37, 0xb9, 0x7a, 0xd3, + 0x55, 0x14, 0x18, 0xb3, 0xf2, 0x1e, 0x8e, 0x56, 0xa1, 0x58, 0x78, 0xee, 0x97, 0xdf, 0x53, 0x33, + 0xd9, 0x27, 0x7f, 0x7c, 0x48, 0xcd, 0xbe, 0xff, 0x90, 0x9a, 0xfd, 0xeb, 0x43, 0x6a, 0xf6, 0xd7, + 0x8f, 0xa9, 0x99, 0xf7, 0x1f, 0x53, 0x33, 0x7f, 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/keeper/abci.go b/x/layer2/keeper/abci.go index ac5a7224..7bb67269 100644 --- a/x/layer2/keeper/abci.go +++ b/x/layer2/keeper/abci.go @@ -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) } diff --git a/x/layer2/keeper/keeper.go b/x/layer2/keeper/keeper.go index 93554110..582d3b00 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, diff --git a/x/layer2/keeper/msg_server.go b/x/layer2/keeper/msg_server.go index 036e26a6..a186cd6d 100644 --- a/x/layer2/keeper/msg_server.go +++ b/x/layer2/keeper/msg_server.go @@ -795,7 +795,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 } diff --git a/x/layer2/types/expected_keepers.go b/x/layer2/types/expected_keepers.go index bfba900d..960e8359 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,9 @@ 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 + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo +} diff --git a/x/multistaking/keeper/delegation.go b/x/multistaking/keeper/delegation.go index a9883ac7..4e41d268 100644 --- a/x/multistaking/keeper/delegation.go +++ b/x/multistaking/keeper/delegation.go @@ -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 } diff --git a/x/multistaking/types/expected_keepers.go b/x/multistaking/types/expected_keepers.go index f7bc5ab7..a517871d 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 { + 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 8fa2c209..de2b1b9c 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 9dc0d4b3..7d48a6b2 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 } diff --git a/x/recovery/types/expected_keepers.go b/x/recovery/types/expected_keepers.go index eb8b01d2..8929c685 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,9 @@ 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 + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo +} diff --git a/x/tokens/handler_test.go b/x/tokens/handler_test.go index 0fd4c89c..4df3a842 100644 --- a/x/tokens/handler_test.go +++ b/x/tokens/handler_test.go @@ -159,7 +159,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { ratesAll := app.TokensKeeper.GetAllTokenInfos(ctx) require.True(t, len(ratesAll) > 0) ratesByDenom := app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{theMsg.Denom}) - require.True(t, ratesByDenom[theMsg.Denom] != nil) + require.True(t, ratesByDenom[theMsg.Denom].Data != nil) } } } diff --git a/x/tokens/keeper/freeze.go b/x/tokens/keeper/freeze.go index 0e543413..4565d801 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 43e21ea2..95cf73e6 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 96c73aba..a1aa9220 100644 --- a/x/tokens/keeper/grpc_query.go +++ b/x/tokens/keeper/grpc_query.go @@ -17,23 +17,33 @@ func NewQuerier(keeper Keeper) types.QueryServer { var _ types.QueryServer = Querier{} -func (q Querier) GetTokenInfo(ctx context.Context, request *types.TokenInfoRequest) (*types.TokenInfoResponse, error) { - rate := q.keeper.GetTokenInfo(sdk.UnwrapSDKContext(ctx), request.Denom) - - if rate == nil { - return &types.TokenInfoResponse{Data: nil}, nil - } - return &types.TokenInfoResponse{Data: rate}, nil +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) GetTokenInfosByDenom(ctx context.Context, request *types.TokenInfosByDenomRequest) (*types.TokenInfosByDenomResponse, error) { - rates := q.keeper.GetTokenInfosByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) - return &types.TokenInfosByDenomResponse{Data: rates}, nil + infos := q.keeper.GetTokenInfosByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) + return &types.TokenInfosByDenomResponse{Data: infos}, nil } -func (q Querier) GetAllTokenInfos(ctx context.Context, request *types.AllTokenInfosRequest) (*types.AllTokenInfosResponse, error) { - rates := q.keeper.GetAllTokenInfos(sdk.UnwrapSDKContext(ctx)) - return &types.AllTokenInfosResponse{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 3719de29..fbdec308 100644 --- a/x/tokens/keeper/grpc_query_test.go +++ b/x/tokens/keeper/grpc_query_test.go @@ -39,9 +39,9 @@ func TestQuerier_GetTokenInfosByDenom(t *testing.T) { ) 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.FeePayments) } func TestQuerier_GetAllTokenInfos(t *testing.T) { @@ -56,9 +56,9 @@ func TestQuerier_GetAllTokenInfos(t *testing.T) { ) 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.FeePayments) } func TestQuerier_GetTokenBlackWhites(t *testing.T) { diff --git a/x/tokens/keeper/mint.go b/x/tokens/keeper/mint.go new file mode 100644 index 00000000..85cefb45 --- /dev/null +++ b/x/tokens/keeper/mint.go @@ -0,0 +1,29 @@ +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 { + k.UpsertTokenInfo(ctx, types.TokenInfo{ + Denom: coin.Denom, + FeeRate: math.LegacyZeroDec(), + FeePayments: false, + StakeCap: math.LegacyZeroDec(), + StakeMin: math.OneInt(), + StakeToken: false, + Invalidated: false, + Symbol: coin.Denom, + Name: coin.Denom, + Icon: "", + Decimals: 6, + }) + } + } + return k.bankKeeper.MintCoins(ctx, moduleName, amt) +} diff --git a/x/tokens/keeper/msg_server.go b/x/tokens/keeper/msg_server.go index 48a85728..022b136a 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -42,7 +42,7 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) } - err = k.keeper.UpsertTokenInfo(ctx, *types.NewTokenInfo( + err = k.keeper.UpsertTokenInfo(ctx, types.NewTokenInfo( msg.Denom, msg.Rate, msg.FeePayments, diff --git a/x/tokens/keeper/token_info.go b/x/tokens/keeper/token_info.go index cfb6d432..4e0badf4 100644 --- a/x/tokens/keeper/token_info.go +++ b/x/tokens/keeper/token_info.go @@ -3,7 +3,6 @@ package keeper import ( "errors" "fmt" - "strings" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" @@ -26,8 +25,8 @@ func (k Keeper) GetTokenInfo(ctx sdk.Context, denom string) *types.TokenInfo { } // GetAllTokenInfos returns all list of token rate -func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []*types.TokenInfo { - var tokenRates []*types.TokenInfo +func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []types.TokenInfo { + var tokenRates []types.TokenInfo // get iterator for token rates store := ctx.KVStore(k.storeKey) @@ -35,27 +34,23 @@ func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []*types.TokenInfo { defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - denom := strings.TrimPrefix(string(iterator.Key()), string(PrefixKeyTokenInfo)) - tokenRate := k.GetTokenInfo(ctx, denom) - if tokenRate != nil { - tokenRates = append(tokenRates, tokenRate) - } + info := types.TokenInfo{} + k.cdc.MustUnmarshal(iterator.Value(), &info) + tokenRates = append(tokenRates, info) } return tokenRates } // GetTokenInfosByDenom returns all list of token rate -func (k Keeper) GetTokenInfosByDenom(ctx sdk.Context, denoms []string) map[string]*types.TokenInfo { - // get iterator for token aliases - store := ctx.KVStore(k.storeKey) - tokenRatesMap := make(map[string]*types.TokenInfo) +func (k Keeper) GetTokenInfosByDenom(ctx sdk.Context, denoms []string) map[string]types.TokenInfoResponse { + tokenRatesMap := make(map[string]types.TokenInfoResponse) for _, denom := range denoms { - denomTokenStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) - - if store.Has(denomTokenStoreID) { - tokenRate := k.GetTokenInfo(ctx, denom) - tokenRatesMap[denom] = tokenRate + tokenRate := k.GetTokenInfo(ctx, denom) + supply := k.bankKeeper.GetSupply(ctx, denom) + tokenRatesMap[denom] = types.TokenInfoResponse{ + Data: tokenRate, + Supply: supply, } } return tokenRatesMap diff --git a/x/tokens/keeper/token_info_test.go b/x/tokens/keeper/token_info_test.go index a95b0bf1..321e6925 100644 --- a/x/tokens/keeper/token_info_test.go +++ b/x/tokens/keeper/token_info_test.go @@ -15,8 +15,8 @@ func (suite *KeeperTestSuite) TestTokenInfos() { rates := suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 4) rateMap := suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(rateMap), 0) - suite.Require().Nil(rateMap["stake"]) + suite.Require().Equal(len(rateMap), 1) + suite.Require().Nil(rateMap["stake"].Data) // upsert token rate and check newRate := types.TokenInfo{ @@ -40,6 +40,6 @@ func (suite *KeeperTestSuite) TestTokenInfos() { rates = suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 4) rateMap = suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(rateMap), 0) - suite.Require().Nil(rateMap["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 9d3d84af..8120e588 100644 --- a/x/tokens/module.go +++ b/x/tokens/module.go @@ -96,7 +96,7 @@ func (am AppModule) InitGenesis( cdc.MustUnmarshalJSON(data, &genesisState) for _, rate := range genesisState.TokenInfos { - am.tokensKeeper.UpsertTokenInfo(ctx, *rate) + am.tokensKeeper.UpsertTokenInfo(ctx, rate) } am.tokensKeeper.SetTokenBlackWhites(ctx, genesisState.TokenBlackWhites) diff --git a/x/tokens/proposal_handler.go b/x/tokens/proposal_handler.go index 3a78550a..ba364139 100644 --- a/x/tokens/proposal_handler.go +++ b/x/tokens/proposal_handler.go @@ -27,7 +27,7 @@ func (a ApplyUpsertTokenInfosProposalHandler) Apply(ctx sdk.Context, proposalID p.Denom, p.Rate, p.FeePayments, p.StakeCap, p.StakeMin, p.StakeToken, p.Invalidated, p.Symbol, p.Name, p.Icon, p.Decimals, ) - return a.keeper.UpsertTokenInfo(ctx, *rate) + return a.keeper.UpsertTokenInfo(ctx, rate) } type ApplyWhiteBlackChangeProposalHandler struct { diff --git a/x/tokens/types/expected_keepers.go b/x/tokens/types/expected_keepers.go index 760cbe04..8e122980 100644 --- a/x/tokens/types/expected_keepers.go +++ b/x/tokens/types/expected_keepers.go @@ -12,6 +12,8 @@ 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 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 9c40adda..0fefe2ef 100644 --- a/x/tokens/types/genesis.go +++ b/x/tokens/types/genesis.go @@ -10,13 +10,13 @@ import ( // DefaultGenesis returns the default CustomGo genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - TokenInfos: []*TokenInfo{ + TokenInfos: []TokenInfo{ NewTokenInfo("ukex", sdk.NewDec(1), true, sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false, "KEX", "KEX", "", 6), // 1 NewTokenInfo("ubtc", sdk.NewDec(10), true, sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false, "BTC", "Bitcoin", "", 9), // 10 NewTokenInfo("xeth", sdk.NewDecWithPrec(1, 1), true, sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false, "ETH", "Ethereum", "", 18), // 0.1 NewTokenInfo("frozen", sdk.NewDecWithPrec(1, 1), true, sdk.ZeroDec(), sdk.OneInt(), false, false, "FROZEN", "FROZEN", "", 6), // 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 e34fbedc..8145be4e 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,8 +24,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { - TokenInfos []*TokenInfo `protobuf:"bytes,1,rep,name=tokenInfos,proto3" json:"tokenInfos,omitempty"` - TokenBlackWhites *TokensWhiteBlack `protobuf:"bytes,2,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{} } @@ -60,18 +61,18 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetTokenInfos() []*TokenInfo { +func (m *GenesisState) GetTokenInfos() []TokenInfo { if m != nil { return m.TokenInfos } return nil } -func (m *GenesisState) GetTokenBlackWhites() *TokensWhiteBlack { +func (m *GenesisState) GetTokenBlackWhites() TokensWhiteBlack { if m != nil { return m.TokenBlackWhites } - return nil + return TokensWhiteBlack{} } func init() { @@ -81,21 +82,23 @@ func init() { func init() { proto.RegisterFile("kira/tokens/genesis.proto", fileDescriptor_d3cbd9121e22d5d1) } var fileDescriptor_d3cbd9121e22d5d1 = []byte{ - // 223 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, - 0x81, 0x29, 0x88, 0x2a, 0x29, 0x09, 0x64, 0x89, 0xb4, 0xa2, 0xd4, 0xd4, 0xaa, 0x54, 0x88, 0x8c, - 0xd2, 0x44, 0x46, 0x2e, 0x1e, 0x77, 0x88, 0x89, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, 0x66, 0x5c, - 0x5c, 0x60, 0x75, 0x9e, 0x79, 0x69, 0xf9, 0xc5, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x62, - 0x7a, 0x48, 0xb6, 0xe8, 0x85, 0xc0, 0xa4, 0x83, 0x90, 0x54, 0x0a, 0x79, 0x72, 0x09, 0x80, 0x79, - 0x4e, 0x39, 0x89, 0xc9, 0xd9, 0xe1, 0x19, 0x99, 0x25, 0xa9, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, - 0xdc, 0x46, 0xb2, 0x98, 0xba, 0x8b, 0xc1, 0x0a, 0xc0, 0x4a, 0x83, 0x30, 0xb4, 0x39, 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, 0xdc, 0xdf, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xef, - 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x08, 0x3c, 0x1f, 0x3b, 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) { @@ -118,18 +121,16 @@ 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)) + { + size, err := m.TokenBlackWhites.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 if len(m.TokenInfos) > 0 { for iNdEx := len(m.TokenInfos) - 1; iNdEx >= 0; iNdEx-- { { @@ -170,10 +171,8 @@ func (m *GenesisState) Size() (n int) { 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 } @@ -241,7 +240,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TokenInfos = append(m.TokenInfos, &TokenInfo{}) + m.TokenInfos = append(m.TokenInfos, TokenInfo{}) if err := m.TokenInfos[len(m.TokenInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -275,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/query.pb.go b/x/tokens/types/query.pb.go index 9d48a34f..54c3253d 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" @@ -74,7 +75,8 @@ func (m *TokenInfoRequest) GetDenom() string { } type TokenInfoResponse struct { - Data *TokenInfo `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + 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 *TokenInfoResponse) Reset() { *m = TokenInfoResponse{} } @@ -117,6 +119,13 @@ func (m *TokenInfoResponse) GetData() *TokenInfo { return nil } +func (m *TokenInfoResponse) GetSupply() types.Coin { + if m != nil { + return m.Supply + } + return types.Coin{} +} + type AllTokenInfosRequest struct { } @@ -154,7 +163,7 @@ func (m *AllTokenInfosRequest) XXX_DiscardUnknown() { var xxx_messageInfo_AllTokenInfosRequest proto.InternalMessageInfo type AllTokenInfosResponse struct { - Data []*TokenInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` + Data []TokenInfoResponse `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` } func (m *AllTokenInfosResponse) Reset() { *m = AllTokenInfosResponse{} } @@ -190,7 +199,7 @@ func (m *AllTokenInfosResponse) XXX_DiscardUnknown() { var xxx_messageInfo_AllTokenInfosResponse proto.InternalMessageInfo -func (m *AllTokenInfosResponse) GetData() []*TokenInfo { +func (m *AllTokenInfosResponse) GetData() []TokenInfoResponse { if m != nil { return m.Data } @@ -242,7 +251,7 @@ func (m *TokenInfosByDenomRequest) GetDenoms() []string { } type TokenInfosByDenomResponse struct { - Data map[string]*TokenInfo `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"` + 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 *TokenInfosByDenomResponse) Reset() { *m = TokenInfosByDenomResponse{} } @@ -278,7 +287,7 @@ func (m *TokenInfosByDenomResponse) XXX_DiscardUnknown() { var xxx_messageInfo_TokenInfosByDenomResponse proto.InternalMessageInfo -func (m *TokenInfosByDenomResponse) GetData() map[string]*TokenInfo { +func (m *TokenInfosByDenomResponse) GetData() map[string]TokenInfoResponse { if m != nil { return m.Data } @@ -322,7 +331,7 @@ 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{} } @@ -358,11 +367,11 @@ 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() { @@ -372,7 +381,7 @@ func init() { 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]*TokenInfo)(nil), "kira.tokens.TokenInfosByDenomResponse.DataEntry") + proto.RegisterMapType((map[string]TokenInfoResponse)(nil), "kira.tokens.TokenInfosByDenomResponse.DataEntry") proto.RegisterType((*TokenBlackWhitesRequest)(nil), "kira.tokens.TokenBlackWhitesRequest") proto.RegisterType((*TokenBlackWhitesResponse)(nil), "kira.tokens.TokenBlackWhitesResponse") } @@ -380,41 +389,45 @@ func init() { func init() { proto.RegisterFile("kira/tokens/query.proto", fileDescriptor_c8db6e46fba94960) } var fileDescriptor_c8db6e46fba94960 = []byte{ - // 544 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x8d, 0x13, 0x52, 0x29, 0x53, 0x0e, 0xe9, 0x36, 0xa4, 0x89, 0x4b, 0x2c, 0x6a, 0x28, 0x8a, - 0x10, 0xb2, 0x21, 0x5c, 0x10, 0x17, 0x44, 0x1a, 0x54, 0x21, 0x84, 0x10, 0x11, 0x12, 0x12, 0x97, - 0x68, 0xd3, 0x6e, 0x1d, 0xcb, 0xae, 0x37, 0xf5, 0xae, 0x01, 0x73, 0x44, 0xe2, 0xc2, 0x09, 0x89, - 0x3f, 0xe1, 0x2b, 0x38, 0x56, 0xe2, 0xc2, 0x11, 0x25, 0xfc, 0x06, 0x12, 0xf2, 0xee, 0xc6, 0xb5, - 0xeb, 0xb4, 0xe1, 0xe4, 0xf5, 0xcc, 0xdb, 0x79, 0x6f, 0x66, 0x9e, 0x16, 0xb6, 0x3c, 0x37, 0xc4, - 0x36, 0xa7, 0x1e, 0x09, 0x98, 0x7d, 0x12, 0x91, 0x30, 0xb6, 0xa6, 0x21, 0xe5, 0x14, 0xad, 0x27, - 0x09, 0x4b, 0x26, 0xf4, 0x1c, 0x4a, 0x7c, 0x24, 0x4a, 0x6f, 0x65, 0x13, 0x47, 0x21, 0x21, 0x1f, - 0x89, 0xca, 0x34, 0x1c, 0xea, 0x50, 0x71, 0xb4, 0x93, 0x93, 0x8a, 0x5e, 0x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 0x3d, 0xb6, 0x9f, 0xbb, 0x21, 0xde, 0xa3, - 0x21, 0xb1, 0x19, 0xf1, 0xb0, 0x6b, 0x7f, 0x48, 0x9f, 0xac, 0x78, 0x4a, 0xd8, 0x78, 0x4d, 0xbc, - 0x32, 0x0f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x81, 0x7d, 0x12, 0xf4, 0x04, 0x00, 0x00, + // 607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0xe3, 0xa4, 0x89, 0x94, 0x0b, 0x43, 0x7a, 0x0d, 0x69, 0xe2, 0x12, 0x43, 0x0d, 0x45, + 0x11, 0x83, 0x8f, 0x06, 0xa4, 0x56, 0x6c, 0xa4, 0x45, 0x15, 0x30, 0x35, 0x20, 0x55, 0x62, 0x89, + 0xce, 0xe9, 0x35, 0xb1, 0xe2, 0xf8, 0x5c, 0xdf, 0xb9, 0xd4, 0x8c, 0x48, 0x2c, 0x4c, 0x48, 0x7c, + 0x21, 0xc6, 0x8e, 0x95, 0x58, 0x98, 0x10, 0x4a, 0xf8, 0x1a, 0x48, 0xc8, 0xe7, 0x8b, 0x6b, 0xd7, + 0x29, 0x61, 0xca, 0xc5, 0xef, 0xff, 0xde, 0xff, 0xf7, 0xde, 0x3d, 0x1b, 0xac, 0x8f, 0x2d, 0x0f, + 0x23, 0x4e, 0xc7, 0xc4, 0x61, 0xe8, 0xd4, 0x27, 0x5e, 0x60, 0xb8, 0x1e, 0xe5, 0x14, 0x56, 0xc2, + 0x80, 0x11, 0x05, 0xd4, 0x94, 0x4a, 0xfc, 0x44, 0x2a, 0xb5, 0x91, 0x0c, 0x9c, 0x78, 0x84, 0x7c, + 0x20, 0x32, 0x52, 0x1b, 0xd2, 0x21, 0x15, 0x47, 0x14, 0x9e, 0xe4, 0xd3, 0x3b,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, 0x92, 0x64, 0x79, 0x95, 0x62, 0x79, 0xbc, 0x98, 0xe5, 0x7a, 0x96, 0xb1, 0x8f, + 0x39, 0x7e, 0xe1, 0x70, 0x2f, 0x48, 0xd2, 0xa9, 0x47, 0xa0, 0x1c, 0x07, 0x60, 0x15, 0x14, 0xc6, + 0x24, 0x90, 0x77, 0x14, 0x1e, 0xe1, 0x53, 0x50, 0x3c, 0xc3, 0xb6, 0x4f, 0xe4, 0x7c, 0x97, 0xf4, + 0xdd, 0x8b, 0xc4, 0xcf, 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. @@ -659,6 +672,16 @@ func (m *TokenInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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]) @@ -790,18 +813,16 @@ func (m *TokenInfosByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro 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)) + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + 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))) @@ -858,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 } @@ -907,6 +926,8 @@ func (m *TokenInfoResponse) 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 } @@ -959,12 +980,8 @@ func (m *TokenInfosByDenomResponse) 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)) } } @@ -986,10 +1003,8 @@ func (m *TokenBlackWhitesResponse) Size() (n int) { } var l int _ = l - if m.Data != nil { - l = m.Data.Size() - n += 1 + l + sovQuery(uint64(l)) - } + l = m.Data.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -1146,6 +1161,39 @@ func (m *TokenInfoResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", 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 err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1275,7 +1323,7 @@ func (m *AllTokenInfosResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append(m.Data, &TokenInfo{}) + m.Data = append(m.Data, TokenInfoResponse{}) if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1442,10 +1490,10 @@ func (m *TokenInfosByDenomResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Data == nil { - m.Data = make(map[string]*TokenInfo) + m.Data = make(map[string]TokenInfoResponse) } var mapkey string - var mapvalue *TokenInfo + mapvalue := &TokenInfoResponse{} for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -1519,7 +1567,7 @@ func (m *TokenInfosByDenomResponse) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &TokenInfo{} + mapvalue = &TokenInfoResponse{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -1539,7 +1587,7 @@ func (m *TokenInfosByDenomResponse) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.Data[mapkey] = mapvalue + m.Data[mapkey] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -1670,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/types.go b/x/tokens/types/types.go index 4a588e83..e17e3c19 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -17,8 +17,8 @@ func NewTokenInfo( name string, icon string, decimals uint32, -) *TokenInfo { - return &TokenInfo{ +) TokenInfo { + return TokenInfo{ Denom: denom, FeeRate: feeRate, FeePayments: feePayments, diff --git a/x/ubi/keeper/keeper.go b/x/ubi/keeper/keeper.go index 4edcc72d..538e35bd 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 2740358d..44f7ddf6 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 e2ef22d4..191d7953 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 +} From c4133e8dcaaa2e3424c509369d2f4644673d6e7f Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 6 Jun 2024 21:45:25 +0800 Subject: [PATCH 07/14] add EnableBondVerifiers in dapp and txs and add checkers --- proto/kira/layer2/layer2.proto | 1 + x/layer2/client/cli/tx.go | 107 +++++----- x/layer2/keeper/msg_server.go | 4 + x/layer2/proposal_handler.go | 4 + x/layer2/types/errors.go | 2 + x/layer2/types/layer2.pb.go | 375 +++++++++++++++++++-------------- 6 files changed, 282 insertions(+), 211 deletions(-) diff --git a/proto/kira/layer2/layer2.proto b/proto/kira/layer2/layer2.proto index 1dc47d2f..53d6cd3d 100644 --- a/proto/kira/layer2/layer2.proto +++ b/proto/kira/layer2/layer2.proto @@ -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/x/layer2/client/cli/tx.go b/x/layer2/client/cli/tx.go index 03ec5fd1..7a6b4e0d 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" - 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" + 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. @@ -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, - 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, + 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, }, } @@ -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 } @@ -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, - 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, + 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, }, }, ) @@ -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) diff --git a/x/layer2/keeper/msg_server.go b/x/layer2/keeper/msg_server.go index a186cd6d..fcf74dcc 100644 --- a/x/layer2/keeper/msg_server.go +++ b/x/layer2/keeper/msg_server.go @@ -141,6 +141,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 diff --git a/x/layer2/proposal_handler.go b/x/layer2/proposal_handler.go index fe71efa8..38875267 100644 --- a/x/layer2/proposal_handler.go +++ b/x/layer2/proposal_handler.go @@ -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 60dd25d0..8e324ae2 100644 --- a/x/layer2/types/errors.go +++ b/x/layer2/types/errors.go @@ -42,4 +42,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/layer2.pb.go b/x/layer2/types/layer2.pb.go index defa3221..764835d9 100644 --- a/x/layer2/types/layer2.pb.go +++ b/x/layer2/types/layer2.pb.go @@ -419,32 +419,33 @@ func (m *IssuanceConfig) 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"` - 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"` + 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{} } @@ -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"` @@ -1657,144 +1665,145 @@ func init() { func init() { proto.RegisterFile("kira/layer2/layer2.proto", fileDescriptor_4070283bbe72a11a) } var fileDescriptor_4070283bbe72a11a = []byte{ - // 2179 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, 0x7b, 0xcc, 0x4d, 0x64, 0x86, 0xc9, - 0xae, 0x65, 0x6f, 0x22, 0x06, 0x36, 0x10, 0x20, 0xfb, 0x40, 0x42, 0x49, 0xf4, 0x8a, 0x8e, 0xf5, - 0xc8, 0x48, 0x0a, 0x84, 0x5c, 0x88, 0xe6, 0x4c, 0x8b, 0x6a, 0x68, 0x66, 0x7a, 0xd4, 0x3d, 0x94, - 0xa9, 0x4b, 0x0e, 0x79, 0x00, 0x89, 0x72, 0xc9, 0x39, 0x80, 0x4e, 0xb9, 0xe4, 0x77, 0xe4, 0x10, - 0xec, 0x25, 0xc0, 0x1e, 0x72, 0x08, 0x72, 0x58, 0x04, 0xf6, 0x25, 0x8f, 0x43, 0xfe, 0x42, 0x50, - 0xd5, 0x3d, 0xc3, 0x47, 0x94, 0xd8, 0xeb, 0x13, 0xbb, 0xab, 0xbf, 0xaf, 0xba, 0xaa, 0xab, 0xba, - 0xa6, 0x9a, 0xc4, 0x3d, 0x13, 0x8a, 0x35, 0x42, 0x76, 0xc9, 0xd5, 0x63, 0xfb, 0xb3, 0x9e, 0x28, - 0x99, 0x4a, 0x5a, 0x86, 0x95, 0x75, 0x23, 0xaa, 0xde, 0xeb, 0x49, 0xd9, 0x0b, 0x79, 0x03, 0x97, - 0xba, 0xfd, 0x93, 0x06, 0x8b, 0x2f, 0x0d, 0xae, 0xba, 0xd2, 0x93, 0x3d, 0x89, 0xc3, 0x06, 0x8c, - 0xac, 0xf4, 0xfe, 0x24, 0x21, 0x15, 0x11, 0xd7, 0x29, 0x8b, 0x12, 0x03, 0xa8, 0x6f, 0x90, 0x85, - 0xa6, 0xef, 0xcb, 0x7e, 0x9c, 0x7a, 0x2c, 0xee, 0x71, 0xfa, 0x15, 0x32, 0xcf, 0x82, 0x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xa4, 0xa7, 0xfd, 0xee, 0xba, 0x2f, 0xa3, 0x86, 0x2f, 0x75, 0x24, 0xb5, - 0xfd, 0xf9, 0x96, 0x0e, 0xce, 0x1a, 0xa0, 0x4a, 0xaf, 0x6f, 0x71, 0xdf, 0x33, 0x64, 0xea, 0x92, - 0xb9, 0x80, 0x27, 0x52, 0x8b, 0xd4, 0xda, 0x9d, 0x4d, 0xc1, 0x88, 0x40, 0x89, 0x04, 0x0d, 0x2f, - 0x7a, 0x38, 0xae, 0xff, 0xd9, 0x21, 0x4b, 0x6d, 0xad, 0xfb, 0x2c, 0xf6, 0xb9, 0x35, 0x63, 0x44, - 0x81, 0x33, 0xae, 0x60, 0x9b, 0xcc, 0x25, 0x8a, 0x47, 0x22, 0xb6, 0xaa, 0xbf, 0x94, 0x89, 0xed, - 0x38, 0xf5, 0x32, 0x3a, 0x7d, 0x46, 0x4a, 0x89, 0xd4, 0x29, 0xaa, 0x2a, 0xbc, 0x95, 0xaa, 0x9c, - 0x8f, 0x67, 0x2b, 0x22, 0x73, 0xe8, 0x45, 0x0f, 0xc7, 0xf5, 0x3f, 0x95, 0x48, 0x71, 0x8b, 0x25, - 0xc9, 0x8d, 0x61, 0x5d, 0x21, 0x33, 0x01, 0x8f, 0x65, 0x64, 0xcf, 0xc7, 0x4c, 0x68, 0x8d, 0x94, - 0x03, 0xae, 0x7d, 0x25, 0x92, 0x54, 0xc8, 0xd8, 0x46, 0x77, 0x54, 0x04, 0x07, 0xf3, 0x82, 0x77, - 0xb5, 0x48, 0xb3, 0x00, 0x67, 0x53, 0xd8, 0x25, 0x94, 0x3d, 0x99, 0x85, 0x17, 0xc6, 0x26, 0x51, - 0x7c, 0xc1, 0x42, 0x77, 0x36, 0x4b, 0x14, 0x98, 0x61, 0x14, 0xa4, 0xaf, 0xdd, 0x39, 0x83, 0x85, - 0x31, 0xfd, 0x3e, 0x29, 0xfb, 0xc3, 0x7b, 0xe1, 0x96, 0x30, 0x97, 0xdd, 0xb1, 0x5c, 0x1e, 0xb9, - 0x37, 0x36, 0x95, 0x47, 0x29, 0xb4, 0x41, 0x0a, 0x5d, 0x11, 0xbb, 0xf3, 0xb5, 0xc2, 0x5a, 0xf9, - 0xf1, 0xdd, 0x31, 0xe6, 0x30, 0xc9, 0x2d, 0x11, 0x90, 0xf4, 0x09, 0x29, 0x26, 0x52, 0x86, 0x2e, - 0xb9, 0xe1, 0xde, 0x8c, 0x66, 0xa5, 0xe5, 0x20, 0x98, 0x7e, 0x42, 0x4a, 0xc2, 0x26, 0x8b, 0x5b, - 0x46, 0xe2, 0xbb, 0x63, 0xc4, 0xf1, 0x4c, 0xb2, 0xd4, 0x9c, 0x42, 0xdf, 0x27, 0xcb, 0xfd, 0x24, - 0x60, 0x29, 0xef, 0x40, 0x90, 0x3a, 0x11, 0x1b, 0xb8, 0x0b, 0x18, 0xb4, 0x45, 0x23, 0x3e, 0x14, - 0x11, 0xdf, 0x61, 0x03, 0xfa, 0x75, 0xb2, 0xc8, 0x07, 0xdc, 0xef, 0xa7, 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, 0xd3, 0xb1, 0x61, 0xd3, 0xf1, 0xc1, - 0x1b, 0xa4, 0xe3, 0xa6, 0x14, 0xb1, 0x37, 0x8f, 0x2a, 0x36, 0x64, 0x1c, 0xc0, 0xa6, 0xbe, 0xe2, - 0x70, 0x19, 0x63, 0x74, 0xd4, 0xbd, 0x65, 0x36, 0xcd, 0x84, 0xe0, 0x26, 0x6d, 0x90, 0x59, 0x9d, - 0xb2, 0xb4, 0xaf, 0x5d, 0x5a, 0x73, 0xd6, 0x96, 0x26, 0x62, 0x06, 0xb9, 0x7b, 0x80, 0xcb, 0x9e, - 0x85, 0xd1, 0x3d, 0x52, 0xbe, 0x90, 0x29, 0xef, 0x9c, 0xf7, 0xa5, 0xea, 0x47, 0xee, 0xed, 0xb7, - 0xaa, 0x11, 0x04, 0x54, 0xfc, 0x10, 0x35, 0xd0, 0xfb, 0x56, 0x61, 0xc2, 0x95, 0x90, 0x81, 0xbb, - 0x82, 0x46, 0x22, 0x60, 0x1f, 0x25, 0xf4, 0x3d, 0xb2, 0x84, 0x00, 0x1e, 0x33, 0x3f, 0x8d, 0x78, - 0x9c, 0xba, 0xef, 0x98, 0x68, 0x81, 0xb4, 0x95, 0x09, 0xe9, 0x07, 0xe4, 0x56, 0x28, 0xce, 0xfb, - 0x22, 0x30, 0x1e, 0xeb, 0x94, 0xa9, 0xd4, 0xbd, 0x83, 0xc8, 0xca, 0xc8, 0xc2, 0x01, 0xc8, 0x69, - 0x1b, 0x2e, 0xbe, 0x0c, 0x3b, 0x27, 0x9c, 0xbb, 0x77, 0xdf, 0xca, 0x85, 0x39, 0xe0, 0x3f, 0xe5, - 0x9c, 0x7e, 0x8d, 0x2c, 0xa4, 0x9c, 0x45, 0x1d, 0xc5, 0x35, 0x57, 0x17, 0xdc, 0x75, 0xcd, 0x8d, - 0x05, 0x99, 0x67, 0x44, 0x00, 0xb1, 0x15, 0xc7, 0x04, 0xe2, 0x1e, 0x5a, 0x55, 0xb6, 0x32, 0x8c, - 0xc3, 0x37, 0xc8, 0x12, 0x54, 0x92, 0x0e, 0x82, 0x12, 0x26, 0x02, 0xb7, 0x5a, 0x73, 0xd6, 0x4a, - 0xde, 0x02, 0x48, 0x77, 0x44, 0x9c, 0xee, 0x33, 0x11, 0xd4, 0x7f, 0xee, 0x90, 0x85, 0x23, 0xcd, - 0x15, 0xc4, 0x05, 0x63, 0x4c, 0x49, 0xb1, 0xaf, 0xb9, 0xca, 0xea, 0x0a, 0x8c, 0xe9, 0xb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4, 0x89, 0x5a, 0xea, 0xbf, 0x72, 0xc8, 0x1d, 0x08, 0xe4, 0x73, - 0xce, 0x02, 0xae, 0xb6, 0x78, 0x2c, 0xfb, 0xb1, 0xcf, 0xf1, 0x3a, 0xfd, 0xdf, 0x90, 0xde, 0x21, - 0xb3, 0x21, 0x52, 0x6c, 0x40, 0xed, 0x0c, 0x4f, 0x8d, 0xc7, 0x20, 0xcf, 0xba, 0x12, 0x9c, 0xd1, - 0x3a, 0x59, 0x08, 0x46, 0x94, 0xdb, 0xef, 0xd6, 0x98, 0xac, 0xfe, 0x2f, 0x87, 0x94, 0xb1, 0xde, - 0x18, 0xb7, 0x47, 0xf6, 0x70, 0xc6, 0xf6, 0x58, 0x21, 0x33, 0xe6, 0x6e, 0x4f, 0xe3, 0x2d, 0x32, - 0x13, 0xa8, 0x22, 0x26, 0x9a, 0x1d, 0x6c, 0x95, 0xcc, 0xf6, 0xc4, 0x88, 0xb6, 0xa1, 0x61, 0x7a, - 0x9c, 0x67, 0x46, 0x11, 0x33, 0xa3, 0x3a, 0x96, 0x19, 0x76, 0xd3, 0x89, 0xc4, 0x70, 0xc9, 0x5c, - 0x8f, 0xa5, 0xfc, 0x05, 0xbb, 0xb4, 0x69, 0x96, 0x4d, 0xe9, 0xf7, 0x48, 0x45, 0xc6, 0xfe, 0x29, - 0x13, 0x71, 0x27, 0xe2, 0x5a, 0xb3, 0x1e, 0x87, 0x8c, 0x83, 0x8f, 0xde, 0xca, 0xba, 0x69, 0x61, - 0xd7, 0xb3, 0x16, 0x76, 0xbd, 0x19, 0x5f, 0x7a, 0xcb, 0x16, 0xbd, 0x63, 0xc1, 0x75, 0x49, 0x6e, - 0x8f, 0x38, 0xdb, 0x4c, 0x12, 0x25, 0x2f, 0x58, 0xf8, 0xda, 0x8b, 0xc4, 0x10, 0x98, 0x9f, 0x7b, - 0x3e, 0x07, 0xff, 0x85, 0xee, 0xd8, 0x69, 0x60, 0xef, 0x12, 0x11, 0xba, 0x69, 0x25,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5c, 0x0f, 0x60, 0x55, 0xc6, 0x58, 0xc7, 0xcd, 0x9d, 0xac, 0x01, - 0x03, 0x4c, 0xfd, 0x17, 0x0e, 0x59, 0x34, 0x9a, 0x36, 0x58, 0x88, 0x95, 0xef, 0x9b, 0x84, 0x76, - 0x51, 0x60, 0x0e, 0xa9, 0x23, 0xe2, 0x80, 0x0f, 0xec, 0x19, 0x57, 0xba, 0xc3, 0x4d, 0xdb, 0x20, - 0xa7, 0x4f, 0xc9, 0xac, 0xad, 0x63, 0x6f, 0xd7, 0xc0, 0x5b, 0x76, 0xfd, 0xb7, 0xb9, 0x1d, 0xf6, - 0x34, 0xa0, 0x3a, 0x8c, 0x6e, 0x6d, 0x26, 0x70, 0x91, 0xed, 0xa3, 0x30, 0x7b, 0x8c, 0xd8, 0xe9, - 0x78, 0xfe, 0x17, 0x26, 0xf2, 0xff, 0x63, 0x52, 0xea, 0x1a, 0xff, 0xb2, 0x63, 0xb9, 0x29, 0x10, - 0xf6, 0x08, 0xb2, 0x40, 0x64, 0x8c, 0xfa, 0x77, 0x49, 0x79, 0xe4, 0xb4, 0xff, 0x87, 0x65, 0x37, - 0x3e, 0x02, 0xea, 0xff, 0x74, 0x08, 0x39, 0x6e, 0xee, 0x78, 0xfc, 0xbc, 0xcf, 0x75, 0x4a, 0x3f, - 0x24, 0x73, 0xc6, 0x61, 0xf3, 0xc4, 0x7d, 0x13, 0x33, 0x32, 0x02, 0x16, 0x46, 0x7c, 0x1a, 0x76, - 0xc0, 0x2d, 0x9b, 0xd9, 0xc4, 0x88, 0xf0, 0x69, 0xf2, 0x1e, 0x59, 0xb2, 0x00, 0x9b, 0x42, 0x36, - 0xc1, 0x17, 0x8d, 0x34, 0x3b, 0x58, 0x38, 0x28, 0xae, 0x53, 0xa3, 0xc5, 0xbc, 0x71, 0x4a, 0x20, - 0x40, 0x1d, 0x0f, 0x49, 0x05, 0x17, 0xbb, 0x3c, 0xe6, 0x27, 0xc2, 0x17, 0x4c, 0x99, 0x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0xc0, 0x7b, 0xbb, 0x9f, 0xee, 0x81, - 0x23, 0xd3, 0xc6, 0x3c, 0x0b, 0xdd, 0x8b, 0x7b, 0x12, 0xfc, 0x78, 0x48, 0x2a, 0x19, 0xb0, 0xb9, - 0xb9, 0xd9, 0xda, 0x37, 0xc1, 0x42, 0x97, 0xb3, 0x8e, 0xc1, 0xf7, 0x79, 0x92, 0x8e, 0x1b, 0xb0, - 0xd5, 0xda, 0xdd, 0x3b, 0xda, 0xdd, 0x44, 0xa7, 0x47, 0x0d, 0xc8, 0xfa, 0x3a, 0x7c, 0x4a, 0x65, - 0x60, 0x9b, 0x02, 0x33, 0xd5, 0x5b, 0x57, 0xd7, 0xb5, 0xec, 0x14, 0x4c, 0x26, 0x8c, 0xc2, 0x9e, - 0x9a, 0x53, 0x9c, 0x1d, 0x83, 0x3d, 0x1d, 0x39, 0xc4, 0x8d, 0xa7, 0xbf, 0x7f, 0xb9, 0xea, 0x7c, - 0xf6, 0x72, 0xd5, 0xf9, 0xfc, 0xe5, 0xaa, 0xf3, 0xb7, 0x97, 0xab, 0xce, 0x6f, 0x5e, 0xad, 0x4e, - 0x7d, 0xfe, 0x6a, 0x75, 0xea, 0x2f, 0xaf, 0x56, 0xa7, 0x7e, 0xbc, 0x36, 0x52, 0xd1, 0x7f, 0x20, - 0x14, 0xdb, 0x94, 0x8a, 0x37, 0x34, 0x3f, 0x63, 0xa2, 0x31, 0xc8, 0xfe, 0x3f, 0xc4, 0xba, 0xde, - 0x9d, 0xc5, 0x86, 0xe9, 0xc9, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x32, 0xd7, 0x5f, 0xce, 0x5b, - 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, 0x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f, + 0xf2, 0xa0, 0x1f, 0x9a, 0x95, 0x64, 0x82, 0x21, 0xdd, 0x31, 0x2b, 0xc9, 0x4c, 0xe7, 0xe4, 0x07, + 0x64, 0x39, 0x23, 0xef, 0xed, 0x7e, 0xba, 0x07, 0x0b, 0x99, 0x36, 0xee, 0x59, 0xea, 0x5e, 0xdc, + 0x93, 0xb0, 0x8e, 0x87, 0xa4, 0x92, 0x11, 0x9b, 0x9b, 0x9b, 0xad, 0x7d, 0x13, 0x2c, 0x5c, 0x72, + 0x76, 0x63, 0xf0, 0x7d, 0x9e, 0xa4, 0xe3, 0x0e, 0x6c, 0xb5, 0x76, 0xf7, 0x8e, 0x76, 0x37, 0x71, + 0xd1, 0xa3, 0x0e, 0x64, 0xf7, 0x3a, 0x7c, 0x7e, 0x65, 0x64, 0x9b, 0x02, 0x33, 0xd5, 0x5b, 0x57, + 0xd7, 0xb5, 0x6c, 0x17, 0x4c, 0x26, 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 { @@ -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 { @@ -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 { @@ -4062,6 +4086,9 @@ func (m *Dapp) Size() (n int) { if m.PostMintPaid { n += 3 } + if m.EnableBondVerifiers { + n += 3 + } return n } @@ -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:]) From 24ce12888253e56e76c99adf4c9c5ef702bdbe1b Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 13 Jun 2024 01:56:52 +0800 Subject: [PATCH 08/14] fix usage of slashing module storage on recovery module --- app/app.go | 2 +- scripts/sekaidtestsetup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index de96cb96..58016308 100644 --- a/app/app.go +++ b/app/app.go @@ -338,7 +338,7 @@ func NewInitApp( app.RecoveryKeeper = recoverykeeper.NewKeeper( appCodec, - keys[slashingtypes.StoreKey], + keys[recoverytypes.StoreKey], app.AccountKeeper, app.BankKeeper, &customStakingKeeper, diff --git a/scripts/sekaidtestsetup.sh b/scripts/sekaidtestsetup.sh index 600ad113..1af683e5 100755 --- a/scripts/sekaidtestsetup.sh +++ b/scripts/sekaidtestsetup.sh @@ -12,4 +12,4 @@ sekaid gentx-claim validator --keyring-backend=test --moniker="hello" --home=$HO cat $HOME/.sekaid/config/genesis.json | jq '.app_state["customgov"]["network_properties"]["minimum_proposal_end_time"]="30"' > $HOME/.sekaid/config/tmp_genesis.json && mv $HOME/.sekaid/config/tmp_genesis.json $HOME/.sekaid/config/genesis.json cat $HOME/.sekaid/config/genesis.json | jq '.app_state["customgov"]["network_properties"]["proposal_enactment_time"]="10"' > $HOME/.sekaid/config/tmp_genesis.json && mv $HOME/.sekaid/config/tmp_genesis.json $HOME/.sekaid/config/genesis.json -# sekaid start --home=$HOME/.sekaid +sekaid start --home=$HOME/.sekaid From c987892d4a6a1c202de180420c3f5ab413bfdc52 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 19 Jun 2024 10:16:41 +0800 Subject: [PATCH 09/14] update in tokens module --- app/ante/ante.go | 2 +- app/app.go | 2 +- proto/kira/layer2/mint.proto | 36 - proto/kira/layer2/query.proto | 14 - proto/kira/layer2/tx.proto | 12 +- proto/kira/tokens/proposal.proto | 6 +- proto/kira/tokens/token.proto | 43 +- proto/kira/tokens/tx.proto | 6 +- x/basket/keeper/hooks.go | 6 +- x/basket/keeper/mint_burn_swap.go | 2 +- x/basket/types/expected_keepers.go | 1 + x/distributor/keeper/distributor.go | 2 +- x/distributor/keeper/keeper.go | 14 +- x/distributor/types/expected_keepers.go | 8 + x/genutil/client/cli/init.go | 22 +- x/gov/abci_test.go | 2 +- x/layer2/client/cli/query.go | 24 - x/layer2/client/cli/tx.go | 20 +- x/layer2/keeper/grpc_query.go | 8 - x/layer2/keeper/lp_swap_redeem_convert.go | 2 +- x/layer2/keeper/msg_server.go | 52 +- x/layer2/keeper/token_mint.go | 52 - x/layer2/keeper/token_mint_test.go | 70 -- x/layer2/types/errors.go | 1 - x/layer2/types/expected_keepers.go | 2 + x/layer2/types/mint.pb.go | 1126 --------------------- x/layer2/types/query.pb.go | 418 +------- x/layer2/types/query.pb.gw.go | 65 -- x/layer2/types/tx.pb.go | 243 ++--- x/multistaking/keeper/delegation.go | 4 +- x/recovery/keeper/msg_server.go | 2 +- x/recovery/types/expected_keepers.go | 1 + x/tokens/keeper/burn.go | 21 + x/tokens/keeper/grpc_query_test.go | 6 +- x/tokens/keeper/mint.go | 33 +- x/tokens/keeper/msg_server.go | 15 +- x/tokens/keeper/token_info.go | 62 +- x/tokens/keeper/token_info_test.go | 6 +- x/tokens/proposal_handler.go | 2 +- x/tokens/types/errors.go | 3 + x/tokens/types/events.go | 10 +- x/tokens/types/expected_keepers.go | 1 + x/tokens/types/msg_token_info.go | 30 +- x/tokens/types/proposal.go | 28 +- x/tokens/types/proposal.pb.go | 126 +-- x/tokens/types/token.pb.go | 756 ++++++++++++-- x/tokens/types/tx.pb.go | 142 +-- x/tokens/types/types.go | 28 +- 48 files changed, 1238 insertions(+), 2299 deletions(-) delete mode 100644 proto/kira/layer2/mint.proto delete mode 100644 x/layer2/keeper/token_mint.go delete mode 100644 x/layer2/keeper/token_mint_test.go delete mode 100644 x/layer2/types/mint.pb.go create mode 100644 x/tokens/keeper/burn.go diff --git a/app/ante/ante.go b/app/ante/ante.go index 39671fc7..680749a4 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -333,7 +333,7 @@ func (svd ValidateFeeRangeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu 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/app.go b/app/app.go index 58016308..229e887a 100644 --- a/app/app.go +++ b/app/app.go @@ -354,7 +354,7 @@ func NewInitApp( 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], diff --git a/proto/kira/layer2/mint.proto b/proto/kira/layer2/mint.proto deleted file mode 100644 index 2d966f88..00000000 --- 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 341a7197..e66e141a 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 92fdbad1..7fc8292d 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/proposal.proto b/proto/kira/tokens/proposal.proto index 3eb948cd..53a0aa0a 100644 --- a/proto/kira/tokens/proposal.proto +++ b/proto/kira/tokens/proposal.proto @@ -15,7 +15,7 @@ message ProposalUpsertTokenInfo { (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ß + bool fee_enabled = 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", @@ -26,8 +26,8 @@ message ProposalUpsertTokenInfo { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - bool stake_token = 6; - bool invalidated = 7; + bool stake_enabled = 6; + bool inactive = 7; string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) string icon = 10; // Graphical Symbol (url link to graphics) diff --git a/proto/kira/tokens/token.proto b/proto/kira/tokens/token.proto index f9b3e386..54090326 100644 --- a/proto/kira/tokens/token.proto +++ b/proto/kira/tokens/token.proto @@ -7,25 +7,46 @@ option go_package = "github.com/KiraCore/sekai/x/tokens/types"; message TokenInfo { string denom = 1; // denomination target - string fee_rate = 2 [ + 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 [ + 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; // flag that the token is invalidated or not - string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) - string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 10; // Graphical Symbol (url link to graphics) - uint32 decimals = 11; // Integer number of max decimals + 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 c3e5bb0f..b4278d19 100644 --- a/proto/kira/tokens/tx.proto +++ b/proto/kira/tokens/tx.proto @@ -23,7 +23,7 @@ message MsgUpsertTokenInfo { (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 + bool fee_enabled = 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", @@ -34,8 +34,8 @@ message MsgUpsertTokenInfo { (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 + bool stake_enabled = 6; + bool inactive = 7; // flag that the token is inactive or not string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) string icon = 10; // Graphical Symbol (url link to graphics) diff --git a/x/basket/keeper/hooks.go b/x/basket/keeper/hooks.go index 8e803ef8..56d2358e 100644 --- a/x/basket/keeper/hooks.go +++ b/x/basket/keeper/hooks.go @@ -11,7 +11,7 @@ import ( func (k Keeper) AfterUpsertStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool) { 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{ @@ -60,7 +60,7 @@ 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.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 @@ -83,7 +83,7 @@ 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.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/mint_burn_swap.go b/x/basket/keeper/mint_burn_swap.go index 3e211f5d..f8d6db49 100644 --- a/x/basket/keeper/mint_burn_swap.go +++ b/x/basket/keeper/mint_burn_swap.go @@ -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 389d633b..dad76246 100644 --- a/x/basket/types/expected_keepers.go +++ b/x/basket/types/expected_keepers.go @@ -40,6 +40,7 @@ type MultistakingHooks interface { // 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/distributor/keeper/distributor.go b/x/distributor/keeper/distributor.go index 80923e29..31448d65 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 6ff42eb7..6fd60791 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 f39a1bd8..0dd449d4 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/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index d48173a5..4f6bec68 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -133,17 +133,17 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { tokenGenState := tokenstypes.GetGenesisStateFromAppState(clientCtx.Codec, genesis) tokenGenState.TokenInfos = []tokenstypes.TokenInfo{ { - Denom: defaultDenom, - FeeRate: sdk.OneDec(), - FeePayments: true, - StakeCap: sdk.NewDecWithPrec(5, 1), // 0.5 - StakeMin: sdk.OneInt(), - StakeToken: true, - Invalidated: false, - Symbol: defaultDenom, - Name: defaultDenom, - Icon: "", - Decimals: 6, + 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 c35cd02a..4ab19456 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -491,7 +491,7 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { 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/layer2/client/cli/query.go b/x/layer2/client/cli/query.go index 2011d12e..b3e23181 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 7a6b4e0d..0f567144 100644 --- a/x/layer2/client/cli/tx.go +++ b/x/layer2/client/cli/tx.go @@ -1194,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{ @@ -1208,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], } @@ -1257,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{ @@ -1271,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/grpc_query.go b/x/layer2/keeper/grpc_query.go index d9258839..8cbf6d94 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/lp_swap_redeem_convert.go b/x/layer2/keeper/lp_swap_redeem_convert.go index 01d94fa9..a5456026 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/msg_server.go b/x/layer2/keeper/msg_server.go index fcf74dcc..900dbc4d 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" ) @@ -692,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, @@ -714,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 } @@ -736,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, @@ -757,14 +761,17 @@ func (k msgServer) MintCreateNftTx(goCtx context.Context, msg *types.MsgMintCrea 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: msg.Metadata, - Hash: msg.Hash, + NftMetadata: msg.Metadata, + NftHash: msg.Hash, }) + if err != nil { + return nil, err + } return &types.MsgMintCreateNftTxResponse{}, nil } @@ -772,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 == "" { @@ -809,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 } @@ -832,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/token_mint.go b/x/layer2/keeper/token_mint.go deleted file mode 100644 index 3051fb84..00000000 --- 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 c5adccc1..00000000 --- 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/types/errors.go b/x/layer2/types/errors.go index 8e324ae2..6af32f8c 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") diff --git a/x/layer2/types/expected_keepers.go b/x/layer2/types/expected_keepers.go index 960e8359..2878a66f 100644 --- a/x/layer2/types/expected_keepers.go +++ b/x/layer2/types/expected_keepers.go @@ -34,5 +34,7 @@ type SpendingKeeper interface { // 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/mint.pb.go b/x/layer2/types/mint.pb.go deleted file mode 100644 index 4375f49d..00000000 --- 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, 0x19, 0x71, 0xbe, 0x36, 0x8d, 0x56, 0x95, 0x6e, 0xb1, 0xf9, 0xa4, 0xac, 0x71, - 0x61, 0x5e, 0x37, 0x14, 0x48, 0x8e, 0xa2, 0x3e, 0xef, 0xf4, 0xf1, 0x59, 0x49, 0x25, 0xb1, 0xae, - 0x62, 0xd4, 0x95, 0x8c, 0x27, 0x25, 0x51, 0x59, 0xa1, 0x62, 0xca, 0x36, 0x4b, 0x15, 0x8c, 0x45, - 0x1f, 0xb4, 0xad, 0xbb, 0x82, 0xf7, 0xbf, 0xfb, 0x62, 0x78, 0x4d, 0x6b, 0x74, 0x57, 0x6e, 0x49, - 0xf2, 0x9d, 0x10, 0x21, 0xc2, 0x8f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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 98b835ba..bc2337ad 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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 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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 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 9e159d90..3c7530a4 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 660c15d4..619cd45e 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, - 0x00, 0x1e, 0x11, 0x3c, 0xf1, 0x5e, 0x9e, 0x90, 0x78, 0xe7, 0x4f, 0x40, 0x7d, 0xec, 0x23, 0x02, - 0xa9, 0x42, 0xe9, 0x7f, 0xc1, 0x13, 0x9a, 0x8f, 0x9d, 0x7a, 0xbf, 0xe2, 0xd4, 0x2e, 0x02, 0x09, - 0x9e, 0xe2, 0x33, 0xe7, 0xeb, 0x77, 0xce, 0x9c, 0x9d, 0x39, 0x67, 0x02, 0xf3, 0x07, 0x4e, 0x80, - 0xea, 0x2e, 0x3a, 0xc6, 0xc1, 0x5a, 0x3d, 0xec, 0xd5, 0xfc, 0x80, 0x84, 0x44, 0x2b, 0xb1, 0xd5, - 0x9a, 0x58,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 0x38, 0x8c, 0x6d, 0x8c, 0xb5, 0x79, 0x98, 0x20, 0x47, 0x1e, 0x0e, 0xf4, 0x59, 0x9e, 0x18, 0x41, - 0xc8, 0x3a, 0x8d, 0xef, 0xbd, 0xaa, 0x8c, 0xef, 0x8b, 0xa0, 0xc5, 0xb8, 0xf7, 0xda, 0xff, 0x94, - 0xc6, 0xdf, 0xa5, 0x34, 0x58, 0x5e, 0x3a, 0x38, 0x44, 0x2d, 0x14, 0x22, 0xfd, 0xa2, 0x38, 0x85, - 0x23, 0x9a, 0xed, 0x0d, 0xbf, 0xfe, 0xe6, 0xc4, 0xde, 0xb0, 0xdf, 0xd5, 0x6b, 0xfc, 0xfa, 0x49, - 0x14, 0x8b, 0xaa, 0xa5, 0x6f, 0x0b, 0xbc, 0xf1, 0x63, 0xec, 0xdb, 0x94, 0x76, 0xf1, 0x29, 0x75, - 0x34, 0x0f, 0x13, 0xbc, 0x66, 0x64, 0x01, 0x09, 0x82, 0x25, 0x12, 0x75, 0x48, 0xd7, 0x0b, 0xe5, - 0x64, 0xf0, 0xca, 0x89, 0x14, 0xda, 0x2c, 0xac, 0x00, 0x5b, 0xd8, 0x39, 0xc4, 0x81, 0x2c, 0x38, - 0x45, 0xcb, 0xae, 0xb2, 0x0f, 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, 0x54, 0x76, - 0x7c, 0x13, 0x13, 0x63, 0x65, 0xc6, 0x26, 0xc6, 0x25, 0xb2, 0x36, 0x31, 0x7b, 0x9c, 0x64, 0xb0, - 0xe3, 0xb3, 0xe4, 0x52, 0xba, 0xae, 0xfa, 0xd8, 0x69, 0xd8, 0x99, 0x63, 0x22, 0x83, 0x9d, 0x1a, - 0x11, 0x53, 0xb0, 0x93, 0x12, 0x69, 0xd8, 0x79, 0x33, 0x1c, 0xb3, 0x9f, 0x9a, 0xdf, 0x52, 0xf6, - 0x93, 0x12, 0x69, 0xfb, 0x79, 0xb3, 0x13, 0x3b, 0x70, 0xf2, 0x06, 0xa7, 0xd4, 0x81, 0x93, 0x23, - 0x98, 0x3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 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, 0xb8, 0xe8, 0x18, 0x07, 0x6b, 0x0d, 0xd6, 0xaf, 0xfb, 0x01, 0x61, 0x44, 0x2b, 0xf1, 0xd5, + 0x7a, 0xb8, 0x6a, 0x2c, 0xd8, 0xc4, 0x26, 0x62, 0xbd, 0xc1, 0x7f, 0x85, 0x22, 0xc6, 0x35, 0x9b, + 0x10, 0xdb, 0xc5, 0x0d, 0x41, 0xed, 0xf5, 0x3a, 0x0d, 0xe4, 0x1d, 0x47, 0x2c, 0x8b, 0xd0, 0x2e, + 0xa1, 0xad, 0x50, 0x27, 0x24, 0x24, 0x4b, 0x1f, 0x74, 0x17, 0xfe, 0x09, 0x39, 0xd5, 0xa7, 0x05, + 0xb8, 0xd2, 0xa4,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b2, 0xca, + 0x70, 0x3d, 0x2b, 0x1d, 0x2a, 0x5f, 0xdb, 0x30, 0xd7, 0xa4, 0xf6, 0x03, 0xd4, 0xa3, 0xe2, 0xb0, + 0x1e, 0x32, 0x51, 0x55, 0x1d, 0x16, 0xe3, 0x66, 0x94, 0x83, 0x77, 0x60, 0xbe, 0x49, 0xed, 0x47, + 0xde, 0xc8, 0x2e, 0x0c, 0xd0, 0x93, 0x86, 0x94, 0x93, 0xbb, 0xf2, 0x9b, 0x47, 0x16, 0x73, 0x0e, + 0xe5, 0xbd, 0x33, 0xac, 0x9f, 0xe8, 0xdb, 0x8a, 0xdb, 0x52, 0xae, 0x90, 0x88, 0x67, 0xbb, 0x8f, + 0xad, 0xde, 0x48, 0x7e, 0x34, 0x1d, 0xa6, 0x6c, 0xc4, 0xf0, 0x11, 0x3a, 0x96, 0x25, 0x15, 0x91, + 0x32, 0xd2, 0x98, 0x0b, 0xe5, 0xfe, 0x69, 0x78, 0xbc, 0x6d, 0x61, 0x8f, 0xf4, 0x3c, 0x0b, 0xdf, + 0xc3, 0xa8, 0x8d, 0x83, 0x61, 0x21, 0x2c, 0xc2, 0xa4, 0x2b, 0x0c, 0x44, 0xa7, 0x78, 0x48, 0x69, + 0xab, 0x30, 0xdb, 0x96, 0x0e, 0x5a, 0x0c, 0xf7, 0x59, 0x58, 0xd1, 0xe6, 0xc5, 0x68, 0x71, 0x17, + 0xf7, 0x19, 0xc7, 0x7f, 0x88, 0x03, 0xea, 0x10, 0x2f, 0x2c, 0x52, 0x33, 0x22, 0x65, 0x06, 0x93, + 0x10, 0x55, 0x08, 0x3f, 0x84, 0x21, 0xec, 0x06, 0xc8, 0xa3, 0x0e, 0x73, 0x88, 0x37, 0x4a, 0x16, + 0x57, 0xa0, 0x44, 0x19, 0x62, 0x3d, 0xda, 0xda, 0x47, 0x74, 0x5f, 0xc6, 0x01, 0xe1, 0xd2, 0xbb, + 0x88, 0xee, 0x6b, 0x6f, 0xc1, 0x3c, 0xf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x49, 0xed, 0x88, 0x63, 0x54, 0xf2, 0x38, 0x83, 0x9b, + 0x92, 0x7a, 0x97, 0xa8, 0xa4, 0x93, 0x10, 0x97, 0x48, 0x6f, 0x4a, 0xde, 0xdc, 0xaf, 0x3d, 0x86, + 0xb9, 0xc4, 0xcc, 0x5f, 0x4e, 0xea, 0xc6, 0xf9, 0xc6, 0xad, 0xd3, 0xf9, 0xca, 0x32, 0x82, 0xcb, + 0xe9, 0x91, 0xfa, 0x46, 0xaa, 0x1e, 0x93, 0x22, 0xc6, 0x3f, 0xce, 0x14, 0x51, 0x2e, 0xde, 0x87, + 0xd2, 0xe0, 0x8c, 0xb8, 0x94, 0xd4, 0x1c, 0x60, 0x1a, 0xab, 0xa7, 0x30, 0x95, 0xc1, 0x47, 0x30, + 0x1b, 0x1f, 0x3b, 0x97, 0x93, 0x5a, 0x31, 0xb6, 0x71, 0xf3, 0x54, 0x76, 0x7c, 0x13, 0x13, 0x83, + 0x66, 0xc6, 0x26, 0xc6, 0x25, 0xb2, 0x36, 0x31, 0x7b, 0xc0, 0xe4, 0xb0, 0xe3, 0xd3, 0xe5, 0x72, + 0xba, 0xae, 0x06, 0xd8, 0x69, 0xd8, 0x99, 0x83, 0x23, 0x87, 0x9d, 0x1a, 0x1a, 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 4e41d268..b3180400 100644 --- a/x/multistaking/keeper/delegation.go +++ b/x/multistaking/keeper/delegation.go @@ -217,7 +217,7 @@ func (k Keeper) IncreasePoolRewards(ctx sdk.Context, pool types.StakingPool, rew } else { for _, reward := range rewards { rate := k.tokenKeeper.GetTokenInfo(ctx, reward.Denom) - if rate.StakeToken && reward.Amount.GTE(rate.StakeMin) && isWithinArray(reward.Denom, compoundInfo.CompoundDenoms) { + if rate.StakeEnabled && reward.Amount.GTE(rate.StakeMin) && isWithinArray(reward.Denom, compoundInfo.CompoundDenoms) { autoCompoundRewards = autoCompoundRewards.Add(reward) } } @@ -321,7 +321,7 @@ func (k Keeper) Delegate(ctx sdk.Context, msg *types.MsgDelegate) error { for _, amount := range msg.Amounts { rate := k.tokenKeeper.GetTokenInfo(ctx, amount.Denom) - if !rate.StakeToken { + if !rate.StakeEnabled { return types.ErrNotAllowedStakingToken } if amount.Amount.LT(rate.StakeMin) { diff --git a/x/recovery/keeper/msg_server.go b/x/recovery/keeper/msg_server.go index 7d48a6b2..23c8d402 100644 --- a/x/recovery/keeper/msg_server.go +++ b/x/recovery/keeper/msg_server.go @@ -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 8929c685..fd049b98 100644 --- a/x/recovery/types/expected_keepers.go +++ b/x/recovery/types/expected_keepers.go @@ -132,5 +132,6 @@ type CustodyKeeper interface { // 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/tokens/keeper/burn.go b/x/tokens/keeper/burn.go new file mode 100644 index 00000000..9a9eef47 --- /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/grpc_query_test.go b/x/tokens/keeper/grpc_query_test.go index fbdec308..e3d3a8d1 100644 --- a/x/tokens/keeper/grpc_query_test.go +++ b/x/tokens/keeper/grpc_query_test.go @@ -24,7 +24,7 @@ func TestQuerier_GetTokenInfo(t *testing.T) { 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_GetTokenInfosByDenom(t *testing.T) { @@ -41,7 +41,7 @@ func TestQuerier_GetTokenInfosByDenom(t *testing.T) { require.Equal(t, len(resp.Data), 1) 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.FeePayments) + require.Equal(t, true, resp.Data["ukex"].Data.FeeEnabled) } func TestQuerier_GetAllTokenInfos(t *testing.T) { @@ -58,7 +58,7 @@ func TestQuerier_GetAllTokenInfos(t *testing.T) { require.Equal(t, len(resp.Data), 4) 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.FeePayments) + require.Equal(t, true, resp.Data[0].Data.FeeEnabled) } func TestQuerier_GetTokenBlackWhites(t *testing.T) { diff --git a/x/tokens/keeper/mint.go b/x/tokens/keeper/mint.go index 85cefb45..50c2e9be 100644 --- a/x/tokens/keeper/mint.go +++ b/x/tokens/keeper/mint.go @@ -10,19 +10,26 @@ func (k Keeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) err for _, coin := range amt { tokenInfo := k.GetTokenInfo(ctx, coin.Denom) if tokenInfo == nil { - k.UpsertTokenInfo(ctx, types.TokenInfo{ - Denom: coin.Denom, - FeeRate: math.LegacyZeroDec(), - FeePayments: false, - StakeCap: math.LegacyZeroDec(), - StakeMin: math.OneInt(), - StakeToken: false, - Invalidated: false, - Symbol: coin.Denom, - Name: coin.Denom, - Icon: "", - Decimals: 6, - }) + 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 022b136a..051816a1 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -39,33 +39,36 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenInfo) if !isAllowed { - return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) + tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) + if tokenInfo == nil || tokenInfo.Owner != msg.Proposer.String() || tokenInfo.OwnerEditDisabled { + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) + } } err = k.keeper.UpsertTokenInfo(ctx, types.NewTokenInfo( msg.Denom, msg.Rate, - msg.FeePayments, + msg.FeeEnabled, msg.StakeCap, msg.StakeMin, - msg.StakeToken, - msg.Invalidated, + msg.StakeEnabled, + msg.Inactive, msg.Symbol, msg.Name, msg.Icon, msg.Decimals, )) - if err != nil { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } + ctx.EventManager().EmitEvent( sdk.NewEvent( 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.AttributeKeyFeeEnabled, fmt.Sprintf("%t", msg.FeeEnabled)), ), ) diff --git a/x/tokens/keeper/token_info.go b/x/tokens/keeper/token_info.go index 4e0badf4..3b3ae4a4 100644 --- a/x/tokens/keeper/token_info.go +++ b/x/tokens/keeper/token_info.go @@ -1,7 +1,6 @@ package keeper import ( - "errors" "fmt" "github.com/cosmos/cosmos-sdk/store/prefix" @@ -10,7 +9,7 @@ import ( "github.com/KiraCore/sekai/x/tokens/types" ) -// GetTokenInfo returns a token rate +// 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)) @@ -18,17 +17,17 @@ func (k Keeper) GetTokenInfo(ctx sdk.Context, denom string) *types.TokenInfo { return nil } - rate := new(types.TokenInfo) - k.cdc.MustUnmarshal(bz, rate) + info := new(types.TokenInfo) + k.cdc.MustUnmarshal(bz, info) - return rate + return info } -// GetAllTokenInfos returns all list of token rate +// GetAllTokenInfos returns all list of token info func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []types.TokenInfo { - var tokenRates []types.TokenInfo + var tokenInfos []types.TokenInfo - // get iterator for token rates + // get iterator for token infos store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenInfo) defer iterator.Close() @@ -36,45 +35,50 @@ func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []types.TokenInfo { for ; iterator.Valid(); iterator.Next() { info := types.TokenInfo{} k.cdc.MustUnmarshal(iterator.Value(), &info) - tokenRates = append(tokenRates, info) + tokenInfos = append(tokenInfos, info) } - return tokenRates + return tokenInfos } -// GetTokenInfosByDenom returns all list of token rate +// GetTokenInfosByDenom returns all list of token info func (k Keeper) GetTokenInfosByDenom(ctx sdk.Context, denoms []string) map[string]types.TokenInfoResponse { - tokenRatesMap := make(map[string]types.TokenInfoResponse) + tokenInfosMap := make(map[string]types.TokenInfoResponse) for _, denom := range denoms { - tokenRate := k.GetTokenInfo(ctx, denom) + tokenInfo := k.GetTokenInfo(ctx, denom) supply := k.bankKeeper.GetSupply(ctx, denom) - tokenRatesMap[denom] = types.TokenInfoResponse{ - Data: tokenRate, + tokenInfosMap[denom] = types.TokenInfoResponse{ + Data: tokenInfo, Supply: supply, } } - return tokenRatesMap + return tokenInfosMap } -// UpsertTokenInfo upsert a token rate to the registry -func (k Keeper) UpsertTokenInfo(ctx sdk.Context, rate types.TokenInfo) error { +// 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 - tokenRateStoreID := append([]byte(PrefixKeyTokenInfo), []byte(rate.Denom)...) - if rate.Denom == k.DefaultDenom(ctx) && store.Has(tokenRateStoreID) { - return errors.New("bond denom rate is read-only") + tokenInfoStoreID := append([]byte(PrefixKeyTokenInfo), []byte(info.Denom)...) + if info.Denom == k.DefaultDenom(ctx) && store.Has(tokenInfoStoreID) { + return types.ErrBondDenomIsReadOnly } - store.Set(tokenRateStoreID, k.cdc.MustMarshal(&rate)) + 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() - rates := k.GetAllTokenInfos(ctx) - for _, rate := range rates { - totalRewardsCap = totalRewardsCap.Add(rate.StakeCap) + infos := k.GetAllTokenInfos(ctx) + for _, info := range infos { + totalRewardsCap = totalRewardsCap.Add(info.StakeCap) } if totalRewardsCap.GT(sdk.OneDec()) { return types.ErrTotalRewardsCapExceeds100Percent } + return nil } @@ -82,12 +86,12 @@ func (k Keeper) UpsertTokenInfo(ctx sdk.Context, rate types.TokenInfo) error { 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 - tokenRateStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) + tokenInfoStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) - if !store.Has(tokenRateStoreID) { - return fmt.Errorf("no rate registry is available for %s denom", denom) + if !store.Has(tokenInfoStoreID) { + return fmt.Errorf("no token info registry is available for %s denom", denom) } - store.Delete(tokenRateStoreID) + store.Delete(tokenInfoStoreID) return nil } diff --git a/x/tokens/keeper/token_info_test.go b/x/tokens/keeper/token_info_test.go index 321e6925..185c85b0 100644 --- a/x/tokens/keeper/token_info_test.go +++ b/x/tokens/keeper/token_info_test.go @@ -20,9 +20,9 @@ func (suite *KeeperTestSuite) TestTokenInfos() { // upsert token rate and check newRate := types.TokenInfo{ - Denom: "stake", - FeeRate: sdk.NewDec(2), - FeePayments: true, + Denom: "stake", + FeeRate: sdk.NewDec(2), + FeeEnabled: true, } suite.app.TokensKeeper.UpsertTokenInfo(ctx, newRate) rate = suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") diff --git a/x/tokens/proposal_handler.go b/x/tokens/proposal_handler.go index ba364139..37b1c292 100644 --- a/x/tokens/proposal_handler.go +++ b/x/tokens/proposal_handler.go @@ -24,7 +24,7 @@ func (a ApplyUpsertTokenInfosProposalHandler) Apply(ctx sdk.Context, proposalID p := proposal.(*tokenstypes.ProposalUpsertTokenInfo) rate := tokenstypes.NewTokenInfo( - p.Denom, p.Rate, p.FeePayments, p.StakeCap, p.StakeMin, p.StakeToken, p.Invalidated, + p.Denom, p.Rate, p.FeeEnabled, p.StakeCap, p.StakeMin, p.StakeEnabled, p.Inactive, p.Symbol, p.Name, p.Icon, p.Decimals, ) return a.keeper.UpsertTokenInfo(ctx, rate) diff --git a/x/tokens/types/errors.go b/x/tokens/types/errors.go index 8e175305..3e38aa7e 100644 --- a/x/tokens/types/errors.go +++ b/x/tokens/types/errors.go @@ -7,4 +7,7 @@ var ( 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") ) diff --git a/x/tokens/types/events.go b/x/tokens/types/events.go index bd5e1625..f2452088 100644 --- a/x/tokens/types/events.go +++ b/x/tokens/types/events.go @@ -2,12 +2,12 @@ package types // tokens module events const ( - EventTypeUpsertTokenInfo = "upsert_token_rate" + EventTypeUpsertTokenInfo = "upsert_token_info" - AttributeKeyDescription = "proposal_id" - AttributeKeyDenom = "proposal_type" - AttributeKeyRate = "proposal_content" - AttributeKeyFeePayments = "voter" + AttributeKeyDescription = "description" + AttributeKeyDenom = "denom" + AttributeKeyRate = "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 8e122980..a44d361e 100644 --- a/x/tokens/types/expected_keepers.go +++ b/x/tokens/types/expected_keepers.go @@ -14,6 +14,7 @@ type CustomGovKeeper interface { 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/msg_token_info.go b/x/tokens/types/msg_token_info.go index cadb1056..5ecdaec0 100644 --- a/x/tokens/types/msg_token_info.go +++ b/x/tokens/types/msg_token_info.go @@ -17,29 +17,29 @@ func NewMsgUpsertTokenInfo( proposer sdk.AccAddress, denom string, rate sdk.Dec, - feePayments bool, + feeEnabled bool, stakeCap sdk.Dec, stakeMin sdk.Int, - stakeToken bool, - invalidated bool, + stakeEnabled bool, + inactive bool, symbol string, name string, icon string, decimals uint32, ) *MsgUpsertTokenInfo { return &MsgUpsertTokenInfo{ - Proposer: proposer, - Denom: denom, - Rate: rate, - FeePayments: feePayments, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeToken: stakeToken, - Invalidated: invalidated, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + Proposer: proposer, + Denom: denom, + Rate: rate, + FeeEnabled: feeEnabled, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } diff --git a/x/tokens/types/proposal.go b/x/tokens/types/proposal.go index ea6823fe..81ab5cea 100644 --- a/x/tokens/types/proposal.go +++ b/x/tokens/types/proposal.go @@ -16,28 +16,28 @@ var ( func NewUpsertTokenInfosProposal( denom string, rate sdk.Dec, - feePayments bool, + feeEnabled bool, stakeCap sdk.Dec, stakeMin sdk.Int, - stakeToken bool, - isInvalidated bool, + stakeEnabled bool, + inactive bool, symbol string, name string, icon string, decimals uint32, ) *ProposalUpsertTokenInfo { return &ProposalUpsertTokenInfo{ - Denom: denom, - Rate: rate, - FeePayments: feePayments, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeToken: stakeToken, - Invalidated: isInvalidated, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + Denom: denom, + Rate: rate, + FeeEnabled: feeEnabled, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } diff --git a/x/tokens/types/proposal.pb.go b/x/tokens/types/proposal.pb.go index 93e33411..6e02ba4a 100644 --- a/x/tokens/types/proposal.pb.go +++ b/x/tokens/types/proposal.pb.go @@ -26,17 +26,17 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ProposalUpsertTokenInfo 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"` - 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"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + 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"` + FeeEnabled bool `protobuf:"varint,3,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,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"` + StakeEnabled bool `protobuf:"varint,6,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,7,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` } func (m *ProposalUpsertTokenInfo) Reset() { *m = ProposalUpsertTokenInfo{} } @@ -79,23 +79,23 @@ func (m *ProposalUpsertTokenInfo) GetDenom() string { return "" } -func (m *ProposalUpsertTokenInfo) GetFeePayments() bool { +func (m *ProposalUpsertTokenInfo) GetFeeEnabled() bool { if m != nil { - return m.FeePayments + return m.FeeEnabled } return false } -func (m *ProposalUpsertTokenInfo) GetStakeToken() bool { +func (m *ProposalUpsertTokenInfo) GetStakeEnabled() bool { if m != nil { - return m.StakeToken + return m.StakeEnabled } return false } -func (m *ProposalUpsertTokenInfo) GetInvalidated() bool { +func (m *ProposalUpsertTokenInfo) GetInactive() bool { if m != nil { - return m.Invalidated + return m.Inactive } return false } @@ -135,34 +135,34 @@ func init() { func init() { proto.RegisterFile("kira/tokens/proposal.proto", fileDescriptor_68008d794328e180) } var fileDescriptor_68008d794328e180 = []byte{ - // 428 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x8e, 0xd3, 0x30, - 0x18, 0xc7, 0x1b, 0xe8, 0xf5, 0x5a, 0x07, 0x04, 0xb2, 0x4e, 0x60, 0x3a, 0x24, 0xa5, 0x03, 0xea, - 0x72, 0xc9, 0xc0, 0x76, 0x63, 0xca, 0x72, 0x42, 0x48, 0xa7, 0x08, 0x16, 0x96, 0xca, 0x4d, 0xbe, - 0x16, 0x2b, 0xb1, 0x3f, 0x2b, 0x36, 0x88, 0xbe, 0x01, 0x23, 0x8f, 0xc0, 0x43, 0xf0, 0x10, 0x27, - 0xa6, 0x1b, 0x11, 0x43, 0x85, 0xda, 0x85, 0x99, 0x27, 0x40, 0xb1, 0x73, 0xc7, 0xe9, 0xb6, 0x4e, - 0xf9, 0xfe, 0xbf, 0x7f, 0xf2, 0xfd, 0x95, 0xbf, 0x4d, 0xc6, 0x95, 0x68, 0x78, 0x6a, 0xb1, 0x02, - 0x65, 0x52, 0xdd, 0xa0, 0x46, 0xc3, 0xeb, 0x44, 0x37, 0x68, 0x91, 0x86, 0xad, 0x97, 0x78, 0x6f, - 0x7c, 0xb2, 0xc6, 0x35, 0x3a, 0x9e, 0xb6, 0x93, 0x7f, 0x65, 0xfc, 0xac, 0x40, 0x23, 0xd1, 0x2c, - 0xbc, 0xe1, 0x85, 0xb7, 0xa6, 0x5f, 0xfa, 0xe4, 0xe9, 0x45, 0xb7, 0xf0, 0x9d, 0x36, 0xd0, 0xd8, - 0xb7, 0xed, 0xa6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13, 0x05, 0x2a, 0x46, 0x3c, 0x6b, 0x67, - 0x3a, 0x26, 0xc3, 0x12, 0x0a, 0x21, 0x79, 0x6d, 0x58, 0x38, 0x09, 0x66, 0x0f, 0xf3, 0x1b, 0x7d, - 0xf6, 0xe8, 0xcf, 0xb7, 0x38, 0xf8, 0xf1, 0xfd, 0xf4, 0x78, 0x8e, 0xca, 0x82, 0xb2, 0x59, 0x76, - 0xb9, 0x8b, 0x82, 0xab, 0x5d, 0x14, 0xfc, 0xde, 0x45, 0xc1, 0xd7, 0x7d, 0xd4, 0xbb, 0xda, 0x47, - 0xbd, 0x9f, 0xfb, 0xa8, 0xf7, 0x7e, 0x76, 0xab, 0x8f, 0xd7, 0xa2, 0xe1, 0x73, 0x6c, 0x20, 0x35, - 0x50, 0x71, 0x91, 0x7e, 0xbe, 0xbe, 0x95, 0xae, 0x95, 0xe5, 0xc0, 0xdd, 0xaa, 0x97, 0xff, 0x02, - 0x00, 0x00, 0xff, 0xff, 0xfe, 0x9b, 0x3a, 0xa5, 0xb1, 0x02, 0x00, 0x00, + // 422 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x8e, 0xd3, 0x40, + 0x10, 0x86, 0xb3, 0x90, 0xcb, 0x25, 0x1b, 0x4e, 0xa0, 0xd5, 0x09, 0x96, 0x14, 0x76, 0x14, 0x24, + 0x94, 0xe6, 0xec, 0x82, 0xee, 0x4a, 0x07, 0x8a, 0x13, 0x42, 0x42, 0x16, 0x34, 0x34, 0xd1, 0xc6, + 0x99, 0x84, 0x95, 0xbd, 0x3b, 0x96, 0x77, 0x41, 0xa4, 0xe7, 0x01, 0x78, 0x04, 0x1e, 0x82, 0x87, + 0x38, 0x51, 0x5d, 0x89, 0x28, 0x22, 0x94, 0x34, 0xd4, 0x3c, 0x01, 0xf2, 0xae, 0x1d, 0xd0, 0x75, + 0xa9, 0x3c, 0xff,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x03, 0xae, 0xb4, 0xbd, 0x1d, 0xa0, 0xa4, + 0x6e, 0x03, 0x5e, 0x49, 0xcd, 0x9e, 0xd0, 0x33, 0xcf, 0xdb, 0x21, 0x7b, 0x6e, 0xc8, 0x7b, 0x0e, + 0xb6, 0x63, 0x8e, 0x68, 0x5f, 0x6a, 0x91, 0x59, 0xf9, 0x11, 0xf8, 0xa9, 0xf3, 0x0f, 0x9a, 0x3d, + 0xa4, 0x3d, 0xb3, 0x51, 0x0b, 0x2c, 0x78, 0xdf, 0xad, 0xbf, 0x51, 0x8c, 0xd1, 0xae, 0x16, 0x0a, + 0xf8, 0xc0, 0x51, 0x57, 0xd7, 0x4c, 0x66, 0xa8, 0x39, 0xf5, 0xac, 0xae, 0xeb, 0xde, 0x4b, 0xc8, + 0xa4, 0x12, 0x85, 0xe1, 0xc3, 0x31, 0x99, 0x9e, 0xa5, 0x07, 0x7d, 0x79, 0xff, 0xf7, 0xd7, 0x90, + 0x7c, 0xff, 0x76, 0x71, 0x3a, 0x43, 0x6d, 0x41, 0xdb, 0x24, 0xb9, 0xde, 0x05, 0xe4, 0x66, 0x17, + 0x90, 0x5f, 0xbb, 0x80, 0x7c, 0xd9, 0x07, 0x9d, 0x9b, 0x7d, 0xd0, 0xf9, 0xb1, 0x0f, 0x3a, 0xef, + 0xa6, 0xff, 0x6d, 0xe3, 0xa5, 0xac, 0xc4, 0x0c, 0x2b, 0x88, 0x0d, 0xe4, 0x42, 0xc6, 0x9f, 0xda, + 0x8b, 0x74, 0x3b, 0x59, 0xf4, 0xdc, 0x45, 0x3d, 0xfb, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x71, 0xc3, + 0x9d, 0x06, 0xad, 0x02, 0x00, 0x00, } func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { @@ -190,7 +190,7 @@ func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if !this.Rate.Equal(that1.Rate) { return false } - if this.FeePayments != that1.FeePayments { + if this.FeeEnabled != that1.FeeEnabled { return false } if !this.StakeCap.Equal(that1.StakeCap) { @@ -199,10 +199,10 @@ func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if !this.StakeMin.Equal(that1.StakeMin) { return false } - if this.StakeToken != that1.StakeToken { + if this.StakeEnabled != that1.StakeEnabled { return false } - if this.Invalidated != that1.Invalidated { + if this.Inactive != that1.Inactive { return false } if this.Symbol != that1.Symbol { @@ -265,9 +265,9 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x42 } - if m.Invalidated { + if m.Inactive { i-- - if m.Invalidated { + if m.Inactive { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -275,9 +275,9 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x38 } - if m.StakeToken { + if m.StakeEnabled { i-- - if m.StakeToken { + if m.StakeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -305,9 +305,9 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) } i-- dAtA[i] = 0x22 - if m.FeePayments { + if m.FeeEnabled { i-- - if m.FeePayments { + if m.FeeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -358,17 +358,17 @@ func (m *ProposalUpsertTokenInfo) Size() (n int) { } l = m.Rate.Size() n += 1 + l + sovProposal(uint64(l)) - if m.FeePayments { + if m.FeeEnabled { n += 2 } l = m.StakeCap.Size() n += 1 + l + sovProposal(uint64(l)) l = m.StakeMin.Size() n += 1 + l + sovProposal(uint64(l)) - if m.StakeToken { + if m.StakeEnabled { n += 2 } - if m.Invalidated { + if m.Inactive { n += 2 } l = len(m.Symbol) @@ -492,7 +492,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -509,7 +509,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.FeePayments = bool(v != 0) + m.FeeEnabled = bool(v != 0) case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) @@ -580,7 +580,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -597,10 +597,10 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.StakeToken = bool(v != 0) + m.StakeEnabled = bool(v != 0) case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -617,7 +617,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.Invalidated = bool(v != 0) + m.Inactive = bool(v != 0) case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) diff --git a/x/tokens/types/token.pb.go b/x/tokens/types/token.pb.go index 24b5424d..135abe02 100644 --- a/x/tokens/types/token.pb.go +++ b/x/tokens/types/token.pb.go @@ -25,17 +25,29 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type TokenInfo 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"` - 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"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + 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{} } @@ -78,23 +90,30 @@ func (m *TokenInfo) GetDenom() string { return "" } -func (m *TokenInfo) GetFeePayments() bool { +func (m *TokenInfo) GetTokenType() string { if m != nil { - return m.FeePayments + return m.TokenType + } + return "" +} + +func (m *TokenInfo) GetFeeEnabled() bool { + if m != nil { + return m.FeeEnabled } return false } -func (m *TokenInfo) GetStakeToken() bool { +func (m *TokenInfo) GetStakeEnabled() bool { if m != nil { - return m.StakeToken + return m.StakeEnabled } return false } -func (m *TokenInfo) GetInvalidated() bool { +func (m *TokenInfo) GetInactive() bool { if m != nil { - return m.Invalidated + return m.Inactive } return false } @@ -127,6 +146,62 @@ func (m *TokenInfo) GetDecimals() uint32 { 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") } @@ -134,32 +209,44 @@ func init() { func init() { proto.RegisterFile("kira/tokens/token.proto", fileDescriptor_0ed83e3668468753) } var fileDescriptor_0ed83e3668468753 = []byte{ - // 391 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0xae, 0xd3, 0x30, - 0x14, 0x86, 0x13, 0xee, 0xbd, 0xbd, 0x89, 0x03, 0x12, 0xb2, 0x2a, 0xb0, 0x3a, 0x24, 0xa1, 0x03, - 0xca, 0x42, 0x32, 0xb0, 0x31, 0xa6, 0x2c,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, 0xfd, 0xd9, 0x47, - 0x4f, 0x07, 0xca, 0xdb, 0x37, 0xf3, 0xf3, 0x43, 0xf3, 0xc2, 0xb3, 0x7a, 0x41, 0xbb, 0xff, 0x06, - 0x9c, 0x09, 0x72, 0x77, 0xb5, 0xc1, 0x52, 0xe8, 0x87, 0x06, 0x9c, 0x89, 0x7f, 0x06, 0xef, 0x99, - 0xc0, 0x11, 0x0a, 0x46, 0x6e, 0x93, 0x27, 0x13, 0x3b, 0x23, 0xb2, 0xc8, 0x46, 0x8d, 0x63, 0x14, - 0x30, 0xf1, 0x95, 0xb6, 0xac, 0xa2, 0x1a, 0x2a, 0x72, 0x3f, 0x86, 0x70, 0x81, 0xf0, 0x33, 0x34, - 0x51, 0x03, 0x5f, 0xcb, 0x96, 0x78, 0xf6, 0x27, 0x4e, 0x15, 0xc6, 0xe8, 0x56, 0x50, 0x0e, 0xc4, - 0xb7, 0xd4, 0x6a, 0xc3, 0x58, 0x29, 0x05, 0x41, 0x23, 0x33, 0x1a, 0xcf, 0x90, 0x57, 0x41, 0xc9, - 0x38, 0x6d, 0x15, 0x09, 0x62, 0x37, 0x79, 0x52, 0x9c, 0xeb, 0x3c, 0xdf, 0x1e, 0x42, 0x77, 0x77, - 0x08, 0xdd, 0x5f, 0x87, 0xd0, 0xfd, 0x7e, 0x0c, 0x9d, 0xdd, 0x31, 0x74, 0x7e, 0x1c, 0x43, 0xe7, - 0x53, 0x72, 0x31, 0xfe, 0x3b, 0xd6, 0xd3, 0x85, 0xec, 0x21, 0x53, 0xd0, 0x50, 0x96, 0x7d, 0x3b, - 0xef, 0x97, 0x09, 0x61, 0x3d, 0xb1, 0xdb, 0xf3, 0xfa, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, - 0x8c, 0x89, 0xbc, 0x7b, 0x02, 0x00, 0x00, + // 578 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 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x69, + 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) { @@ -182,51 +269,134 @@ func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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] = 0x58 + 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] = 0x52 + 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] = 0x4a + 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] = 0x42 + dAtA[i] = 0x5a } - 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() @@ -237,7 +407,7 @@ func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintToken(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x42 { size := m.StakeCap.Size() i -= size @@ -247,16 +417,36 @@ func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintToken(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 = 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.FeePayments { + if m.FeeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x20 } { size := m.FeeRate.Size() @@ -267,7 +457,14 @@ func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintToken(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 = 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) @@ -299,19 +496,27 @@ func (m *TokenInfo) Size() (n int) { 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.FeePayments { + 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.StakeToken { + if m.StakeEnabled { n += 2 } - if m.Invalidated { + if m.Inactive { n += 2 } l = len(m.Symbol) @@ -329,6 +534,38 @@ func (m *TokenInfo) Size() (n int) { 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 } @@ -400,6 +637,38 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { 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) } @@ -433,9 +702,9 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -452,8 +721,76 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { break } } - m.FeePayments = bool(v != 0) - case 4: + 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) } @@ -487,7 +824,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) } @@ -521,9 +858,9 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 9: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -540,10 +877,10 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { break } } - m.StakeToken = bool(v != 0) - case 7: + m.StakeEnabled = bool(v != 0) + case 10: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -560,8 +897,8 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { break } } - m.Invalidated = bool(v != 0) - case 8: + m.Inactive = bool(v != 0) + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } @@ -593,7 +930,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { } m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -625,7 +962,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } @@ -657,7 +994,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { } m.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) } @@ -676,6 +1013,271 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { 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:]) diff --git a/x/tokens/types/tx.pb.go b/x/tokens/types/tx.pb.go index 9b94a136..b68732ac 100644 --- a/x/tokens/types/tx.pb.go +++ b/x/tokens/types/tx.pb.go @@ -30,18 +30,18 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgUpsertTokenInfo 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"` - 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"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` - Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,12,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` + 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"` + FeeEnabled bool `protobuf:"varint,3,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,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"` + StakeEnabled bool `protobuf:"varint,6,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,7,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,12,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` } func (m *MsgUpsertTokenInfo) Reset() { *m = MsgUpsertTokenInfo{} } @@ -84,23 +84,23 @@ func (m *MsgUpsertTokenInfo) GetDenom() string { return "" } -func (m *MsgUpsertTokenInfo) GetFeePayments() bool { +func (m *MsgUpsertTokenInfo) GetFeeEnabled() bool { if m != nil { - return m.FeePayments + return m.FeeEnabled } return false } -func (m *MsgUpsertTokenInfo) GetStakeToken() bool { +func (m *MsgUpsertTokenInfo) GetStakeEnabled() bool { if m != nil { - return m.StakeToken + return m.StakeEnabled } return false } -func (m *MsgUpsertTokenInfo) GetInvalidated() bool { +func (m *MsgUpsertTokenInfo) GetInactive() bool { if m != nil { - return m.Invalidated + return m.Inactive } return false } @@ -290,44 +290,44 @@ func init() { func init() { proto.RegisterFile("kira/tokens/tx.proto", fileDescriptor_9bac5a72e1a3117c) } var fileDescriptor_9bac5a72e1a3117c = []byte{ - // 587 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0x58, 0xd7, 0xb5, 0x6e, 0xa7, 0x21, 0x6b, 0x30, 0x2b, 0x42, 0x49, 0xc9, 0x01, 0x7a, - 0x59, 0x22, 0xc1, 0x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xfc, 0x7f, 0x04, 0x00, 0x00, + // 581 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xb1, 0x6e, 0xdb, 0x3a, + 0x14, 0xb5, 0x5e, 0x1c, 0xc7, 0x66, 0x1c, 0xe4, 0x81, 0x48, 0x1b, 0x42, 0x28, 0x24, 0x43, 0x05, + 0x5a, 0x2f, 0x91, 0x80, 0x76, 0xeb, 0x16, 0x25, 0x19, 0x82, 0xd6, 0x8b, 0x90, 0x2e, 0xed, 0xe0, + 0xd2, 0xd2, 0xb5, 0x2c, 0xd8, 0x22, 0x05, 0x92, 0x29, 0xec, 0x7e, 0x45, 0x3f, 0xa5, 0x9f, 0x91, + 0x31, 0x63, 0xd1, 0xc1, 0x28, 0x92, 0x3f, 0xc8, 0xd8, 0xa9, 0x20, 0x25, 0x39, 0x4e, 0x82, 0xa2, + 0xcd, 0xa4, 0x7b, 0xcf, 0x21, 0xef, 0xf1, 0x21, 0x0f, 0x8d, 0xf6, 0xa6, 0x99, 0xa0, 0x81, 0xe2, + 0x53, 0x60, 0x32, 0x50, 0x73, 0xbf, 0x10, 0x5c, 0x71, 0xbc, 0xad, 0x51, 0xbf, 0x44, 0xed, 0xbd, + 0x94, 0xa7, 0xdc, 0xe0, 0x81, 0xae, 0xca, 0x25, 0xb6, 0xbd, 0xbe, 0xb1, 0x10, 0xbc, 0xe0, 0x92, + 0xce, 0x2a, 0x6e, 0xff, 0xce, 0x50, 0xfd, 0xa9, 0x08, 0xb2, 0x4e, 0x8c, 0x05, 0xc0, 0x17, 0x28, + 0x19, 0xef, 0xb2, 0x89, 0xf0, 0x40, 0xa6, 0xef, 0x0b, 0x09, 0x42, 0x9d, 0xe9, 0x05, 0xa7, 0x6c, + 0xcc, 0xf1, 0x1e, 0xda, 0x4c, 0x80, 0xf1, 0x9c, 0x58, 0x3d, 0xab, 0xdf, 0x89, 0xca, 0x06, 0x87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0xd3, 0xf8, 0xd0, 0x5f, 0xbb, + 0xa6, 0xb7, 0x99, 0xa0, 0x47, 0x5c, 0x40, 0x20, 0x61, 0x4a, 0xb3, 0x60, 0xbe, 0xfa, 0x2b, 0xd0, + 0x97, 0x35, 0x6a, 0x99, 0x17, 0xff, 0xfa, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xf8, 0xe0, + 0x45, 0x7b, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -503,9 +503,9 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x42 } - if m.Invalidated { + if m.Inactive { i-- - if m.Invalidated { + if m.Inactive { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -513,9 +513,9 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x38 } - if m.StakeToken { + if m.StakeEnabled { i-- - if m.StakeToken { + if m.StakeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -543,9 +543,9 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x22 - if m.FeePayments { + if m.FeeEnabled { i-- - if m.FeePayments { + if m.FeeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -693,17 +693,17 @@ func (m *MsgUpsertTokenInfo) Size() (n int) { } l = m.Rate.Size() n += 1 + l + sovTx(uint64(l)) - if m.FeePayments { + if m.FeeEnabled { n += 2 } l = m.StakeCap.Size() n += 1 + l + sovTx(uint64(l)) l = m.StakeMin.Size() n += 1 + l + sovTx(uint64(l)) - if m.StakeToken { + if m.StakeEnabled { n += 2 } - if m.Invalidated { + if m.Inactive { n += 2 } l = len(m.Symbol) @@ -874,7 +874,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -891,7 +891,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.FeePayments = bool(v != 0) + m.FeeEnabled = bool(v != 0) case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) @@ -962,7 +962,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -979,10 +979,10 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.StakeToken = bool(v != 0) + m.StakeEnabled = bool(v != 0) case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -999,7 +999,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.Invalidated = bool(v != 0) + m.Inactive = bool(v != 0) case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) diff --git a/x/tokens/types/types.go b/x/tokens/types/types.go index e17e3c19..c76baef9 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -8,27 +8,27 @@ import ( func NewTokenInfo( denom string, feeRate sdk.Dec, - feePayments bool, + feeEnabled bool, stakeCap sdk.Dec, stakeMin sdk.Int, - stakeToken bool, - invalidated bool, + stakeEnabled bool, + inactive bool, symbol string, name string, icon string, decimals uint32, ) TokenInfo { return TokenInfo{ - Denom: denom, - FeeRate: feeRate, - FeePayments: feePayments, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeToken: stakeToken, - Invalidated: invalidated, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + Denom: denom, + FeeRate: feeRate, + FeeEnabled: feeEnabled, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } From 8dae08c4c07eec1212f99d13455083f378f2d7c0 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 21 Jun 2024 17:37:12 +0800 Subject: [PATCH 10/14] Proper token info update permission management for gov and owners --- proto/kira/tokens/proposal.proto | 47 +- proto/kira/tokens/tx.proto | 49 +- x/tokens/client/cli/tx.go | 270 +++++++++-- x/tokens/handler_test.go | 22 + x/tokens/keeper/msg_server.go | 42 +- x/tokens/proposal_handler.go | 25 +- x/tokens/types/events.go | 2 +- x/tokens/types/genesis.go | 9 +- x/tokens/types/msg_token_info.go | 57 ++- x/tokens/types/proposal.go | 53 ++- x/tokens/types/proposal.pb.go | 766 ++++++++++++++++++++++++++++--- x/tokens/types/tx.pb.go | 758 ++++++++++++++++++++++++++---- x/tokens/types/types.go | 54 ++- 13 files changed, 1890 insertions(+), 264 deletions(-) diff --git a/proto/kira/tokens/proposal.proto b/proto/kira/tokens/proposal.proto index 53a0aa0a..8de7e805 100644 --- a/proto/kira/tokens/proposal.proto +++ b/proto/kira/tokens/proposal.proto @@ -11,25 +11,46 @@ message ProposalUpsertTokenInfo { option (gogoproto.equal) = true; string denom = 1; // denomination target - string rate = 2 [ + 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 = 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_enabled = 6; - bool inactive = 7; - string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) - string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 10; // Graphical Symbol (url link to graphics) - uint32 decimals = 11; // Integer number of max decimals + 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 b4278d19..af74d376 100644 --- a/proto/kira/tokens/tx.proto +++ b/proto/kira/tokens/tx.proto @@ -19,28 +19,49 @@ service Msg { message MsgUpsertTokenInfo { string denom = 1; // denomination target - string rate = 2 [ + 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 = 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_enabled = 6; - bool inactive = 7; // flag that the token is inactive or not - string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) - string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 10; // Graphical Symbol (url link to graphics) - uint32 decimals = 11; // Integer number of max decimals - bytes proposer = 12 [ + 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\"" ]; diff --git a/x/tokens/client/cli/tx.go b/x/tokens/client/cli/tx.go index 05cf6da0..f7a121f0 100644 --- a/x/tokens/client/cli/tx.go +++ b/x/tokens/client/cli/tx.go @@ -15,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. @@ -60,6 +71,9 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { Short: "Create a proposal to upsert token rate", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return fmt.Errorf("invalid is_blacklist flag: %w", err) + } denom, err := cmd.Flags().GetString(FlagDenom) if err != nil { @@ -69,19 +83,44 @@ func GetTxProposalUpsertTokenInfoCmd() *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(FlagTokenRate) 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") + return fmt.Errorf("invalid fee enabled flag") + } + + 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) } title, err := cmd.Flags().GetString(FlagTitle) @@ -94,6 +133,46 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { 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) + } + stakeToken, err := cmd.Flags().GetBool(FlagStakeToken) if err != nil { return fmt.Errorf("invalid stake token flag") @@ -150,8 +229,11 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { description, types.NewUpsertTokenInfosProposal( denom, - rate, - feePayments, + tokenType, + feeRate, + feeEnabled, + supply, + supplyCap, stakeCap, stakeMin, stakeToken, @@ -160,6 +242,15 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { name, icon, decimals, + description, + website, + social, + 0, + mintingFee, + owner, + ownerEditDisabled, + nftMetadata, + nftHash, ), ) if err != nil { @@ -177,10 +268,10 @@ func GetTxProposalUpsertTokenInfoCmd() *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.") @@ -193,6 +284,17 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { 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) @@ -216,21 +318,46 @@ func GetTxUpsertTokenInfoCmd() *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") @@ -281,11 +408,59 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { 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, @@ -294,6 +469,15 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { name, icon, decimals, + description, + website, + social, + 0, + mintingFee, + owner, + ownerEditDisabled, + nftMetadata, + nftHash, ) err = msg.ValidateBasic() @@ -307,10 +491,10 @@ func GetTxUpsertTokenInfoCmd() *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.") @@ -319,6 +503,17 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { 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) @@ -333,6 +528,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_test.go b/x/tokens/handler_test.go index 4df3a842..5e2ecd54 100644 --- a/x/tokens/handler_test.go +++ b/x/tokens/handler_test.go @@ -7,6 +7,7 @@ import ( "testing" "time" + "cosmossdk.io/math" simapp "github.com/KiraCore/sekai/app" appparams "github.com/KiraCore/sekai/app/params" "github.com/KiraCore/sekai/x/gov" @@ -68,8 +69,10 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { require.NoError(t, err) return tokenstypes.NewMsgUpsertTokenInfo( addr, + "adr20", "finney", sdk.NewDecWithPrec(1, 3), // 0.001 true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -78,6 +81,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { "Ethereum", "icon", 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, }, @@ -86,8 +90,10 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { 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, @@ -96,6 +102,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { "Ethereum", "icon", 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, handlerErr: "PERMISSION_UPSERT_TOKEN_RATE: not enough permissions", @@ -105,8 +112,10 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { 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, @@ -115,6 +124,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { "Ethereum", "icon", 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, handlerErr: "rate should be positive", @@ -126,8 +136,10 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { require.NoError(t, err) return tokenstypes.NewMsgUpsertTokenInfo( addr, + "adr20", "ukex", sdk.NewDec(10), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -136,6 +148,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { "Ethereum", "icon", 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, handlerErr: "bond denom rate is read-only", @@ -178,13 +191,16 @@ func TestHandler_CreateProposalUpsertTokenInfo_Errors(t *testing.T) { "Proposer does not have Perm", 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.PermCreateUpsertTokenInfoProposal.String()), @@ -229,13 +245,16 @@ func TestHandler_CreateProposalUpsertTokenInfo(t *testing.T) { handler := gov.NewHandler(app.CustomGovKeeper) 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) @@ -256,13 +275,16 @@ func TestHandler_CreateProposalUpsertTokenInfo(t *testing.T) { "some desc", 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/msg_server.go b/x/tokens/keeper/msg_server.go index 051816a1..1b61d4dc 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -37,18 +37,39 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } - isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenInfo) - if !isAllowed { - tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) - if tokenInfo == nil || tokenInfo.Owner != msg.Proposer.String() || tokenInfo.OwnerEditDisabled { + 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 + 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.PermUpsertTokenInfo.String()) } err = k.keeper.UpsertTokenInfo(ctx, types.NewTokenInfo( msg.Denom, - msg.Rate, + msg.TokenType, + msg.FeeRate, msg.FeeEnabled, + msg.Supply, + msg.SupplyCap, msg.StakeCap, msg.StakeMin, msg.StakeEnabled, @@ -57,6 +78,15 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo 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()) @@ -67,7 +97,7 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo 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.AttributeKeyFeeRate, msg.FeeRate.String()), sdk.NewAttribute(types.AttributeKeyFeeEnabled, fmt.Sprintf("%t", msg.FeeEnabled)), ), ) diff --git a/x/tokens/proposal_handler.go b/x/tokens/proposal_handler.go index 37b1c292..525af416 100644 --- a/x/tokens/proposal_handler.go +++ b/x/tokens/proposal_handler.go @@ -23,11 +23,28 @@ func (a ApplyUpsertTokenInfosProposalHandler) ProposalType() string { func (a ApplyUpsertTokenInfosProposalHandler) Apply(ctx sdk.Context, proposalID uint64, proposal types.Content, slash sdk.Dec) error { p := proposal.(*tokenstypes.ProposalUpsertTokenInfo) - rate := tokenstypes.NewTokenInfo( - p.Denom, p.Rate, p.FeeEnabled, p.StakeCap, p.StakeMin, p.StakeEnabled, p.Inactive, + 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) + } + + 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, - ) - return a.keeper.UpsertTokenInfo(ctx, rate) + 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/events.go b/x/tokens/types/events.go index f2452088..2b268f53 100644 --- a/x/tokens/types/events.go +++ b/x/tokens/types/events.go @@ -6,7 +6,7 @@ const ( AttributeKeyDescription = "description" AttributeKeyDenom = "denom" - AttributeKeyRate = "rate" + AttributeKeyFeeRate = "fee_rate" AttributeKeyFeeEnabled = "fee_enabled" AttributeKeyProposer = "proposer" AttributeKeySymbol = "symbol" diff --git a/x/tokens/types/genesis.go b/x/tokens/types/genesis.go index 0fefe2ef..87cf7bc9 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" ) @@ -11,10 +12,10 @@ import ( func DefaultGenesis() *GenesisState { return &GenesisState{ TokenInfos: []TokenInfo{ - NewTokenInfo("ukex", sdk.NewDec(1), true, sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false, "KEX", "KEX", "", 6), // 1 - NewTokenInfo("ubtc", sdk.NewDec(10), true, sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false, "BTC", "Bitcoin", "", 9), // 10 - NewTokenInfo("xeth", sdk.NewDecWithPrec(1, 1), true, sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false, "ETH", "Ethereum", "", 18), // 0.1 - NewTokenInfo("frozen", sdk.NewDecWithPrec(1, 1), true, sdk.ZeroDec(), sdk.OneInt(), false, false, "FROZEN", "FROZEN", "", 6), // 0.1 + 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 }, TokenBlackWhites: TokensWhiteBlack{ Whitelisted: []string{"ukex"}, diff --git a/x/tokens/types/msg_token_info.go b/x/tokens/types/msg_token_info.go index 5ecdaec0..ea4ab2dc 100644 --- a/x/tokens/types/msg_token_info.go +++ b/x/tokens/types/msg_token_info.go @@ -3,6 +3,7 @@ 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" @@ -16,30 +17,54 @@ var ( func NewMsgUpsertTokenInfo( proposer sdk.AccAddress, denom string, - rate sdk.Dec, + tokenType string, + feeRate math.LegacyDec, feeEnabled bool, - stakeCap sdk.Dec, - stakeMin sdk.Int, + 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, - Rate: rate, - FeeEnabled: feeEnabled, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeEnabled: stakeEnabled, - Inactive: inactive, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + 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, } } @@ -59,7 +84,7 @@ func (m *MsgUpsertTokenInfo) ValidateBasic() error { return errors.New("bond denom rate is read-only") } - if m.Rate.LTE(sdk.NewDec(0)) { // not positive + if !m.FeeRate.IsPositive() { // not positive return errors.New("rate should be positive") } diff --git a/x/tokens/types/proposal.go b/x/tokens/types/proposal.go index 81ab5cea..5287fff1 100644 --- a/x/tokens/types/proposal.go +++ b/x/tokens/types/proposal.go @@ -3,6 +3,7 @@ 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" @@ -15,29 +16,53 @@ var ( func NewUpsertTokenInfosProposal( denom string, - rate sdk.Dec, + tokenType string, + feeRate math.LegacyDec, feeEnabled bool, - stakeCap sdk.Dec, - stakeMin sdk.Int, + 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, ) *ProposalUpsertTokenInfo { return &ProposalUpsertTokenInfo{ - Denom: denom, - Rate: rate, - FeeEnabled: feeEnabled, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeEnabled: stakeEnabled, - Inactive: inactive, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + 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/tokens/types/proposal.pb.go b/x/tokens/types/proposal.pb.go index 6e02ba4a..a733fa29 100644 --- a/x/tokens/types/proposal.pb.go +++ b/x/tokens/types/proposal.pb.go @@ -26,17 +26,29 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ProposalUpsertTokenInfo 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"` - FeeEnabled bool `protobuf:"varint,3,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,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"` - StakeEnabled bool `protobuf:"varint,6,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` - Inactive bool `protobuf:"varint,7,opt,name=inactive,proto3" json:"inactive,omitempty"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + 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 *ProposalUpsertTokenInfo) Reset() { *m = ProposalUpsertTokenInfo{} } @@ -79,6 +91,13 @@ func (m *ProposalUpsertTokenInfo) GetDenom() string { return "" } +func (m *ProposalUpsertTokenInfo) GetTokenType() string { + if m != nil { + return m.TokenType + } + return "" +} + func (m *ProposalUpsertTokenInfo) GetFeeEnabled() bool { if m != nil { return m.FeeEnabled @@ -128,6 +147,62 @@ func (m *ProposalUpsertTokenInfo) GetDecimals() uint32 { return 0 } +func (m *ProposalUpsertTokenInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetSocial() string { + if m != nil { + return m.Social + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetHolders() uint64 { + if m != nil { + return m.Holders + } + return 0 +} + +func (m *ProposalUpsertTokenInfo) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetOwnerEditDisabled() bool { + if m != nil { + return m.OwnerEditDisabled + } + return false +} + +func (m *ProposalUpsertTokenInfo) GetNftMetadata() string { + if m != nil { + return m.NftMetadata + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetNftHash() string { + if m != nil { + return m.NftHash + } + return "" +} + func init() { proto.RegisterType((*ProposalUpsertTokenInfo)(nil), "kira.tokens.ProposalUpsertTokenInfo") } @@ -135,34 +210,46 @@ func init() { func init() { proto.RegisterFile("kira/tokens/proposal.proto", fileDescriptor_68008d794328e180) } var fileDescriptor_68008d794328e180 = []byte{ - // 422 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x8e, 0xd3, 0x40, - 0x10, 0x86, 0xb3, 0x90, 0xcb, 0x25, 0x1b, 0x4e, 0xa0, 0xd5, 0x09, 0x96, 0x14, 0x76, 0x14, 0x24, - 0x94, 0xe6, 0xec, 0x82, 0xee, 0x4a, 0x07, 0x8a, 0x13, 0x42, 0x42, 0x16, 0x34, 0x34, 0xd1, 0xc6, - 0x99, 0x84, 0x95, 0xbd, 0x3b, 0x96, 0x77, 0x41, 0xa4, 0xe7, 0x01, 0x78, 0x04, 0x1e, 0x82, 0x87, - 0x38, 0x51, 0x5d, 0x89, 0x28, 0x22, 0x94, 0x34, 0xd4, 0x3c, 0x01, 0xf2, 0xae, 0x1d, 0xd0, 0x75, - 0xa9, 0x3c, 0xff, 0xf7, 0x7b, 0xe7, 0xd7, 0x8c, 0x86, 0x8e, 0x72, 0x59, 0x89, 0xd8, 0x62, 0x0e, - 0xda, 0xc4, 0x65, 0x85, 0x25, 0x1a, 0x51, 0x44, 0x65, 0x85, 0x16, 0xd9, 0xb0, 0xf6, 0x22, 0xef, - 0x8d, 0xce, 0xd7, 0xb8, 0x46, 0xc7, 0xe3, 0xba, 0xf2, 0xbf, 0x8c, 0x1e, 0x67, 0x68, 0x14, 0x9a, - 0xb9, 0x37, 0xbc, 0xf0, 0xd6, 0xe4, 0x73, 0x97, 0x3e, 0x7a, 0xdd, 0x34, 0x7c, 0x5b, 0x1a, 0xa8, - 0x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c, 0x66, 0xa8, 0x39, 0xf5, 0xac, 0xae, 0xeb, 0xde, 0x4b, 0xc8, - 0xa4, 0x12, 0x85, 0xe1, 0xc3, 0x31, 0x99, 0x9e, 0xa5, 0x07, 0x7d, 0x79, 0xff, 0xf7, 0xd7, 0x90, - 0x7c, 0xff, 0x76, 0x71, 0x3a, 0x43, 0x6d, 0x41, 0xdb, 0x24, 0xb9, 0xde, 0x05, 0xe4, 0x66, 0x17, - 0x90, 0x5f, 0xbb, 0x80, 0x7c, 0xd9, 0x07, 0x9d, 0x9b, 0x7d, 0xd0, 0xf9, 0xb1, 0x0f, 0x3a, 0xef, - 0xa6, 0xff, 0x6d, 0xe3, 0xa5, 0xac, 0xc4, 0x0c, 0x2b, 0x88, 0x0d, 0xe4, 0x42, 0xc6, 0x9f, 0xda, - 0x8b, 0x74, 0x3b, 0x59, 0xf4, 0xdc, 0x45, 0x3d, 0xfb, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x71, 0xc3, - 0x9d, 0x06, 0xad, 0x02, 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, 0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 0x90, 0xbc, 0x85, 0x46, 0xc6, 0x85, 0xe6, 0x62, 0x1c, 0x26, 0x88, 0x74, 0xf3, + 0x41, 0x87, 0x03, 0x4a, 0x8b, 0x13, 0x44, 0x73, 0xab, 0xe4, 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 *ProposalUpsertTokenInfo) Equal(that interface{}) bool { @@ -187,12 +274,21 @@ func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if this.Denom != that1.Denom { return false } - if !this.Rate.Equal(that1.Rate) { + if this.TokenType != that1.TokenType { + return false + } + if !this.FeeRate.Equal(that1.FeeRate) { return false } if this.FeeEnabled != that1.FeeEnabled { return false } + if !this.Supply.Equal(that1.Supply) { + return false + } + if !this.SupplyCap.Equal(that1.SupplyCap) { + return false + } if !this.StakeCap.Equal(that1.StakeCap) { return false } @@ -217,6 +313,33 @@ func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if this.Decimals != that1.Decimals { 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.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.NftMetadata != that1.NftMetadata { + return false + } + if this.NftHash != that1.NftHash { + return false + } return true } func (m *ProposalUpsertTokenInfo) Marshal() (dAtA []byte, err error) { @@ -239,31 +362,114 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + 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-- + 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 = 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] = 0x58 + 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] = 0x52 + 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] = 0x4a + 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] = 0x42 + dAtA[i] = 0x5a } if m.Inactive { i-- @@ -273,7 +479,7 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x38 + dAtA[i] = 0x50 } if m.StakeEnabled { i-- @@ -283,7 +489,7 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x30 + dAtA[i] = 0x48 } { size := m.StakeMin.Size() @@ -294,7 +500,7 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintProposal(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x42 { size := m.StakeCap.Size() i -= size @@ -304,7 +510,27 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintProposal(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + 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.FeeEnabled { @@ -313,18 +539,25 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) 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) @@ -356,11 +589,19 @@ func (m *ProposalUpsertTokenInfo) Size() (n int) { if l > 0 { n += 1 + l + sovProposal(uint64(l)) } - l = m.Rate.Size() + 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() @@ -386,6 +627,38 @@ func (m *ProposalUpsertTokenInfo) Size() (n int) { if m.Decimals != 0 { n += 1 + sovProposal(uint64(m.Decimals)) } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) + } + l = len(m.Social) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) + } + 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 += 2 + l + sovProposal(uint64(l)) + } + if m.OwnerEditDisabled { + n += 3 + } + l = len(m.NftMetadata) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) + } + l = len(m.NftHash) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) + } return n } @@ -458,7 +731,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -486,11 +759,43 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + 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 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.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } @@ -510,7 +815,75 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.FeeEnabled = bool(v != 0) - case 4: + 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 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.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 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.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) } @@ -544,7 +917,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) } @@ -578,7 +951,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } @@ -598,7 +971,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.StakeEnabled = bool(v != 0) - case 7: + case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } @@ -618,7 +991,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.Inactive = bool(v != 0) - case 8: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } @@ -650,7 +1023,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -682,7 +1055,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } @@ -714,7 +1087,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) } @@ -733,6 +1106,271 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { 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 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 Holders", wireType) + } + m.Holders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 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 OwnerEditDisabled", 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.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/tx.pb.go b/x/tokens/types/tx.pb.go index b68732ac..ece8c92f 100644 --- a/x/tokens/types/tx.pb.go +++ b/x/tokens/types/tx.pb.go @@ -30,18 +30,30 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgUpsertTokenInfo 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"` - FeeEnabled bool `protobuf:"varint,3,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,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"` - StakeEnabled bool `protobuf:"varint,6,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` - Inactive bool `protobuf:"varint,7,opt,name=inactive,proto3" json:"inactive,omitempty"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` - Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,12,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` + 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 *MsgUpsertTokenInfo) Reset() { *m = MsgUpsertTokenInfo{} } @@ -84,6 +96,13 @@ func (m *MsgUpsertTokenInfo) GetDenom() string { return "" } +func (m *MsgUpsertTokenInfo) GetTokenType() string { + if m != nil { + return m.TokenType + } + return "" +} + func (m *MsgUpsertTokenInfo) GetFeeEnabled() bool { if m != nil { return m.FeeEnabled @@ -133,6 +152,62 @@ func (m *MsgUpsertTokenInfo) GetDecimals() uint32 { 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 @@ -290,44 +365,56 @@ func init() { func init() { proto.RegisterFile("kira/tokens/tx.proto", fileDescriptor_9bac5a72e1a3117c) } var fileDescriptor_9bac5a72e1a3117c = []byte{ - // 581 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xb1, 0x6e, 0xdb, 0x3a, - 0x14, 0xb5, 0x5e, 0x1c, 0xc7, 0x66, 0x1c, 0xe4, 0x81, 0x48, 0x1b, 0x42, 0x28, 0x24, 0x43, 0x05, - 0x5a, 0x2f, 0x91, 0x80, 0x76, 0xeb, 0x16, 0x25, 0x19, 0x82, 0xd6, 0x8b, 0x90, 0x2e, 0xed, 0xe0, - 0xd2, 0xd2, 0xb5, 0x2c, 0xd8, 0x22, 0x05, 0x92, 0x29, 0xec, 0x7e, 0x45, 0x3f, 0xa5, 0x9f, 0x91, - 0x31, 0x63, 0xd1, 0xc1, 0x28, 0x92, 0x3f, 0xc8, 0xd8, 0xa9, 0x20, 0x25, 0x39, 0x4e, 0x82, 0xa2, - 0xcd, 0xa4, 0x7b, 0xcf, 0x21, 0xef, 0xf1, 0x21, 0x0f, 0x8d, 0xf6, 0xa6, 0x99, 0xa0, 0x81, 0xe2, - 0x53, 0x60, 0x32, 0x50, 0x73, 0xbf, 0x10, 0x5c, 0x71, 0xbc, 0xad, 0x51, 0xbf, 0x44, 0xed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 0xab, 0x6f, 0x16, 0xda, - 0x18, 0xc8, 0x14, 0x7f, 0x44, 0xbb, 0xf7, 0x73, 0xef, 0xfa, 0x6b, 0x2f, 0xd0, 0x7f, 0x68, 0xc3, - 0x7e, 0xf9, 0x97, 0x05, 0xb5, 0x08, 0x7e, 0x87, 0xd0, 0x9a, 0x49, 0xfb, 0xfe, 0xb6, 0x5b, 0xce, - 0xf6, 0xfe, 0xcc, 0xd5, 0xd3, 0xc2, 0xf0, 0xe2, 0xca, 0xb1, 0x2e, 0xaf, 0x1c, 0xeb, 0xe7, 0x95, - 0x63, 0x7d, 0xbd, 0x76, 0x1a, 0x97, 0xd7, 0x4e, 0xe3, 0xfb, 0xb5, 0xd3, 0xf8, 0xd0, 0x5f, 0xbb, - 0xa6, 0xb7, 0x99, 0xa0, 0x47, 0x5c, 0x40, 0x20, 0x61, 0x4a, 0xb3, 0x60, 0xbe, 0xfa, 0x2b, 0xd0, - 0x97, 0x35, 0x6a, 0x99, 0x17, 0xff, 0xfa, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xf8, 0xe0, - 0x45, 0x7b, 0x04, 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, 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x5e, 0xe6, 0x17, 0x2b, 0x72, + 0x0a, 0x87, 0x7a, 0xe5, 0x1c, 0xc5, 0x99, 0x4d, 0x43, 0xaf, 0xac, 0x9d, 0x98, 0x07, 0x43, 0x91, + 0x60, 0x59, 0x39, 0x4d, 0x95, 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. @@ -475,33 +562,118 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Proposer) i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) i-- - dAtA[i] = 0x62 + 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] = 0x58 + 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] = 0x52 + 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] = 0x4a + 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] = 0x42 + dAtA[i] = 0x5a } if m.Inactive { i-- @@ -511,7 +683,7 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x38 + dAtA[i] = 0x50 } if m.StakeEnabled { i-- @@ -521,7 +693,7 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x30 + dAtA[i] = 0x48 } { size := m.StakeMin.Size() @@ -532,7 +704,7 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x42 { size := m.StakeCap.Size() i -= size @@ -542,7 +714,27 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + 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 { @@ -551,18 +743,25 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 = encodeVarintTx(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 = 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) @@ -691,11 +890,19 @@ func (m *MsgUpsertTokenInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Rate.Size() + 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() @@ -721,10 +928,42 @@ func (m *MsgUpsertTokenInfo) Size() (n int) { if m.Decimals != 0 { n += 1 + sovTx(uint64(m.Decimals)) } - l = len(m.Proposer) + 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 } @@ -840,7 +1079,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -868,11 +1107,43 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + 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 3: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } @@ -892,7 +1163,75 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.FeeEnabled = bool(v != 0) - case 4: + 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) } @@ -926,7 +1265,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) } @@ -960,7 +1299,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } @@ -980,7 +1319,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.StakeEnabled = bool(v != 0) - case 7: + case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } @@ -1000,7 +1339,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.Inactive = bool(v != 0) - case 8: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } @@ -1032,7 +1371,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -1064,7 +1403,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } @@ -1096,7 +1435,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) } @@ -1115,7 +1454,272 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - case 12: + 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) } diff --git a/x/tokens/types/types.go b/x/tokens/types/types.go index c76baef9..fe9c8ba1 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -1,34 +1,58 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" ) // NewTokenInfo generates a new token rate struct. func NewTokenInfo( denom string, - feeRate sdk.Dec, + tokenType string, + feeRate math.LegacyDec, feeEnabled bool, - stakeCap sdk.Dec, - stakeMin sdk.Int, + 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, ) TokenInfo { return TokenInfo{ - Denom: denom, - FeeRate: feeRate, - FeeEnabled: feeEnabled, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeEnabled: stakeEnabled, - Inactive: inactive, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + 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, } } From cb16365ec4ff6e930a051b25c5257f49a2fa316e Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 1 Jul 2024 21:12:00 +0800 Subject: [PATCH 11/14] edge case handling in tokens module and fixing tests --- x/feeprocessing/keeper/keeper_test.go | 31 ++++++++++++++--- x/gov/abci_test.go | 5 +++ x/gov/client/cli/util_test.go | 6 ++-- x/layer2/keeper/msg_server.go | 2 +- x/tokens/client/cli/cli_test.go | 11 +++--- x/tokens/handler_test.go | 49 +++++++++++++-------------- x/tokens/keeper/msg_server.go | 4 +++ x/tokens/keeper/token_info.go | 6 ++-- x/tokens/types/errors.go | 1 + x/tokens/types/types.go | 7 ++++ 10 files changed, 81 insertions(+), 41 deletions(-) diff --git a/x/feeprocessing/keeper/keeper_test.go b/x/feeprocessing/keeper/keeper_test.go index 02e92992..743e101a 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" @@ -44,7 +45,10 @@ func TestNewKeeper_Executions(t *testing.T) { require.True(t, len(executions) == 0) msg1 := tokenstypes.NewMsgUpsertTokenInfo( - addr, "ukex", sdk.NewDec(1), true, + addr, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -53,13 +57,17 @@ func TestNewKeeper_Executions(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg1) executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) require.True(t, len(executions) == 1) msg3 := tokenstypes.NewMsgUpsertTokenInfo( - addr, "ukex", sdk.NewDec(1), true, + addr, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -68,6 +76,7 @@ func TestNewKeeper_Executions(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg3) executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) @@ -178,7 +187,10 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { fees := sdk.Coins{sdk.NewInt64Coin("ukex", 1000)} app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr, authtypes.FeeCollectorName, fees) msg := tokenstypes.NewMsgUpsertTokenInfo( - addr, "ukex", sdk.NewDec(1), true, + addr, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -187,6 +199,7 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg) app.FeeProcessingKeeper.ProcessExecutionFeeReturn(ctx) @@ -214,7 +227,10 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr2, authtypes.FeeCollectorName, fees) app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr3, authtypes.FeeCollectorName, fees) msg2 := tokenstypes.NewMsgUpsertTokenInfo( - addr2, "ukex", sdk.NewDec(1), true, + addr2, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -223,9 +239,13 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) msg3 := tokenstypes.NewMsgUpsertTokenInfo( - addr3, "ukex", sdk.NewDec(1), true, + addr3, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -234,6 +254,7 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg3) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg2) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 4ab19456..022447bd 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" @@ -455,8 +456,11 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { "some desc", tokenstypes.NewUpsertTokenInfosProposal( "btc", + "adr20", sdk.NewDec(1234), false, + sdk.ZeroInt(), + sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -465,6 +469,7 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { "Bitcoin", "", 9, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), time.Now(), time.Now().Add(10*time.Second), diff --git a/x/gov/client/cli/util_test.go b/x/gov/client/cli/util_test.go index 0092608e..2cc2dd0c 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.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/layer2/keeper/msg_server.go b/x/layer2/keeper/msg_server.go index 900dbc4d..16db385c 100644 --- a/x/layer2/keeper/msg_server.go +++ b/x/layer2/keeper/msg_server.go @@ -760,7 +760,7 @@ func (k msgServer) MintCreateNftTx(goCtx context.Context, msg *types.MsgMintCrea Description: msg.Description, Website: msg.Website, Social: msg.Social, - Decimals: msg.Decimals, + Decimals: 0, SupplyCap: msg.Cap, Supply: msg.Supply, Holders: msg.Holders, diff --git a/x/tokens/client/cli/cli_test.go b/x/tokens/client/cli/cli_test.go index feafbcf3..e4cefd2e 100644 --- a/x/tokens/client/cli/cli_test.go +++ b/x/tokens/client/cli/cli_test.go @@ -76,8 +76,10 @@ func (s *IntegrationTestSuite) TestUpsertTokenInfoAndQuery() { _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), 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=%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()), @@ -119,10 +121,11 @@ func (s IntegrationTestSuite) TestCreateProposalUpsertTokenInfo() { 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", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), diff --git a/x/tokens/handler_test.go b/x/tokens/handler_test.go index 5e2ecd54..1339f5f1 100644 --- a/x/tokens/handler_test.go +++ b/x/tokens/handler_test.go @@ -52,7 +52,6 @@ func setPermissionToAddr(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context, ad } func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { - app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) handler := tokens.NewHandler(app.TokensKeeper, app.CustomGovKeeper) @@ -129,30 +128,30 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { }, handlerErr: "rate should be positive", }, - { - 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", - }, + // { + // 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) diff --git a/x/tokens/keeper/msg_server.go b/x/tokens/keeper/msg_server.go index 1b61d4dc..001f4b22 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -46,6 +46,10 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo 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 diff --git a/x/tokens/keeper/token_info.go b/x/tokens/keeper/token_info.go index 3b3ae4a4..92d702b4 100644 --- a/x/tokens/keeper/token_info.go +++ b/x/tokens/keeper/token_info.go @@ -60,9 +60,9 @@ 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.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 diff --git a/x/tokens/types/errors.go b/x/tokens/types/errors.go index 3e38aa7e..97245f97 100644 --- a/x/tokens/types/errors.go +++ b/x/tokens/types/errors.go @@ -10,4 +10,5 @@ var ( 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/types.go b/x/tokens/types/types.go index fe9c8ba1..5217891a 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -30,6 +30,13 @@ func NewTokenInfo( nftMetadata string, nftHash string, ) TokenInfo { + if tokenType == "adr43" { + decimals = 0 + } + if tokenType == "adr20" { + nftHash = "" + nftMetadata = "" + } return TokenInfo{ Denom: denom, TokenType: tokenType, From cb6dca43c60dbff76f4ac3693bc0bb074d2a098c Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 2 Jul 2024 23:10:13 +0800 Subject: [PATCH 12/14] resolve unit test and unhandled errors --- app/ante/ante_test.go | 13 +++++++------ x/layer2/keeper/keeper.go | 1 + x/layer2/keeper/lp_swap_redeem_convert_test.go | 10 +++++----- x/tokens/client/cli/cli_test.go | 7 +++++++ x/tokens/client/cli/tx.go | 4 ++++ 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index ce5f14a4..31109cb9 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" @@ -557,17 +558,17 @@ func (suite *AnteTestSuite) TestPoorNetworkManagementDecorator() { msgs := []sdk.Msg{ 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/x/layer2/keeper/keeper.go b/x/layer2/keeper/keeper.go index 582d3b00..e4fc315e 100644 --- a/x/layer2/keeper/keeper.go +++ b/x/layer2/keeper/keeper.go @@ -34,6 +34,7 @@ func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, sk: sk, gk: gk, spk: spk, + tk: tk, } } diff --git a/x/layer2/keeper/lp_swap_redeem_convert_test.go b/x/layer2/keeper/lp_swap_redeem_convert_test.go index 21a87915..70899459 100644 --- a/x/layer2/keeper/lp_swap_redeem_convert_test.go +++ b/x/layer2/keeper/lp_swap_redeem_convert_test.go @@ -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) @@ -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/tokens/client/cli/cli_test.go b/x/tokens/client/cli/cli_test.go index e4cefd2e..999c2fac 100644 --- a/x/tokens/client/cli/cli_test.go +++ b/x/tokens/client/cli/cli_test.go @@ -75,10 +75,12 @@ func (s *IntegrationTestSuite) TestUpsertTokenInfoAndQuery() { 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=%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), @@ -126,6 +128,11 @@ func (s IntegrationTestSuite) TestCreateProposalUpsertTokenInfo() { fmt.Sprintf("--%s=%s", cli.FlagDescription, "some desc"), 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), diff --git a/x/tokens/client/cli/tx.go b/x/tokens/client/cli/tx.go index f7a121f0..475cfc59 100644 --- a/x/tokens/client/cli/tx.go +++ b/x/tokens/client/cli/tx.go @@ -309,6 +309,9 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { 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 { @@ -513,6 +516,7 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { 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) From eb8b94154cb6b7e661b989251426d7aca654a4ca Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 8 Jul 2024 20:33:41 +0800 Subject: [PATCH 13/14] add release notes for v0.4.0 --- RELEASE.md | 5 ++--- types/constants.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 9d859049..b52b8433 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,4 @@ 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) +- Fix storeKeys for layer2 and recovery modules diff --git a/types/constants.go b/types/constants.go index bc4b930d..9adeb98b 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" ) From 1d71b6c19a17eab520af5c724e8694b5578d8a0e Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 8 Jul 2024 20:36:36 +0800 Subject: [PATCH 14/14] update release note --- RELEASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE.md b/RELEASE.md index b52b8433..0e89807a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,5 @@ Features: - Tokens module refactoring (#664) +- Layer2 improvement (#668) - Fix storeKeys for layer2 and recovery modules