Documentation
¶
Index ¶
- Constants
- func ApproveProposal(tf factory.TxFactory, network network.Network, ...) error
- func CheckBalances(ctx context.Context, client banktypes.QueryClient, ...) error
- func CheckTxTopics(res abcitypes.ExecTxResult, expectedTopics []string) error
- func ContainsEventType(events []abcitypes.Event, eventType string) bool
- func CreateGenesisWithTokenPairs(keyring testkeyring.Keyring, denoms ...string) network.CustomGenesisState
- func DecodeContractCallResponse(response interface{}, callArgs factory.CallArgs, res abcitypes.ExecTxResult) error
- func DecodeExecTxResult(res abcitypes.ExecTxResult) (*evmtypes.MsgEthereumTxResponse, error)
- func FundAccountWithBaseDenom(tf cmnfactory.CoreTxFactory, nw cmnnet.Network, sender keyring.Key, ...) error
- func GetERC20Balance(nw network.Network, tokenAddress, accountAddress common.Address) (*big.Int, error)
- func GetEventAttributeValue(event abcitypes.Event, attrKey string) string
- func GetEventType(events []abcitypes.Event, eventType string) *abcitypes.Event
- func GetFeesFromEvents(events []abcitypes.Event) (sdktypes.DecCoins, error)
- func RegisterERC20(tf factory.TxFactory, network network.Network, data ERC20RegistrationData) (res []erc20types.TokenPair, err error)
- func RegisterEvmosERC20Coins(network network.UnitTestNetwork, tokenReceiver sdk.AccAddress) (erc20types.TokenPair, error)
- func RegisterIBCERC20Coins(network *network.UnitTestNetwork, tokenReceiver sdk.AccAddress, ...) (erc20types.TokenPair, error)
- func SubmitLegacyProposal(tf factory.TxFactory, network network.Network, ...) (uint64, error)
- func SubmitProposal(tf factory.TxFactory, network network.Network, ...) (uint64, error)
- func ToggleTokenConversion(tf factory.TxFactory, network network.Network, privKey cryptotypes.PrivKey, ...) error
- func UpdateERC20Params(input UpdateParamsInput) error
- func UpdateEvmParams(input UpdateParamsInput) error
- func UpdateFeeMarketParams(input UpdateParamsInput) error
- func UpdateGovParams(input UpdateParamsInput) error
- func ValidatorConsAddressToHex(valAddress string) common.Address
- func VoteOnProposal(tf factory.TxFactory, voterPriv cryptotypes.PrivKey, proposalID uint64, ...) (abcitypes.ExecTxResult, error)
- func WaitToAccrueCommission(n network.Network, gh grpc.Handler, validatorAddr string, ...) (sdk.DecCoins, error)
- func WaitToAccrueRewards(n network.Network, gh grpc.Handler, delegatorAddr string, ...) (sdk.DecCoins, error)
- type ERC20RegistrationData
- type UpdateParamsInput
Constants ¶
const (
TokenToMint = 1e18
)
Variables ¶
This section is empty.
Functions ¶
func ApproveProposal ¶
func ApproveProposal(tf factory.TxFactory, network network.Network, proposerPriv cryptotypes.PrivKey, proposalID uint64) error
ApproveProposal is a helper function to vote 'yes' for it and wait till it passes.
func CheckBalances ¶
func CheckBalances(ctx context.Context, client banktypes.QueryClient, balances []banktypes.Balance) error
CheckBalances checks that the given accounts have the expected balances and returns an error if that is not the case.
func CheckTxTopics ¶
func CheckTxTopics(res abcitypes.ExecTxResult, expectedTopics []string) error
CheckTxTopics checks if all expected topics are present in the transaction response
func ContainsEventType ¶
ContainsEventType returns true if the given events contain the given eventType.
func CreateGenesisWithTokenPairs ¶
func CreateGenesisWithTokenPairs(keyring testkeyring.Keyring, denoms ...string) network.CustomGenesisState
CreateGenesisWithTokenPairs creates a genesis that includes the WEVMOS and the provided denoms. If no denoms provided, creates only one dynamic precompile with the 'xmpl' denom.
func DecodeContractCallResponse ¶
func DecodeContractCallResponse(response interface{}, callArgs factory.CallArgs, res abcitypes.ExecTxResult) error
DecodeContractCallResponse decodes the response of a contract call query
func DecodeExecTxResult ¶
func DecodeExecTxResult(res abcitypes.ExecTxResult) (*evmtypes.MsgEthereumTxResponse, error)
func FundAccountWithBaseDenom ¶
func FundAccountWithBaseDenom(tf cmnfactory.CoreTxFactory, nw cmnnet.Network, sender keyring.Key, receiver sdk.AccAddress, amount math.Int) error
FundAccountWithBaseDenom funds the given account with the given amount of the network's base denomination.
func GetERC20Balance ¶
func GetERC20Balance(nw network.Network, tokenAddress, accountAddress common.Address) (*big.Int, error)
GetERC20Balance returns the token balance of a given account address for an ERC-20 token at the given contract address.
func GetEventAttributeValue ¶
GetEventAttributeValue returns the value for the required attribute key
func GetEventType ¶
GetEventType returns the given events if found Otherwise returns nil
func GetFeesFromEvents ¶
GetFeesFromEvents returns the fees value for the specified events
func RegisterERC20 ¶
func RegisterERC20(tf factory.TxFactory, network network.Network, data ERC20RegistrationData) (res []erc20types.TokenPair, err 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 RegisterEvmosERC20Coins ¶
func RegisterEvmosERC20Coins( network network.UnitTestNetwork, tokenReceiver sdk.AccAddress, ) (erc20types.TokenPair, error)
RegisterEvmosERC20Coins uses the UnitNetwork to register the evmos 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 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.
TODO: why is this not yet used
func SubmitLegacyProposal ¶
func SubmitLegacyProposal(tf factory.TxFactory, network network.Network, proposerPriv cryptotypes.PrivKey, proposal govv1beta1.Content) (uint64, error)
SubmitLegacyProposal is a helper function to submit a governance proposal and return the proposal ID.
func SubmitProposal ¶
func SubmitProposal(tf factory.TxFactory, network network.Network, proposerPriv cryptotypes.PrivKey, title string, msgs ...sdk.Msg) (uint64, error)
SubmitProposal is a helper function to submit a governance proposal and return the proposal ID.
func ToggleTokenConversion ¶
func ToggleTokenConversion(tf factory.TxFactory, network network.Network, privKey cryptotypes.PrivKey, token string) error
ToggleTokenConversion is a helper function to toggle an ERC20 token pair conversion through submitting a governance proposal and having it pass.
func UpdateERC20Params ¶
func UpdateERC20Params(input UpdateParamsInput) error
UpdateERC20Params helper function to update the erc20 module parameters It submits an update params proposal, votes for it, and waits till it passes
func UpdateEvmParams ¶
func UpdateEvmParams(input UpdateParamsInput) error
UpdateEvmParams helper function to update the EVM module parameters It submits an update params proposal, votes for it, and waits till it passes
func UpdateFeeMarketParams ¶
func UpdateFeeMarketParams(input UpdateParamsInput) error
UpdateFeeMarketParams helper function to update the feemarket module parameters It submits an update params proposal, votes for it, and waits till it passes
func UpdateGovParams ¶
func UpdateGovParams(input UpdateParamsInput) error
UpdateGovParams helper function to update the governance module parameters It submits an update params proposal, votes for it, and waits till it passes
func VoteOnProposal ¶
func VoteOnProposal(tf factory.TxFactory, voterPriv cryptotypes.PrivKey, proposalID uint64, option govv1.VoteOption) (abcitypes.ExecTxResult, 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 { // Addresses are the addresses of the ERC20 tokens. Addresses []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.