Documentation ¶
Index ¶
- Constants
- func CheckTxTopics(res abcitypes.ResponseDeliverTx, expectedTopics []string) error
- func DecodeContractCallResponse(response interface{}, callArgs factory.CallArgs, ...) error
- func DecodeResponseDeliverTx(res abcitypes.ResponseDeliverTx) (*evmtypes.MsgEthereumTxResponse, error)
- func IsContractAccount(acc authtypes.AccountI) error
- func RegisterERC20(tf factory.TxFactory, network network.Network, data ERC20RegistrationData) (erc20types.TokenPair, error)
- func RegisterIBCERC20Coins(network *network.UnitTestNetwork, tokenReceiver sdk.AccAddress, ...) (erc20types.TokenPair, error)
- func RegisterIslmERC20Coins(network network.UnitTestNetwork, tokenReceiver sdk.AccAddress) (erc20types.TokenPair, error)
- func SubmitProposal(tf factory.TxFactory, network network.Network, ...) (uint64, error)
- func VoteOnProposal(tf factory.TxFactory, voterPriv cryptotypes.PrivKey, proposalID uint64, ...) error
- type ERC20RegistrationData
Constants ¶
const (
TokenToMint = 1e18
)
Variables ¶
This section is empty.
Functions ¶
func CheckTxTopics ¶
func CheckTxTopics(res abcitypes.ResponseDeliverTx, expectedTopics []string) error
CheckTxTopics checks if all expected topics are present in the transaction response
func DecodeContractCallResponse ¶
func DecodeContractCallResponse(response interface{}, callArgs factory.CallArgs, res abcitypes.ResponseDeliverTx) error
DecodeContractCallResponse decodes the response of a contract call query
func DecodeResponseDeliverTx ¶
func DecodeResponseDeliverTx(res abcitypes.ResponseDeliverTx) (*evmtypes.MsgEthereumTxResponse, error)
func IsContractAccount ¶
IsContractAccount checks if the given account is a contract account
func RegisterERC20 ¶
func RegisterERC20(tf factory.TxFactory, network network.Network, data ERC20RegistrationData) (erc20types.TokenPair, error)
RegisterERC20 is a helper function to register ERC20 token through submitting a governance proposal and having it pass. It returns the registered token pair.
func RegisterIBCERC20Coins ¶
func RegisterIBCERC20Coins( network *network.UnitTestNetwork, tokenReceiver sdk.AccAddress, denomTrace transfertypes.DenomTrace, ) (erc20types.TokenPair, error)
RegisterIBCERC20Coins uses the UnitNetwork to register the denomTrace as an ERC20 token. The function performs all the required steps for the registration like registering the denom trace in the transfer keeper and minting the token with the bank. Returns the TokenPair or an error.
func RegisterIslmERC20Coins ¶
func RegisterIslmERC20Coins( network network.UnitTestNetwork, tokenReceiver sdk.AccAddress, ) (erc20types.TokenPair, error)
RegisterIslmERC20Coins uses the UnitNetwork to register the aISLM token as an ERC20 token. The function performs all the required steps for the registration like registering the denom trace in the transfer keeper and minting the token with the bank. Returns the TokenPair or an error.
func SubmitProposal ¶
func SubmitProposal(tf factory.TxFactory, network network.Network, proposerPriv cryptotypes.PrivKey, proposal govv1beta1.Content) (uint64, error)
SubmitProposal is a helper function to submit a governance proposal and return the proposal ID.
func VoteOnProposal ¶
func VoteOnProposal(tf factory.TxFactory, voterPriv cryptotypes.PrivKey, proposalID uint64, option govv1.VoteOption) error
VoteOnProposal is a helper function to vote on a governance proposal given the private key of the voter and the option to vote.
Types ¶
type ERC20RegistrationData ¶
type ERC20RegistrationData struct { // Address is the address of the ERC20 token. Address common.Address // Denom is the ERC20 token denom. Denom string // ProposerPriv is the private key used to sign the proposal and voting transactions. ProposerPriv cryptotypes.PrivKey }
ERC20RegistrationData is the necessary data to provide in order to register an ERC20 token.
func (ERC20RegistrationData) ValidateBasic ¶
func (ed ERC20RegistrationData) ValidateBasic() error
ValidateBasic does stateless validation of the data for the ERC20 registration.