Documentation
¶
Index ¶
- func NewQueryServer(keeper Keeper) types.QueryServer
- type Keeper
- func (k Keeper) AcceptAssetsLocked(ctx sdk.Context, events types.AssetsLockedEvents) error
- func (k Keeper) CreateERC20TokenMapping(ctx sdk.Context, sourceToken, mezoToken []byte) error
- func (k Keeper) DeleteERC20TokenMapping(ctx sdk.Context, sourceToken []byte) error
- func (k *Keeper) EndBlock(ctx context.Context) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAssetsLockedSequenceTip(ctx sdk.Context) math.Int
- func (k Keeper) GetBTCBurnt(ctx sdk.Context) math.Int
- func (k Keeper) GetBTCMinted(ctx sdk.Context) math.Int
- func (k Keeper) GetERC20TokenMapping(ctx sdk.Context, sourceToken []byte) (*types.ERC20TokenMapping, bool)
- func (k Keeper) GetERC20TokensMappings(ctx sdk.Context) []*types.ERC20TokenMapping
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetSourceBTCToken(ctx sdk.Context) []byte
- func (k Keeper) IncreaseBTCBurnt(ctx sdk.Context, amount math.Int) error
- func (k Keeper) IncreaseBTCMinted(ctx sdk.Context, amount math.Int) error
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k Keeper) SetSourceBTCToken(ctx sdk.Context, sourceBTCToken []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQueryServer ¶
func NewQueryServer(keeper Keeper) types.QueryServer
NewQueryServer returns an implementation of the QueryServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey storetypes.StoreKey, bankKeeper types.BankKeeper, evmKeeper types.EvmKeeper, ) Keeper
func (Keeper) AcceptAssetsLocked ¶
AcceptAssetsLocked processes the given AssetsLocked events sequence by minting the corresponding amount of coins for each event and sending them to the recipient address.
Requirements:
- The AssetsLocked sequence must not be empty.
- The AssetsLocked sequence must be valid (i.e. all events in the slice pass the AssetsLockedEvent.IsValid test AND sequence numbers of events form a sequence strictly increasing by 1).
- The sequence number of the first event in the slice must be exactly one greater than the current sequence tip held in the state.
The function returns an error if any of the requirements is not met. Checking the mentioned requirements is crucial to ensure state consistency regardless of the guarantees provided by the upstream code.
If all requirements are met and x/bank interactions are all successful, the current sequence tip in the state is updated to the sequence number of the last event in the slice.
func (Keeper) CreateERC20TokenMapping ¶
CreateERC20TokenMapping creates a new ERC20 token mapping. Requirements: - The source token address must be a valid EVM address and not zero, - The Mezo token address must be a valid EVM address and not zero, - The source token address must not be already mapped, - The maximum number of mappings must not be reached.
func (Keeper) DeleteERC20TokenMapping ¶
DeleteERC20TokenMapping deletes an ERC20 token mapping. Requirements: - The mapping must exist.
func (*Keeper) EndBlock ¶
EndBlock is used to run a given set of assertions after processing a block. Each assertion will ensure that the mezo state is in sync with its understanding of the state of the bridge at the time. In case an assertion prove false, the function will panic, leaving time for the node operators to investigate.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the module's exported genesis
func (Keeper) GetAssetsLockedSequenceTip ¶
GetAssetsLockedSequenceTip returns the current sequence tip for the AssetsLocked events. The tip denotes the sequence number of the last event processed by the x/bridge module.
func (Keeper) GetBTCBurnt ¶
GetBTCBurnt returns the total amount of a given BTC burnt.
func (Keeper) GetBTCMinted ¶
GetBTCMinted return the amount of a given BTC minted.
func (Keeper) GetERC20TokenMapping ¶
func (k Keeper) GetERC20TokenMapping( ctx sdk.Context, sourceToken []byte, ) (*types.ERC20TokenMapping, bool)
GetERC20TokenMapping returns an ERC20 token mapping by the corresponding source token address. The boolean return value indicates if the mapping was found.
func (Keeper) GetERC20TokensMappings ¶
func (k Keeper) GetERC20TokensMappings(ctx sdk.Context) []*types.ERC20TokenMapping
GetERC20TokensMappings returns all ERC20 token mappings supported by the bridge.
func (Keeper) GetSourceBTCToken ¶
GetSourceBTCToken returns the BTC token address on the source chain. AssetsLocked events carrying this token address are directly mapped to the Mezo native denomination - BTC.
func (Keeper) IncreaseBTCBurnt ¶
IncreaseBTCBurnt increments the total amount of BTC burnt.
func (Keeper) IncreaseBTCMinted ¶
IncreaseBTCMinted increase the total amount of BTC minted.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis( ctx sdk.Context, genState types.GenesisState, accountKeeper types.AccountKeeper, )
InitGenesis initializes the module's state from a provided genesis state.