Documentation
¶
Index ¶
- type BankWrapper
- func (w BankWrapper) BurnAmountFromAccount(ctx context.Context, account sdk.AccAddress, amt *big.Int) error
- func (w BankWrapper) GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
- func (w BankWrapper) MintAmountToAccount(ctx context.Context, recipientAddr sdk.AccAddress, amt *big.Int) error
- func (w BankWrapper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, ...) error
- func (w BankWrapper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (w BankWrapper) SpendableCoin(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
- type FeeMarketWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BankWrapper ¶
type BankWrapper struct {
types.BankKeeper
}
BankWrapper is a wrapper around the Cosmos SDK bank keeper that is used to manage an evm denom with a custom decimal representation.
func NewBankWrapper ¶
func NewBankWrapper( bk types.BankKeeper, ) *BankWrapper
NewBankWrapper creates a new BankWrapper instance.
func (BankWrapper) BurnAmountFromAccount ¶
func (w BankWrapper) BurnAmountFromAccount(ctx context.Context, account sdk.AccAddress, amt *big.Int) error
BurnAmountFromAccount converts the given amount into the evm coin scaling the amount to the original decimals, then burns that quantity from the provided account.
func (BankWrapper) GetBalance ¶
func (w BankWrapper) GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
GetBalance returns the balance of the given account.
func (BankWrapper) MintAmountToAccount ¶
func (w BankWrapper) MintAmountToAccount(ctx context.Context, recipientAddr sdk.AccAddress, amt *big.Int) error
MintAmountToAccount converts the given amount into the evm coin scaling the amount to the original decimals, then mints that amount to the provided account.
func (BankWrapper) SendCoinsFromAccountToModule ¶
func (w BankWrapper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, coins sdk.Coins) error
SendCoinsFromAccountToModule wraps around the Cosmos SDK x/bank module's SendCoinsFromAccountToModule method to convert the evm coin, if present in the input, to its original representation.
func (BankWrapper) SendCoinsFromModuleToAccount ¶
func (w BankWrapper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, coins sdk.Coins) error
SendCoinsFromModuleToAccount wraps around the Cosmos SDK x/bank module's SendCoinsFromModuleToAccount method to convert the evm coin, if present in the input, to its original representation.
func (BankWrapper) SpendableCoin ¶ added in v0.3.0
func (w BankWrapper) SpendableCoin(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
SpendableCoin returns the balance of the given account.
type FeeMarketWrapper ¶
type FeeMarketWrapper struct {
types.FeeMarketKeeper
}
FeeMarketWrapper is a wrapper around the feemarket keeper that is used to manage an evm denom with 6 or 18 decimals. The wrapper makes the corresponding conversions to achieve:
- With the EVM, the wrapper works always with 18 decimals.
- With the feemarket module, the wrapper works always with the bank module decimals (either 6 or 18).
func NewFeeMarketWrapper ¶
func NewFeeMarketWrapper( fk types.FeeMarketKeeper, ) *FeeMarketWrapper
NewFeeMarketWrapper creates a new feemarket Keeper wrapper instance. The BankWrapper is used to manage an evm denom with 6 or 18 decimals.
func (FeeMarketWrapper) CalculateBaseFee ¶
func (w FeeMarketWrapper) CalculateBaseFee(ctx sdk.Context) *big.Int
CalculateBaseFee returns the calculated base fee converted to 18 decimals.
func (FeeMarketWrapper) GetBaseFee ¶
func (w FeeMarketWrapper) GetBaseFee(ctx sdk.Context) *big.Int
GetBaseFee returns the base fee converted to 18 decimals.
func (FeeMarketWrapper) GetParams ¶
func (w FeeMarketWrapper) GetParams(ctx sdk.Context) feemarkettypes.Params
GetParams returns the params with associated fees values converted to 18 decimals.