github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/x/erc20/types/genesis.go (about)

     1  package types
     2  
     3  // TokenMapping defines a mapping between native denom and contract
     4  type TokenMapping struct {
     5  	Denom    string `json:"denom"`
     6  	Contract string `json:"contract"`
     7  }
     8  
     9  // GenesisState defines the erc20 module genesis state
    10  type GenesisState struct {
    11  	Params        Params         `json:"params"`
    12  	TokenMappings []TokenMapping `json:"token_mappings"`
    13  }
    14  
    15  // DefaultGenesisState sets default erc20 genesis state with empty accounts and default params and
    16  // chain config values.
    17  func DefaultGenesisState() GenesisState {
    18  	return GenesisState{
    19  		Params: DefaultParams(),
    20  	}
    21  }
    22  
    23  // Validate performs basic genesis state validation returning an error upon any
    24  // failure.
    25  func (gs GenesisState) Validate() error {
    26  	return gs.Params.Validate()
    27  }