Implement ADR 024 - Coin Metadata (#6821)
* Implement ADR 024 - Coin Metadata * Fix lint * Fix proto lint * Index metadata by denom * Fix test * Fix proto comments * Add GetAllDenomMetaData help method and refactor code accordingly * Add x/bank/keeper/genesis_test.go Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
5676e7293f
commit
5a7e22022c
|
@ -79,3 +79,20 @@ message Supply {
|
||||||
repeated cosmos.Coin total = 1
|
repeated cosmos.Coin total = 1
|
||||||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DenomUnits represents a struct that describes different
|
||||||
|
// denominations units of the basic token
|
||||||
|
message DenomUnits {
|
||||||
|
string denom = 1;
|
||||||
|
uint32 exponent = 2;
|
||||||
|
repeated string aliases = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Metadata represents a struct that describes
|
||||||
|
// a basic token
|
||||||
|
message Metadata {
|
||||||
|
string description = 1;
|
||||||
|
repeated DenomUnits denom_units = 2;
|
||||||
|
string base = 3;
|
||||||
|
string display = 4;
|
||||||
|
}
|
|
@ -119,7 +119,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs
|
||||||
}
|
}
|
||||||
|
|
||||||
// update total supply
|
// update total supply
|
||||||
bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply)
|
bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{})
|
||||||
genesisState[banktypes.ModuleName] = app.Codec().MustMarshalJSON(bankGenesis)
|
genesisState[banktypes.ModuleName] = app.Codec().MustMarshalJSON(bankGenesis)
|
||||||
|
|
||||||
stateBytes, err := codec.MarshalJSONIndent(app.Codec(), genesisState)
|
stateBytes, err := codec.MarshalJSONIndent(app.Codec(), genesisState)
|
||||||
|
@ -158,7 +158,7 @@ func SetupWithGenesisAccounts(genAccs []authtypes.GenesisAccount, balances ...ba
|
||||||
totalSupply = totalSupply.Add(b.Coins...)
|
totalSupply = totalSupply.Add(b.Coins...)
|
||||||
}
|
}
|
||||||
|
|
||||||
bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply)
|
bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{})
|
||||||
genesisState[banktypes.ModuleName] = app.Codec().MustMarshalJSON(bankGenesis)
|
genesisState[banktypes.ModuleName] = app.Codec().MustMarshalJSON(bankGenesis)
|
||||||
|
|
||||||
stateBytes, err := codec.MarshalJSONIndent(app.Codec(), genesisState)
|
stateBytes, err := codec.MarshalJSONIndent(app.Codec(), genesisState)
|
||||||
|
|
|
@ -0,0 +1,212 @@
|
||||||
|
{
|
||||||
|
"genesis_time": "2020-07-18T22:22:09.286222793Z",
|
||||||
|
"chain_id": "123",
|
||||||
|
"consensus_params": {
|
||||||
|
"block": {
|
||||||
|
"max_bytes": "22020096",
|
||||||
|
"max_gas": "-1",
|
||||||
|
"time_iota_ms": "1000"
|
||||||
|
},
|
||||||
|
"evidence": {
|
||||||
|
"max_age_num_blocks": "100000",
|
||||||
|
"max_age_duration": "172800000000000"
|
||||||
|
},
|
||||||
|
"validator": {
|
||||||
|
"pub_key_types": [
|
||||||
|
"ed25519"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"app_hash": "",
|
||||||
|
"app_state": {
|
||||||
|
"bank": {
|
||||||
|
"params": {
|
||||||
|
"default_send_enabled": true
|
||||||
|
},
|
||||||
|
"balances": [ {"address": "cosmos106vrzv5xkheqhjm023pxcxlqmcjvuhtfyachz4",
|
||||||
|
"coins": [
|
||||||
|
{
|
||||||
|
"denom": "nametoken",
|
||||||
|
"amount": "1000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"denom": "stake",
|
||||||
|
"amount": "100000000"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{ "address": "cosmos1xztun2634zplhajda7tmjaxy488qj44n765t58",
|
||||||
|
"coins": [
|
||||||
|
{
|
||||||
|
"denom": "nametoken",
|
||||||
|
"amount": "1000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"denom": "stake",
|
||||||
|
"amount": "100000000"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"supply": [],
|
||||||
|
"denom_metadata": [{
|
||||||
|
"description": "The native staking token of the Cosmos Hub.",
|
||||||
|
"denom_units": [ {
|
||||||
|
"denom": "uatom",
|
||||||
|
"exponent": 0,
|
||||||
|
"aliases": [
|
||||||
|
"microatom"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"denom": "matom",
|
||||||
|
"exponent": 3,
|
||||||
|
"aliases": [
|
||||||
|
"milliatom"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"denom": "atom",
|
||||||
|
"exponent": 6
|
||||||
|
}],
|
||||||
|
"base": "uatom",
|
||||||
|
"display": "atom"
|
||||||
|
}]
|
||||||
|
|
||||||
|
},
|
||||||
|
"genutil": {
|
||||||
|
"gentxs": []
|
||||||
|
},
|
||||||
|
"capability": {
|
||||||
|
"index": "1",
|
||||||
|
"owners": []
|
||||||
|
},
|
||||||
|
"mint": {
|
||||||
|
"minter": {
|
||||||
|
"inflation": "0.130000000000000000",
|
||||||
|
"annual_provisions": "0.000000000000000000"
|
||||||
|
},
|
||||||
|
"params": {
|
||||||
|
"mint_denom": "stake",
|
||||||
|
"inflation_rate_change": "0.130000000000000000",
|
||||||
|
"inflation_max": "0.200000000000000000",
|
||||||
|
"inflation_min": "0.070000000000000000",
|
||||||
|
"goal_bonded": "0.670000000000000000",
|
||||||
|
"blocks_per_year": "6311520"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ibc": {
|
||||||
|
"client_genesis": {
|
||||||
|
"clients": [],
|
||||||
|
"clients_consensus": [],
|
||||||
|
"create_localhost": true
|
||||||
|
},
|
||||||
|
"connection_genesis": {
|
||||||
|
"connections": [],
|
||||||
|
"client_connection_paths": []
|
||||||
|
},
|
||||||
|
"channel_genesis": {
|
||||||
|
"channels": [],
|
||||||
|
"acknowledgements": [],
|
||||||
|
"commitments": [],
|
||||||
|
"send_sequences": [],
|
||||||
|
"recv_sequences": [],
|
||||||
|
"ack_sequences": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"upgrade": {},
|
||||||
|
"evidence": {
|
||||||
|
"evidence": []
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"params": {
|
||||||
|
"max_memo_characters": "256",
|
||||||
|
"tx_sig_limit": "7",
|
||||||
|
"tx_size_cost_per_byte": "10",
|
||||||
|
"sig_verify_cost_ed25519": "590",
|
||||||
|
"sig_verify_cost_secp256k1": "1000"
|
||||||
|
},
|
||||||
|
"accounts": []
|
||||||
|
},
|
||||||
|
"gov": {
|
||||||
|
"starting_proposal_id": "1",
|
||||||
|
"deposits": null,
|
||||||
|
"votes": null,
|
||||||
|
"proposals": null,
|
||||||
|
"deposit_params": {
|
||||||
|
"min_deposit": [
|
||||||
|
{
|
||||||
|
"denom": "stake",
|
||||||
|
"amount": "10000000"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"max_deposit_period": "172800000000000"
|
||||||
|
},
|
||||||
|
"voting_params": {
|
||||||
|
"voting_period": "172800000000000"
|
||||||
|
},
|
||||||
|
"tally_params": {
|
||||||
|
"quorum": "0.334000000000000000",
|
||||||
|
"threshold": "0.500000000000000000",
|
||||||
|
"veto": "0.334000000000000000"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"params": null,
|
||||||
|
"transfer": {
|
||||||
|
"port_id": "transfer"
|
||||||
|
},
|
||||||
|
"crisis": {
|
||||||
|
"constant_fee": {
|
||||||
|
"denom": "stake",
|
||||||
|
"amount": "1000"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"distribution": {
|
||||||
|
"params": {
|
||||||
|
"community_tax": "0.020000000000000000",
|
||||||
|
"base_proposer_reward": "0.010000000000000000",
|
||||||
|
"bonus_proposer_reward": "0.040000000000000000",
|
||||||
|
"withdraw_addr_enabled": true
|
||||||
|
},
|
||||||
|
"fee_pool": {
|
||||||
|
"community_pool": []
|
||||||
|
},
|
||||||
|
"delegator_withdraw_infos": [],
|
||||||
|
"previous_proposer": "",
|
||||||
|
"outstanding_rewards": [],
|
||||||
|
"validator_accumulated_commissions": [],
|
||||||
|
"validator_historical_rewards": [],
|
||||||
|
"validator_current_rewards": [],
|
||||||
|
"delegator_starting_infos": [],
|
||||||
|
"validator_slash_events": []
|
||||||
|
},
|
||||||
|
"slashing": {
|
||||||
|
"params": {
|
||||||
|
"signed_blocks_window": "100",
|
||||||
|
"min_signed_per_window": "0.500000000000000000",
|
||||||
|
"downtime_jail_duration": "600000000000",
|
||||||
|
"slash_fraction_double_sign": "0.050000000000000000",
|
||||||
|
"slash_fraction_downtime": "0.010000000000000000"
|
||||||
|
},
|
||||||
|
"signing_infos": {},
|
||||||
|
"missed_blocks": {}
|
||||||
|
},
|
||||||
|
"staking": {
|
||||||
|
"params": {
|
||||||
|
"unbonding_time": "1814400000000000",
|
||||||
|
"max_validators": 100,
|
||||||
|
"max_entries": 7,
|
||||||
|
"historical_entries": 100,
|
||||||
|
"bond_denom": "stake"
|
||||||
|
},
|
||||||
|
"last_total_power": "0",
|
||||||
|
"last_validator_powers": null,
|
||||||
|
"validators": null,
|
||||||
|
"delegations": null,
|
||||||
|
"unbonding_delegations": null,
|
||||||
|
"redelegations": null,
|
||||||
|
"exported": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -56,5 +56,5 @@ func (k BaseKeeper) ExportGenesis(ctx sdk.Context) types.GenesisState {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewGenesisState(k.GetParams(ctx), balances, k.GetSupply(ctx).GetTotal())
|
return types.NewGenesisState(k.GetParams(ctx), balances, k.GetSupply(ctx).GetTotal(), k.GetAllDenomMetaData(ctx))
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package keeper_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (suite *IntegrationTestSuite) TestExportGenesis() {
|
||||||
|
app, ctx := suite.app, suite.ctx
|
||||||
|
|
||||||
|
expectedMetadata := suite.getTestMetadata()
|
||||||
|
expectedBalances := suite.getTestBalances()
|
||||||
|
for i := range []int{1, 2} {
|
||||||
|
app.BankKeeper.SetDenomMetaData(ctx, expectedMetadata[i])
|
||||||
|
err := app.BankKeeper.SetBalances(ctx, expectedBalances[i].Address, expectedBalances[i].Coins)
|
||||||
|
suite.Require().NoError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
totalSupply := types.NewSupply(sdk.NewCoins(sdk.NewInt64Coin("test", 400000000)))
|
||||||
|
app.BankKeeper.SetSupply(ctx, totalSupply)
|
||||||
|
app.BankKeeper.SetParams(ctx, types.DefaultParams())
|
||||||
|
|
||||||
|
exportGenesis := app.BankKeeper.ExportGenesis(ctx)
|
||||||
|
|
||||||
|
suite.Require().Len(exportGenesis.Params.SendEnabled, 0)
|
||||||
|
suite.Require().Equal(types.DefaultParams().DefaultSendEnabled, exportGenesis.Params.DefaultSendEnabled)
|
||||||
|
suite.Require().Equal(totalSupply.GetTotal(), exportGenesis.Supply)
|
||||||
|
suite.Require().Equal(expectedBalances, exportGenesis.Balances)
|
||||||
|
suite.Require().Equal(expectedMetadata, exportGenesis.DenomMetadata)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (suite *IntegrationTestSuite) getTestBalances() []types.Balance {
|
||||||
|
addr2, _ := sdk.AccAddressFromBech32("cosmos1f9xjhxm0plzrh9cskf4qee4pc2xwp0n0556gh0")
|
||||||
|
addr1, _ := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh")
|
||||||
|
return []types.Balance{
|
||||||
|
{addr2, sdk.Coins{sdk.NewInt64Coin("testcoin1", 32), sdk.NewInt64Coin("testcoin2", 34)}},
|
||||||
|
{addr1, sdk.Coins{sdk.NewInt64Coin("testcoin3", 10)}},
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
"github.com/cosmos/cosmos-sdk/store/prefix"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
@ -27,6 +28,10 @@ type Keeper interface {
|
||||||
GetSupply(ctx sdk.Context) exported.SupplyI
|
GetSupply(ctx sdk.Context) exported.SupplyI
|
||||||
SetSupply(ctx sdk.Context, supply exported.SupplyI)
|
SetSupply(ctx sdk.Context, supply exported.SupplyI)
|
||||||
|
|
||||||
|
GetDenomMetaData(ctx sdk.Context, denom string) types.Metadata
|
||||||
|
SetDenomMetaData(ctx sdk.Context, denomMetaData types.Metadata)
|
||||||
|
IterateAllDenomMetaData(ctx sdk.Context, cb func(types.Metadata) bool)
|
||||||
|
|
||||||
SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
|
SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
|
||||||
SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error
|
SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error
|
||||||
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
|
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
|
||||||
|
@ -175,6 +180,59 @@ func (k BaseKeeper) SetSupply(ctx sdk.Context, supply exported.SupplyI) {
|
||||||
store.Set(types.SupplyKey, bz)
|
store.Set(types.SupplyKey, bz)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDenomMetaData retrieves the denomination metadata
|
||||||
|
func (k BaseKeeper) GetDenomMetaData(ctx sdk.Context, denom string) types.Metadata {
|
||||||
|
store := ctx.KVStore(k.storeKey)
|
||||||
|
store = prefix.NewStore(store, types.DenomMetadataKey(denom))
|
||||||
|
|
||||||
|
bz := store.Get([]byte(denom))
|
||||||
|
|
||||||
|
var metadata types.Metadata
|
||||||
|
k.cdc.MustUnmarshalBinaryBare(bz, &metadata)
|
||||||
|
|
||||||
|
return metadata
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetAllDenomMetaData retrieves all denominations metadata
|
||||||
|
func (k BaseKeeper) GetAllDenomMetaData(ctx sdk.Context) []types.Metadata {
|
||||||
|
denomMetaData := make([]types.Metadata, 0)
|
||||||
|
k.IterateAllDenomMetaData(ctx, func(metadata types.Metadata) bool {
|
||||||
|
denomMetaData = append(denomMetaData, metadata)
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
|
return denomMetaData
|
||||||
|
}
|
||||||
|
|
||||||
|
// IterateAllDenomMetaData iterates over all the denominations metadata and
|
||||||
|
// provides the metadata to a callback. If true is returned from the
|
||||||
|
// callback, iteration is halted.
|
||||||
|
func (k BaseKeeper) IterateAllDenomMetaData(ctx sdk.Context, cb func(types.Metadata) bool) {
|
||||||
|
store := ctx.KVStore(k.storeKey)
|
||||||
|
denomMetaDataStore := prefix.NewStore(store, types.DenomMetadataPrefix)
|
||||||
|
|
||||||
|
iterator := denomMetaDataStore.Iterator(nil, nil)
|
||||||
|
defer iterator.Close()
|
||||||
|
|
||||||
|
for ; iterator.Valid(); iterator.Next() {
|
||||||
|
var metadata types.Metadata
|
||||||
|
k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &metadata)
|
||||||
|
|
||||||
|
if cb(metadata) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDenomMetaData sets the denominations metadata
|
||||||
|
func (k BaseKeeper) SetDenomMetaData(ctx sdk.Context, denomMetaData types.Metadata) {
|
||||||
|
store := ctx.KVStore(k.storeKey)
|
||||||
|
denomMetaDataStore := prefix.NewStore(store, types.DenomMetadataKey(denomMetaData.Base))
|
||||||
|
|
||||||
|
m := k.cdc.MustMarshalBinaryBare(&denomMetaData)
|
||||||
|
denomMetaDataStore.Set([]byte(denomMetaData.Base), m)
|
||||||
|
}
|
||||||
|
|
||||||
// SendCoinsFromModuleToAccount transfers coins from a ModuleAccount to an AccAddress.
|
// SendCoinsFromModuleToAccount transfers coins from a ModuleAccount to an AccAddress.
|
||||||
// It will panic if the module account does not exist.
|
// It will panic if the module account does not exist.
|
||||||
func (k BaseKeeper) SendCoinsFromModuleToAccount(
|
func (k BaseKeeper) SendCoinsFromModuleToAccount(
|
||||||
|
|
|
@ -965,6 +965,74 @@ func (suite *IntegrationTestSuite) TestUndelegateCoins_Invalid() {
|
||||||
suite.Require().Error(app.BankKeeper.UndelegateCoins(ctx, addrModule, addr1, delCoins))
|
suite.Require().Error(app.BankKeeper.UndelegateCoins(ctx, addrModule, addr1, delCoins))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (suite *IntegrationTestSuite) TestSetDenomMetaData() {
|
||||||
|
app, ctx := suite.app, suite.ctx
|
||||||
|
|
||||||
|
metadata := suite.getTestMetadata()
|
||||||
|
|
||||||
|
for i := range []int{1, 2} {
|
||||||
|
app.BankKeeper.SetDenomMetaData(ctx, metadata[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
actualMetadata := app.BankKeeper.GetDenomMetaData(ctx, metadata[1].Base)
|
||||||
|
|
||||||
|
suite.Require().Equal(metadata[1].GetBase(), actualMetadata.GetBase())
|
||||||
|
suite.Require().Equal(metadata[1].GetDisplay(), actualMetadata.GetDisplay())
|
||||||
|
suite.Require().Equal(metadata[1].GetDescription(), actualMetadata.GetDescription())
|
||||||
|
suite.Require().Equal(metadata[1].GetDenomUnits()[1].GetDenom(), actualMetadata.GetDenomUnits()[1].GetDenom())
|
||||||
|
suite.Require().Equal(metadata[1].GetDenomUnits()[1].GetExponent(), actualMetadata.GetDenomUnits()[1].GetExponent())
|
||||||
|
suite.Require().Equal(metadata[1].GetDenomUnits()[1].GetAliases(), actualMetadata.GetDenomUnits()[1].GetAliases())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (suite *IntegrationTestSuite) TestIterateAllDenomMetaData() {
|
||||||
|
app, ctx := suite.app, suite.ctx
|
||||||
|
|
||||||
|
expectedMetadata := suite.getTestMetadata()
|
||||||
|
// set metadata
|
||||||
|
for i := range []int{1, 2} {
|
||||||
|
app.BankKeeper.SetDenomMetaData(ctx, expectedMetadata[i])
|
||||||
|
}
|
||||||
|
// retrieve metadata
|
||||||
|
actualMetadata := make([]types.Metadata, 0)
|
||||||
|
app.BankKeeper.IterateAllDenomMetaData(ctx, func(metadata types.Metadata) bool {
|
||||||
|
actualMetadata = append(actualMetadata, metadata)
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
// execute checks
|
||||||
|
for i := range []int{1, 2} {
|
||||||
|
suite.Require().Equal(expectedMetadata[i].GetBase(), actualMetadata[i].GetBase())
|
||||||
|
suite.Require().Equal(expectedMetadata[i].GetDisplay(), actualMetadata[i].GetDisplay())
|
||||||
|
suite.Require().Equal(expectedMetadata[i].GetDescription(), actualMetadata[i].GetDescription())
|
||||||
|
suite.Require().Equal(expectedMetadata[i].GetDenomUnits()[1].GetDenom(), actualMetadata[i].GetDenomUnits()[1].GetDenom())
|
||||||
|
suite.Require().Equal(expectedMetadata[i].GetDenomUnits()[1].GetExponent(), actualMetadata[i].GetDenomUnits()[1].GetExponent())
|
||||||
|
suite.Require().Equal(expectedMetadata[i].GetDenomUnits()[1].GetAliases(), actualMetadata[i].GetDenomUnits()[1].GetAliases())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (suite *IntegrationTestSuite) getTestMetadata() []types.Metadata {
|
||||||
|
return []types.Metadata{{
|
||||||
|
Description: "The native staking token of the Cosmos Hub.",
|
||||||
|
DenomUnits: []*types.DenomUnits{
|
||||||
|
{"uatom", uint32(0), []string{"microatom"}},
|
||||||
|
{"matom", uint32(3), []string{"milliatom"}},
|
||||||
|
{"atom", uint32(6), nil},
|
||||||
|
},
|
||||||
|
Base: "uatom",
|
||||||
|
Display: "atom",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Description: "The native staking token of the Token Hub.",
|
||||||
|
DenomUnits: []*types.DenomUnits{
|
||||||
|
{"1token", uint32(5), []string{"decitoken"}},
|
||||||
|
{"2token", uint32(4), []string{"centitoken"}},
|
||||||
|
{"3token", uint32(7), []string{"dekatoken"}},
|
||||||
|
},
|
||||||
|
Base: "utoken",
|
||||||
|
Display: "token",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestKeeperTestSuite(t *testing.T) {
|
func TestKeeperTestSuite(t *testing.T) {
|
||||||
suite.Run(t, new(IntegrationTestSuite))
|
suite.Run(t, new(IntegrationTestSuite))
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,6 +389,138 @@ func (m *Supply) XXX_DiscardUnknown() {
|
||||||
|
|
||||||
var xxx_messageInfo_Supply proto.InternalMessageInfo
|
var xxx_messageInfo_Supply proto.InternalMessageInfo
|
||||||
|
|
||||||
|
// DenomUnits represents a struct that describes different
|
||||||
|
// denominations units of the basic token
|
||||||
|
type DenomUnits struct {
|
||||||
|
Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
|
||||||
|
Exponent uint32 `protobuf:"varint,2,opt,name=exponent,proto3" json:"exponent,omitempty"`
|
||||||
|
Aliases []string `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DenomUnits) Reset() { *m = DenomUnits{} }
|
||||||
|
func (m *DenomUnits) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*DenomUnits) ProtoMessage() {}
|
||||||
|
func (*DenomUnits) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_717c78e54d4b5794, []int{7}
|
||||||
|
}
|
||||||
|
func (m *DenomUnits) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *DenomUnits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_DenomUnits.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 *DenomUnits) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_DenomUnits.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *DenomUnits) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *DenomUnits) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_DenomUnits.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_DenomUnits proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *DenomUnits) GetDenom() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Denom
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DenomUnits) GetExponent() uint32 {
|
||||||
|
if m != nil {
|
||||||
|
return m.Exponent
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DenomUnits) GetAliases() []string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Aliases
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Metadata represents a struct that describes
|
||||||
|
// a basic token
|
||||||
|
type Metadata struct {
|
||||||
|
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
|
||||||
|
DenomUnits []*DenomUnits `protobuf:"bytes,2,rep,name=denom_units,json=denomUnits,proto3" json:"denom_units,omitempty"`
|
||||||
|
Base string `protobuf:"bytes,3,opt,name=base,proto3" json:"base,omitempty"`
|
||||||
|
Display string `protobuf:"bytes,4,opt,name=display,proto3" json:"display,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Metadata) Reset() { *m = Metadata{} }
|
||||||
|
func (m *Metadata) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*Metadata) ProtoMessage() {}
|
||||||
|
func (*Metadata) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_717c78e54d4b5794, []int{8}
|
||||||
|
}
|
||||||
|
func (m *Metadata) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Metadata.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 *Metadata) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Metadata.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Metadata) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Metadata) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Metadata.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Metadata proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *Metadata) GetDescription() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Description
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Metadata) GetDenomUnits() []*DenomUnits {
|
||||||
|
if m != nil {
|
||||||
|
return m.DenomUnits
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Metadata) GetBase() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Base
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Metadata) GetDisplay() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Display
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*Params)(nil), "cosmos.bank.Params")
|
proto.RegisterType((*Params)(nil), "cosmos.bank.Params")
|
||||||
proto.RegisterType((*SendEnabled)(nil), "cosmos.bank.SendEnabled")
|
proto.RegisterType((*SendEnabled)(nil), "cosmos.bank.SendEnabled")
|
||||||
|
@ -397,49 +529,58 @@ func init() {
|
||||||
proto.RegisterType((*Output)(nil), "cosmos.bank.Output")
|
proto.RegisterType((*Output)(nil), "cosmos.bank.Output")
|
||||||
proto.RegisterType((*MsgMultiSend)(nil), "cosmos.bank.MsgMultiSend")
|
proto.RegisterType((*MsgMultiSend)(nil), "cosmos.bank.MsgMultiSend")
|
||||||
proto.RegisterType((*Supply)(nil), "cosmos.bank.Supply")
|
proto.RegisterType((*Supply)(nil), "cosmos.bank.Supply")
|
||||||
|
proto.RegisterType((*DenomUnits)(nil), "cosmos.bank.DenomUnits")
|
||||||
|
proto.RegisterType((*Metadata)(nil), "cosmos.bank.Metadata")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("cosmos/bank/bank.proto", fileDescriptor_717c78e54d4b5794) }
|
func init() { proto.RegisterFile("cosmos/bank/bank.proto", fileDescriptor_717c78e54d4b5794) }
|
||||||
|
|
||||||
var fileDescriptor_717c78e54d4b5794 = []byte{
|
var fileDescriptor_717c78e54d4b5794 = []byte{
|
||||||
// 583 bytes of a gzipped FileDescriptorProto
|
// 697 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x54, 0x3d, 0x6f, 0xd3, 0x4e,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xcf, 0x6b, 0x13, 0x4d,
|
||||||
0x18, 0xf7, 0xa5, 0xad, 0xd3, 0x5e, 0xb2, 0xfc, 0x2f, 0xd1, 0x5f, 0xa6, 0x12, 0x76, 0xb0, 0x84,
|
0x18, 0xce, 0xa6, 0x69, 0x92, 0xbe, 0xc9, 0x77, 0xf8, 0xa6, 0xe5, 0xfb, 0xd6, 0x82, 0xd9, 0xb8,
|
||||||
0x94, 0x22, 0xe2, 0x14, 0x2a, 0x96, 0x6c, 0x75, 0x55, 0xa0, 0x42, 0x11, 0xc8, 0x45, 0x0c, 0x20,
|
0x20, 0xa4, 0x62, 0x37, 0xd5, 0x22, 0x48, 0x6e, 0x4d, 0xad, 0x5a, 0x24, 0x28, 0x5b, 0x15, 0x51,
|
||||||
0x11, 0x39, 0xf1, 0x35, 0x44, 0xb1, 0x7d, 0x56, 0xee, 0x2c, 0x35, 0xe2, 0x0b, 0x30, 0x32, 0x32,
|
0x30, 0x4c, 0xb2, 0xd3, 0xb8, 0x74, 0x77, 0x67, 0xc9, 0xcc, 0x42, 0x83, 0xff, 0x80, 0x47, 0x0f,
|
||||||
0x66, 0x61, 0x61, 0x02, 0x89, 0x8d, 0x2f, 0x50, 0x89, 0xa5, 0x62, 0x62, 0x32, 0x28, 0x59, 0x98,
|
0x1e, 0x3c, 0xf6, 0xe2, 0xc5, 0x93, 0x82, 0x37, 0xff, 0x81, 0x82, 0x97, 0xe2, 0xc9, 0x53, 0x94,
|
||||||
0x33, 0x32, 0x21, 0xdf, 0x9d, 0xa9, 0x2d, 0x21, 0x54, 0x5e, 0x16, 0x96, 0x28, 0xf7, 0x3c, 0xbf,
|
0xf6, 0xe2, 0x39, 0x47, 0x4f, 0x32, 0x33, 0xbb, 0xcd, 0x2e, 0xa8, 0xd4, 0x1f, 0x17, 0x2f, 0x65,
|
||||||
0xb7, 0x7b, 0xce, 0x77, 0xf0, 0xff, 0x01, 0xa1, 0x01, 0xa1, 0xed, 0xbe, 0x1b, 0x8e, 0xf9, 0x8f,
|
0xdf, 0xf7, 0x7d, 0xde, 0xe7, 0x79, 0xe6, 0x9d, 0xbe, 0x13, 0xf8, 0xaf, 0x4f, 0x99, 0x4f, 0x59,
|
||||||
0x15, 0x4d, 0x08, 0x23, 0xa8, 0x22, 0xea, 0x56, 0x5a, 0xda, 0xac, 0x0f, 0xc9, 0x90, 0xf0, 0x7a,
|
0xb3, 0x87, 0x83, 0x1d, 0xf9, 0xc7, 0x0a, 0x87, 0x94, 0x53, 0x54, 0x51, 0x79, 0x4b, 0xa4, 0x16,
|
||||||
0x3b, 0xfd, 0x27, 0x20, 0x9b, 0x17, 0x04, 0xa4, 0x27, 0x1a, 0x12, 0x2f, 0x5a, 0x35, 0xa9, 0x9a,
|
0x17, 0x06, 0x74, 0x40, 0x65, 0xbe, 0x29, 0xbe, 0x14, 0x64, 0xf1, 0x94, 0x82, 0x74, 0x55, 0x21,
|
||||||
0x2f, 0x9a, 0xef, 0x01, 0x54, 0xef, 0xb9, 0x13, 0x37, 0xa0, 0xe8, 0x31, 0xac, 0x52, 0x1c, 0x7a,
|
0xc6, 0xab, 0xd2, 0x7c, 0xcc, 0x9a, 0x4e, 0x9a, 0xef, 0x34, 0x28, 0xde, 0xc2, 0x43, 0xec, 0x33,
|
||||||
0x3d, 0x1c, 0xba, 0x7d, 0x1f, 0x7b, 0x1a, 0x68, 0xac, 0x34, 0x2b, 0xd7, 0x35, 0x2b, 0x67, 0x6a,
|
0xf4, 0x10, 0xaa, 0x8c, 0x04, 0x4e, 0x97, 0x04, 0xb8, 0xe7, 0x11, 0x47, 0xd7, 0xea, 0x33, 0x8d,
|
||||||
0x1d, 0xe2, 0xd0, 0xdb, 0x17, 0x7d, 0xfb, 0xd2, 0x32, 0x31, 0x2e, 0x4e, 0xdd, 0xc0, 0xef, 0x98,
|
0xca, 0x45, 0xdd, 0x4a, 0x89, 0x5a, 0x5b, 0x24, 0x70, 0x36, 0x54, 0xbd, 0x7d, 0x66, 0x32, 0x36,
|
||||||
0x79, 0xde, 0x55, 0x12, 0x8c, 0x18, 0x0e, 0x22, 0x36, 0x35, 0x9d, 0x0a, 0x3d, 0xc3, 0xa3, 0x47,
|
0x4e, 0x8f, 0xb0, 0xef, 0xb5, 0xcc, 0x74, 0xdf, 0x79, 0xea, 0xbb, 0x9c, 0xf8, 0x21, 0x1f, 0x99,
|
||||||
0xb0, 0xee, 0xe1, 0x23, 0x37, 0xf6, 0x59, 0xaf, 0xe0, 0x53, 0x6a, 0x80, 0xe6, 0xba, 0xbd, 0xb5,
|
0x76, 0x85, 0x4d, 0xf1, 0xe8, 0x01, 0x2c, 0x38, 0x64, 0x1b, 0x47, 0x1e, 0xef, 0x66, 0x74, 0xf2,
|
||||||
0x4c, 0x8c, 0xcb, 0x42, 0xed, 0x47, 0xa8, 0xbc, 0x2a, 0x92, 0x80, 0x5c, 0x98, 0xce, 0xea, 0x8b,
|
0x75, 0xad, 0x51, 0x6e, 0x2f, 0x4d, 0xc6, 0xc6, 0x59, 0xc5, 0xf6, 0x2d, 0x54, 0x9a, 0x15, 0xc5,
|
||||||
0x99, 0xa1, 0x98, 0xb7, 0x60, 0x25, 0x57, 0x44, 0x75, 0xb8, 0xe6, 0xe1, 0x90, 0x04, 0x1a, 0x68,
|
0x80, 0x94, 0x99, 0x56, 0xe1, 0xf9, 0x9e, 0x91, 0x33, 0xaf, 0x41, 0x25, 0x95, 0x44, 0x0b, 0x30,
|
||||||
0x80, 0xe6, 0x86, 0x23, 0x16, 0x48, 0x83, 0xe5, 0x82, 0xb5, 0x93, 0x2d, 0x3b, 0xeb, 0xa9, 0xc8,
|
0xeb, 0x90, 0x80, 0xfa, 0xba, 0x56, 0xd7, 0x1a, 0x73, 0xb6, 0x0a, 0x90, 0x0e, 0xa5, 0x8c, 0xb4,
|
||||||
0x97, 0x99, 0x01, 0xcc, 0x77, 0x25, 0x58, 0xee, 0xd2, 0x61, 0x2a, 0x86, 0xc6, 0xb0, 0x7a, 0x34,
|
0x9d, 0x84, 0xad, 0xb2, 0x20, 0xf9, 0xbc, 0x67, 0x68, 0xe6, 0xdb, 0x3c, 0x94, 0x3a, 0x6c, 0x20,
|
||||||
0x21, 0x41, 0xcf, 0xf5, 0xbc, 0x09, 0xa6, 0x94, 0x8b, 0x55, 0xed, 0xdb, 0xcb, 0xc4, 0xa8, 0x89,
|
0xc8, 0xd0, 0x0e, 0x54, 0xb7, 0x87, 0xd4, 0xef, 0x62, 0xc7, 0x19, 0x12, 0xc6, 0x24, 0x59, 0xb5,
|
||||||
0xbc, 0xf9, 0xae, 0xf9, 0x35, 0x31, 0x5a, 0xc3, 0x11, 0x7b, 0x12, 0xf7, 0xad, 0x01, 0x09, 0xda,
|
0x7d, 0x7d, 0x32, 0x36, 0xe6, 0x95, 0xdf, 0x74, 0xd5, 0xfc, 0x32, 0x36, 0x96, 0x07, 0x2e, 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 0x72, 0x87, 0x70, 0xec, 0x60, 0x8e, 0x51, 0x1d,
|
||||||
|
0x2a, 0x0e, 0x61, 0xfd, 0xa1, 0x1b, 0x72, 0x97, 0x06, 0x31, 0x7d, 0x3a, 0x85, 0x2e, 0x0b, 0x44,
|
||||||
|
0x40, 0xfd, 0x6e, 0x24, 0x9c, 0xc4, 0xf3, 0xfe, 0x3f, 0x33, 0xef, 0xa9, 0x51, 0x1b, 0x9c, 0xa9,
|
||||||
|
0x69, 0x04, 0x85, 0x1e, 0x66, 0x44, 0x9f, 0x91, 0xa4, 0xf2, 0x5b, 0xd8, 0x72, 0x5c, 0x16, 0x7a,
|
||||||
|
0x78, 0xa4, 0x17, 0x64, 0x3a, 0x09, 0xdb, 0xeb, 0xfb, 0x87, 0x35, 0xed, 0xe0, 0xb0, 0xa6, 0x7d,
|
||||||
|
0x3a, 0xac, 0x69, 0x4f, 0x8f, 0x6a, 0xb9, 0x83, 0xa3, 0x5a, 0xee, 0xc3, 0x51, 0x2d, 0x77, 0x7f,
|
||||||
|
0xe9, 0x24, 0x03, 0x94, 0x37, 0xd1, 0x2b, 0xca, 0x5f, 0x87, 0xd5, 0xaf, 0x01, 0x00, 0x00, 0xff,
|
||||||
|
0xff, 0xde, 0xcf, 0x77, 0x95, 0x8a, 0x06, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *SendEnabled) Equal(that interface{}) bool {
|
func (this *SendEnabled) Equal(that interface{}) bool {
|
||||||
|
@ -948,6 +1089,108 @@ func (m *Supply) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *DenomUnits) 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 *DenomUnits) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DenomUnits) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.Aliases) > 0 {
|
||||||
|
for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
i -= len(m.Aliases[iNdEx])
|
||||||
|
copy(dAtA[i:], m.Aliases[iNdEx])
|
||||||
|
i = encodeVarintBank(dAtA, i, uint64(len(m.Aliases[iNdEx])))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if m.Exponent != 0 {
|
||||||
|
i = encodeVarintBank(dAtA, i, uint64(m.Exponent))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
|
}
|
||||||
|
if len(m.Denom) > 0 {
|
||||||
|
i -= len(m.Denom)
|
||||||
|
copy(dAtA[i:], m.Denom)
|
||||||
|
i = encodeVarintBank(dAtA, i, uint64(len(m.Denom)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Metadata) 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 *Metadata) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.Display) > 0 {
|
||||||
|
i -= len(m.Display)
|
||||||
|
copy(dAtA[i:], m.Display)
|
||||||
|
i = encodeVarintBank(dAtA, i, uint64(len(m.Display)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x22
|
||||||
|
}
|
||||||
|
if len(m.Base) > 0 {
|
||||||
|
i -= len(m.Base)
|
||||||
|
copy(dAtA[i:], m.Base)
|
||||||
|
i = encodeVarintBank(dAtA, i, uint64(len(m.Base)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
|
}
|
||||||
|
if len(m.DenomUnits) > 0 {
|
||||||
|
for iNdEx := len(m.DenomUnits) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
{
|
||||||
|
size, err := m.DenomUnits[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintBank(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(m.Description) > 0 {
|
||||||
|
i -= len(m.Description)
|
||||||
|
copy(dAtA[i:], m.Description)
|
||||||
|
i = encodeVarintBank(dAtA, i, uint64(len(m.Description)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
func encodeVarintBank(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintBank(dAtA []byte, offset int, v uint64) int {
|
||||||
offset -= sovBank(v)
|
offset -= sovBank(v)
|
||||||
base := offset
|
base := offset
|
||||||
|
@ -1090,6 +1333,55 @@ func (m *Supply) Size() (n int) {
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *DenomUnits) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.Denom)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovBank(uint64(l))
|
||||||
|
}
|
||||||
|
if m.Exponent != 0 {
|
||||||
|
n += 1 + sovBank(uint64(m.Exponent))
|
||||||
|
}
|
||||||
|
if len(m.Aliases) > 0 {
|
||||||
|
for _, s := range m.Aliases {
|
||||||
|
l = len(s)
|
||||||
|
n += 1 + l + sovBank(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Metadata) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.Description)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovBank(uint64(l))
|
||||||
|
}
|
||||||
|
if len(m.DenomUnits) > 0 {
|
||||||
|
for _, e := range m.DenomUnits {
|
||||||
|
l = e.Size()
|
||||||
|
n += 1 + l + sovBank(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
l = len(m.Base)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovBank(uint64(l))
|
||||||
|
}
|
||||||
|
l = len(m.Display)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovBank(uint64(l))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
func sovBank(x uint64) (n int) {
|
func sovBank(x uint64) (n int) {
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
}
|
}
|
||||||
|
@ -1913,6 +2205,325 @@ func (m *Supply) Unmarshal(dAtA []byte) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (m *DenomUnits) 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 ErrIntOverflowBank
|
||||||
|
}
|
||||||
|
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: DenomUnits: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: DenomUnits: 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 ErrIntOverflowBank
|
||||||
|
}
|
||||||
|
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 ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Denom = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType)
|
||||||
|
}
|
||||||
|
m.Exponent = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowBank
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.Exponent |= uint32(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowBank
|
||||||
|
}
|
||||||
|
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 ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex]))
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipBank(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if skippy < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *Metadata) 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 ErrIntOverflowBank
|
||||||
|
}
|
||||||
|
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: Metadata: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
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 ErrIntOverflowBank
|
||||||
|
}
|
||||||
|
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 ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Description = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field DenomUnits", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowBank
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.DenomUnits = append(m.DenomUnits, &DenomUnits{})
|
||||||
|
if err := m.DenomUnits[len(m.DenomUnits)-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 Base", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowBank
|
||||||
|
}
|
||||||
|
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 ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Base = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 4:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Display", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowBank
|
||||||
|
}
|
||||||
|
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 ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Display = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipBank(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if skippy < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthBank
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func skipBank(dAtA []byte) (n int, err error) {
|
func skipBank(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
|
|
@ -17,6 +17,7 @@ type GenesisState struct {
|
||||||
Params Params `json:"params" yaml:"params"`
|
Params Params `json:"params" yaml:"params"`
|
||||||
Balances []Balance `json:"balances" yaml:"balances"`
|
Balances []Balance `json:"balances" yaml:"balances"`
|
||||||
Supply sdk.Coins `json:"supply" yaml:"supply"`
|
Supply sdk.Coins `json:"supply" yaml:"supply"`
|
||||||
|
DenomMetadata []Metadata `json:"denom_metadata" yaml:"denom_metadata"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Balance defines an account address and balance pair used in the bank module's
|
// Balance defines an account address and balance pair used in the bank module's
|
||||||
|
@ -60,17 +61,18 @@ func ValidateGenesis(data GenesisState) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewGenesisState creates a new genesis state.
|
// NewGenesisState creates a new genesis state.
|
||||||
func NewGenesisState(params Params, balances []Balance, supply sdk.Coins) GenesisState {
|
func NewGenesisState(params Params, balances []Balance, supply sdk.Coins, denomMetaData []Metadata) GenesisState {
|
||||||
return GenesisState{
|
return GenesisState{
|
||||||
Params: params,
|
Params: params,
|
||||||
Balances: balances,
|
Balances: balances,
|
||||||
Supply: supply,
|
Supply: supply,
|
||||||
|
DenomMetadata: denomMetaData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultGenesisState returns a default bank module genesis state.
|
// DefaultGenesisState returns a default bank module genesis state.
|
||||||
func DefaultGenesisState() GenesisState {
|
func DefaultGenesisState() GenesisState {
|
||||||
return NewGenesisState(DefaultParams(), []Balance{}, DefaultSupply().GetTotal())
|
return NewGenesisState(DefaultParams(), []Balance{}, DefaultSupply().GetTotal(), []Metadata{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetGenesisStateFromAppState returns x/bank GenesisState given raw application
|
// GetGenesisStateFromAppState returns x/bank GenesisState given raw application
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
package types_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestMarshalJSONMetaData(t *testing.T) {
|
||||||
|
cdc := codec.New()
|
||||||
|
|
||||||
|
testCases := []struct {
|
||||||
|
name string
|
||||||
|
input []types.Metadata
|
||||||
|
strOutput string
|
||||||
|
}{
|
||||||
|
{"nil metadata", nil, `null`},
|
||||||
|
{"empty metadata", []types.Metadata{}, `[]`},
|
||||||
|
{"non-empty coins", []types.Metadata{{
|
||||||
|
Description: "The native staking token of the Cosmos Hub.",
|
||||||
|
DenomUnits: []*types.DenomUnits{
|
||||||
|
{"uatom", uint32(0), []string{"microatom"}}, // The default exponent value 0 is omitted in the json
|
||||||
|
{"matom", uint32(3), []string{"milliatom"}},
|
||||||
|
{"atom", uint32(6), nil},
|
||||||
|
},
|
||||||
|
Base: "uatom",
|
||||||
|
Display: "atom",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
`[{"description":"The native staking token of the Cosmos Hub.","denom_units":[{"denom":"uatom","aliases":["microatom"]},{"denom":"matom","exponent":3,"aliases":["milliatom"]},{"denom":"atom","exponent":6}],"base":"uatom","display":"atom"}]`},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range testCases {
|
||||||
|
tc := tc
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
bz, err := cdc.MarshalJSON(tc.input)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Equal(t, tc.strOutput, string(bz))
|
||||||
|
|
||||||
|
var newMetadata []types.Metadata
|
||||||
|
require.NoError(t, cdc.UnmarshalJSON(bz, &newMetadata))
|
||||||
|
|
||||||
|
if len(tc.input) == 0 {
|
||||||
|
require.Nil(t, newMetadata)
|
||||||
|
} else {
|
||||||
|
require.Equal(t, tc.input, newMetadata)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,8 +24,15 @@ const (
|
||||||
var (
|
var (
|
||||||
BalancesPrefix = []byte("balances")
|
BalancesPrefix = []byte("balances")
|
||||||
SupplyKey = []byte{0x00}
|
SupplyKey = []byte{0x00}
|
||||||
|
DenomMetadataPrefix = []byte{0x1}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// DenomMetadataKey returns the denomination metadata key.
|
||||||
|
func DenomMetadataKey(denom string) []byte {
|
||||||
|
d := []byte(denom)
|
||||||
|
return append(DenomMetadataPrefix, d...)
|
||||||
|
}
|
||||||
|
|
||||||
// AddressFromBalancesStore returns an account address from a balances prefix
|
// AddressFromBalancesStore returns an account address from a balances prefix
|
||||||
// store. The key must not contain the perfix BalancesPrefix as the prefix store
|
// store. The key must not contain the perfix BalancesPrefix as the prefix store
|
||||||
// iterator discards the actual prefix.
|
// iterator discards the actual prefix.
|
||||||
|
|
|
@ -8,8 +8,10 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
"github.com/cosmos/cosmos-sdk/simapp"
|
"github.com/cosmos/cosmos-sdk/simapp"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
"github.com/cosmos/cosmos-sdk/x/genutil/types"
|
"github.com/cosmos/cosmos-sdk/x/genutil/types"
|
||||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||||
)
|
)
|
||||||
|
@ -69,3 +71,24 @@ func TestValidateGenesisBadMessage(t *testing.T) {
|
||||||
err = types.ValidateGenesis(genesisState, simapp.MakeEncodingConfig().TxConfig.TxJSONDecoder())
|
err = types.ValidateGenesis(genesisState, simapp.MakeEncodingConfig().TxConfig.TxJSONDecoder())
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGenesisStateFromGenFile(t *testing.T) {
|
||||||
|
cdc := codec.New()
|
||||||
|
|
||||||
|
genFile := "../../../tests/fixtures/adr-024-coin-metadata_genesis.json"
|
||||||
|
genesisState, _, err := types.GenesisStateFromGenFile(cdc, genFile)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
var bankGenesis banktypes.GenesisState
|
||||||
|
cdc.MustUnmarshalJSON(genesisState[banktypes.ModuleName], &bankGenesis)
|
||||||
|
|
||||||
|
require.True(t, bankGenesis.Params.DefaultSendEnabled)
|
||||||
|
require.Equal(t, "1000nametoken,100000000stake", bankGenesis.Balances[0].GetCoins().String())
|
||||||
|
require.Equal(t, "cosmos106vrzv5xkheqhjm023pxcxlqmcjvuhtfyachz4", bankGenesis.Balances[0].GetAddress().String())
|
||||||
|
require.Equal(t, "The native staking token of the Cosmos Hub.", bankGenesis.DenomMetadata[0].GetDescription())
|
||||||
|
require.Equal(t, "uatom", bankGenesis.DenomMetadata[0].GetBase())
|
||||||
|
require.Equal(t, "matom", bankGenesis.DenomMetadata[0].GetDenomUnits()[1].GetDenom())
|
||||||
|
require.Equal(t, []string{"milliatom"}, bankGenesis.DenomMetadata[0].GetDenomUnits()[1].GetAliases())
|
||||||
|
require.Equal(t, uint32(3), bankGenesis.DenomMetadata[0].GetDenomUnits()[1].GetExponent())
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -419,14 +419,14 @@ func (m *MsgConnectionOpenConfirm) GetSigner() github_com_cosmos_cosmos_sdk_type
|
||||||
// a connection between two chains.
|
// a connection between two chains.
|
||||||
type ConnectionEnd struct {
|
type ConnectionEnd struct {
|
||||||
// client associated with this connection.
|
// client associated with this connection.
|
||||||
ClientID string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"`
|
ClientID string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"`
|
||||||
// IBC version which can be utilised to determine encodings or protocols for
|
// IBC version which can be utilised to determine encodings or protocols for
|
||||||
// channels or packets utilising this connection
|
// channels or packets utilising this connection
|
||||||
Versions []string `protobuf:"bytes,3,rep,name=versions,proto3" json:"versions,omitempty"`
|
Versions []string `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"`
|
||||||
// current state of the connection end.
|
// current state of the connection end.
|
||||||
State State `protobuf:"varint,4,opt,name=state,proto3,enum=ibc.connection.State" json:"state,omitempty"`
|
State State `protobuf:"varint,3,opt,name=state,proto3,enum=ibc.connection.State" json:"state,omitempty"`
|
||||||
// counterparty chain associated with this connection.
|
// counterparty chain associated with this connection.
|
||||||
Counterparty Counterparty `protobuf:"bytes,5,opt,name=counterparty,proto3" json:"counterparty"`
|
Counterparty Counterparty `protobuf:"bytes,4,opt,name=counterparty,proto3" json:"counterparty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ConnectionEnd) Reset() { *m = ConnectionEnd{} }
|
func (m *ConnectionEnd) Reset() { *m = ConnectionEnd{} }
|
||||||
|
@ -716,65 +716,66 @@ func init() {
|
||||||
func init() { proto.RegisterFile("ibc/connection/connection.proto", fileDescriptor_3bf62bacf5a27ee9) }
|
func init() { proto.RegisterFile("ibc/connection/connection.proto", fileDescriptor_3bf62bacf5a27ee9) }
|
||||||
|
|
||||||
var fileDescriptor_3bf62bacf5a27ee9 = []byte{
|
var fileDescriptor_3bf62bacf5a27ee9 = []byte{
|
||||||
// 926 bytes of a gzipped FileDescriptorProto
|
// 936 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0xcd, 0x6e, 0xdb, 0x46,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0x4f, 0x6f, 0xe3, 0x44,
|
||||||
0x10, 0x16, 0x29, 0xea, 0x6f, 0x2c, 0xdb, 0x0a, 0x23, 0x37, 0x84, 0x1a, 0x90, 0x2c, 0x73, 0x11,
|
0x14, 0x8f, 0x1d, 0xe7, 0xdf, 0x6b, 0xda, 0x66, 0xbd, 0x29, 0x6b, 0x85, 0x95, 0x6d, 0xbc, 0x97,
|
||||||
0x5a, 0x58, 0x6a, 0x92, 0x22, 0x07, 0x03, 0x3d, 0x48, 0xb2, 0x8c, 0x12, 0xad, 0x1d, 0x81, 0x96,
|
0x08, 0xd4, 0x84, 0xdd, 0x45, 0x7b, 0xa8, 0xc4, 0x21, 0x49, 0x53, 0x61, 0x41, 0xbb, 0x91, 0x9b,
|
||||||
0x0b, 0x34, 0x17, 0x41, 0x26, 0x57, 0xf2, 0x42, 0x16, 0x29, 0x90, 0xeb, 0x22, 0x7e, 0x83, 0xc0,
|
0x22, 0xb1, 0x97, 0x28, 0xb5, 0x27, 0xe9, 0x28, 0x8d, 0x1d, 0xd9, 0x53, 0xb4, 0xfd, 0x06, 0xab,
|
||||||
0xa7, 0xf6, 0xd8, 0x83, 0x81, 0x02, 0x79, 0x89, 0x3e, 0x41, 0x91, 0x63, 0x8e, 0x3d, 0x11, 0x85,
|
0x9e, 0xe0, 0xc8, 0xa1, 0x12, 0xd2, 0x7e, 0x09, 0x3e, 0x01, 0xda, 0xe3, 0x1e, 0x39, 0x59, 0x28,
|
||||||
0x8c, 0xbe, 0x80, 0xd0, 0x53, 0x4f, 0x05, 0x77, 0xf9, 0x27, 0xdb, 0x68, 0x91, 0xca, 0x87, 0xc2,
|
0x15, 0x5f, 0x20, 0xe2, 0xc4, 0x09, 0x79, 0xc6, 0xb1, 0xdd, 0xb4, 0x80, 0xa8, 0x7b, 0x40, 0x9c,
|
||||||
0x27, 0xcd, 0xcf, 0xb7, 0xb3, 0x33, 0xf3, 0x8d, 0x86, 0x0b, 0x0a, 0x3e, 0x36, 0x9b, 0xa6, 0x63,
|
0xf2, 0xfe, 0xf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x07, 0x4c, 0xd1, 0x46, 0xb0, 0x99, 0x24, 0xc7, 0x80, 0x2b, 0xf6, 0x21,
|
0xb1, 0xab, 0xf7, 0x86, 0xe4, 0xc4, 0x13, 0xab, 0x90, 0x9b, 0x05, 0x82, 0xc4, 0x51, 0x0e, 0x98,
|
||||||
0xbe, 0x87, 0x4f, 0xdf, 0xf3, 0x35, 0x14, 0xc2, 0xaf, 0xb2, 0x28, 0x03, 0xe0, 0x68, 0x16, 0x5d,
|
0xa2, 0x8d, 0x60, 0x33, 0xbe, 0x1c, 0x03, 0xa6, 0xec, 0x43, 0x94, 0x87, 0x4f, 0xe6, 0xf9, 0x12,
|
||||||
0x76, 0x81, 0x91, 0xb2, 0x04, 0xf3, 0x32, 0x42, 0x43, 0x72, 0xe6, 0xa2, 0x28, 0x46, 0xac, 0xb3,
|
0x0a, 0xe1, 0x57, 0x59, 0x94, 0x01, 0xf0, 0x72, 0x16, 0x5d, 0x96, 0xc0, 0x48, 0x58, 0x82, 0x79,
|
||||||
0xca, 0x3e, 0xfd, 0x89, 0x83, 0x1c, 0x9d, 0x0c, 0xf1, 0x05, 0x28, 0x87, 0xfd, 0x56, 0xbf, 0x3b,
|
0x19, 0xa1, 0x21, 0x39, 0x73, 0x51, 0xf4, 0x1f, 0x5a, 0xea, 0xac, 0xb2, 0x8f, 0x7f, 0xe0, 0x20,
|
||||||
0x38, 0x3a, 0xd0, 0x0f, 0xf4, 0xbe, 0xde, 0xfa, 0x46, 0x7f, 0xd5, 0xdd, 0x1d, 0x1c, 0x1d, 0x1c,
|
0x47, 0x27, 0x43, 0x7c, 0x01, 0xca, 0x61, 0xbf, 0xd5, 0xef, 0x0e, 0x8e, 0x0e, 0xf4, 0x03, 0xbd,
|
||||||
0xf6, 0xba, 0x1d, 0x7d, 0x4f, 0xef, 0xee, 0x56, 0x32, 0xb5, 0x07, 0x17, 0x97, 0xea, 0xfa, 0x12,
|
0xaf, 0xb7, 0xbe, 0xd2, 0x5f, 0x75, 0x77,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, 0x77, 0x39, 0xdd, 0x5b, 0xc7, 0x79, 0xfa, 0x98, 0x7e, 0xfe,
|
0x2b, 0x39, 0xf3, 0xea, 0xc5, 0xdf, 0xee, 0xa8, 0xd7, 0xcd, 0xe0, 0x35, 0xfd, 0xe9, 0xf3, 0xed,
|
||||||
0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2c, 0xb0, 0xb2, 0x80, 0xb6, 0x0b, 0x00, 0x00,
|
0xc4, 0xbb, 0x9c, 0xee, 0xad, 0xe3, 0x3c, 0x7d, 0x4c, 0x3f, 0xff, 0x33, 0x00, 0x00, 0xff, 0xff,
|
||||||
|
0x7a, 0xce, 0x37, 0x62, 0xb6, 0x0b, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MsgConnectionOpenInit) Marshal() (dAtA []byte, err error) {
|
func (m *MsgConnectionOpenInit) Marshal() (dAtA []byte, err error) {
|
||||||
|
@ -1064,11 +1065,11 @@ func (m *ConnectionEnd) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
i = encodeVarintConnection(dAtA, i, uint64(size))
|
i = encodeVarintConnection(dAtA, i, uint64(size))
|
||||||
}
|
}
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x2a
|
dAtA[i] = 0x22
|
||||||
if m.State != 0 {
|
if m.State != 0 {
|
||||||
i = encodeVarintConnection(dAtA, i, uint64(m.State))
|
i = encodeVarintConnection(dAtA, i, uint64(m.State))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x20
|
dAtA[i] = 0x18
|
||||||
}
|
}
|
||||||
if len(m.Versions) > 0 {
|
if len(m.Versions) > 0 {
|
||||||
for iNdEx := len(m.Versions) - 1; iNdEx >= 0; iNdEx-- {
|
for iNdEx := len(m.Versions) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
@ -1076,7 +1077,7 @@ func (m *ConnectionEnd) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
copy(dAtA[i:], m.Versions[iNdEx])
|
copy(dAtA[i:], m.Versions[iNdEx])
|
||||||
i = encodeVarintConnection(dAtA, i, uint64(len(m.Versions[iNdEx])))
|
i = encodeVarintConnection(dAtA, i, uint64(len(m.Versions[iNdEx])))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x1a
|
dAtA[i] = 0x12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(m.ClientID) > 0 {
|
if len(m.ClientID) > 0 {
|
||||||
|
@ -1084,7 +1085,7 @@ func (m *ConnectionEnd) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
copy(dAtA[i:], m.ClientID)
|
copy(dAtA[i:], m.ClientID)
|
||||||
i = encodeVarintConnection(dAtA, i, uint64(len(m.ClientID)))
|
i = encodeVarintConnection(dAtA, i, uint64(len(m.ClientID)))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x12
|
dAtA[i] = 0xa
|
||||||
}
|
}
|
||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
@ -2537,7 +2538,7 @@ func (m *ConnectionEnd) Unmarshal(dAtA []byte) error {
|
||||||
return fmt.Errorf("proto: ConnectionEnd: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: ConnectionEnd: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 2:
|
case 1:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType)
|
||||||
}
|
}
|
||||||
|
@ -2569,7 +2570,7 @@ func (m *ConnectionEnd) Unmarshal(dAtA []byte) error {
|
||||||
}
|
}
|
||||||
m.ClientID = string(dAtA[iNdEx:postIndex])
|
m.ClientID = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 3:
|
case 2:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType)
|
||||||
}
|
}
|
||||||
|
@ -2601,7 +2602,7 @@ func (m *ConnectionEnd) Unmarshal(dAtA []byte) error {
|
||||||
}
|
}
|
||||||
m.Versions = append(m.Versions, string(dAtA[iNdEx:postIndex]))
|
m.Versions = append(m.Versions, string(dAtA[iNdEx:postIndex]))
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 4:
|
case 3:
|
||||||
if wireType != 0 {
|
if wireType != 0 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field State", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field State", wireType)
|
||||||
}
|
}
|
||||||
|
@ -2620,7 +2621,7 @@ func (m *ConnectionEnd) Unmarshal(dAtA []byte) error {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 5:
|
case 4:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Counterparty", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field Counterparty", wireType)
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue