Documentation
¶
Overview ¶
Package withdraw provides tools to automatically create EVM withdrawals for any transfers into user accounts.
Index ¶
- func BindInterfaces() []depinject.Config
- func DIInvoke(bankWrapper *BankWrapper, evmEngKeeper EVMEngineKeeper)
- type BankWrapper
- func (w *BankWrapper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (w *BankWrapper) SendCoinsFromModuleToAccountNoWithdrawal(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (w *BankWrapper) SetEVMEngineKeeper(keeper EVMEngineKeeper)
- func (w *BankWrapper) UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- type DIInputs
- type DIOutputs
- type EVMEngineKeeper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindInterfaces ¶
BindInterfaces returns a list of depinject.BindInterface that bind the x/bank Keeper interfaces to either this BankWrapper or the default x/bank keeper.
Note that the `gov` and `protocolpool` modules would also require this if/when used. Other SDK modules don't call transfer methods so they don't need this.
func DIInvoke ¶
func DIInvoke(bankWrapper *BankWrapper, evmEngKeeper EVMEngineKeeper)
DIInvoke injects the EVMEngineKeeper into the BankWrapper. This mitigates cyclic dependency: EVMEngineKeeper -> EVMEventProc(EVMStakingKeeper) -> BankWrapper -> EVMEngineKeeper.
Types ¶
type BankWrapper ¶
type BankWrapper struct { bankkeeper.Keeper EVMEngineKeeper EVMEngineKeeper }
BankWrapper wraps x/bank.Keeper by overriding methods with creation of a new withdrawal requests.
func NewBankWrapper ¶
func NewBankWrapper(k bankkeeper.Keeper) *BankWrapper
func (*BankWrapper) SendCoinsFromModuleToAccount ¶
func (w *BankWrapper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, coins sdk.Coins) error
SendCoinsFromModuleToAccount intercepts all "normal" bank transfers from modules to users and creates EVM withdrawal to the user account and burns the funds from the module.
func (*BankWrapper) SendCoinsFromModuleToAccountNoWithdrawal ¶
func (w *BankWrapper) SendCoinsFromModuleToAccountNoWithdrawal(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, coins sdk.Coins) error
SendCoinsFromModuleToAccountNoWithdrawal bypasses the EVM withdrawal creation. This is required when "depositing" funds from the EVM.
func (*BankWrapper) SetEVMEngineKeeper ¶
func (w *BankWrapper) SetEVMEngineKeeper(keeper EVMEngineKeeper)
func (*BankWrapper) UndelegateCoinsFromModuleToAccount ¶
func (w *BankWrapper) UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
UndelegateCoinsFromModuleToAccount intercepts all principal undelegations and creates EVM withdrawal to the user account. TODO(corver): This is unexpected in magellan upgrade, must be implemented in drake.
type DIInputs ¶
type DIInputs struct { depinject.In BankKeeper bankkeeper.BaseKeeper }
type DIOutputs ¶
type DIOutputs struct { depinject.Out BankWrapper *BankWrapper }