Documentation ¶
Index ¶
- func AssertJsonFile(t *testing.T, filePath string, result interface{})
- func CreateMultiECDSA(count int) []*ecdsa.PrivateKey
- func GenAccAddress() sdk.AccAddress
- func GenExternalAddr(module string) string
- func GenHexAddress() common.Address
- func GenZeroExternalAddr(module string) string
- func HexAddrToTronAddr(str string) string
- func IsLocalTest() bool
- func NewApp(opts ...func(*AppOpts)) *app.App
- func NewBigInt(amount, power int64) *big.Int
- func NewEthPrivKey() cryptotypes.PrivKey
- func NewMnemonic() string
- func NewPriKey() cryptotypes.PrivKey
- func NewRandAmount() sdkmath.Int
- func NewRandDenom() string
- func NewRandSymbol() string
- func NewStakingCoin(amount, power int64) sdk.Coin
- func NewStakingCoins(amount, power int64) sdk.Coins
- func PackERC20Mint(receiver common.Address, amount *big.Int) ([]byte, error)
- func PrivKeyFromMnemonic(mnemonic string, algo hd.PubKeyType, account, index uint32) (cryptotypes.PrivKey, error)
- func SkipTest(t *testing.T, msg ...any)
- type AppOpts
- type BankPrecompileSuite
- func (s BankPrecompileSuite) TransferFromAccountToModule(ctx context.Context, from common.Address, ...) *evmtypes.MsgEthereumTxResponse
- func (s BankPrecompileSuite) TransferFromModuleToAccount(ctx context.Context, from common.Address, ...) *evmtypes.MsgEthereumTxResponse
- func (s BankPrecompileSuite) WithError(err error) BankPrecompileSuite
- type BaseSuite
- func (s *BaseSuite) AddTestAddress(accNum int, coin sdk.Coin) []sdk.AccAddress
- func (s *BaseSuite) AddTestSigner(amount ...int64) *Signer
- func (s *BaseSuite) AddTestSigners(accNum int, coin sdk.Coin) []*Signer
- func (s *BaseSuite) AssertAllBalance(addr sdk.AccAddress, expBal ...sdk.Coin)
- func (s *BaseSuite) AssertBalance(addr sdk.AccAddress, expBal ...sdk.Coin)
- func (s *BaseSuite) Balance(acc sdk.AccAddress) sdk.Coins
- func (s *BaseSuite) Commit(block ...int64) sdk.Context
- func (s *BaseSuite) Delegate(delAddr sdk.AccAddress, delAmount sdkmath.Int, val sdk.ValAddress)
- func (s *BaseSuite) GenIBCTransferChannel() (portID, channelID string)
- func (s *BaseSuite) GetDelegation(delAddr sdk.AccAddress, val sdk.ValAddress) stakingtypes.Delegation
- func (s *BaseSuite) GetFirstValAddr() sdk.ValAddress
- func (s *BaseSuite) GetFirstValidator() stakingtypes.Validator
- func (s *BaseSuite) GetSecondValAddr() sdk.ValAddress
- func (s *BaseSuite) GetSecondValidator() stakingtypes.Validator
- func (s *BaseSuite) GetStakingBalance(addr sdk.AccAddress) sdkmath.Int
- func (s *BaseSuite) GetValidator(valAddr sdk.ValAddress) stakingtypes.Validator
- func (s *BaseSuite) GetValidators() []stakingtypes.Validator
- func (s *BaseSuite) MintToken(address sdk.AccAddress, amount ...sdk.Coin)
- func (s *BaseSuite) MintTokenToModule(module string, amount ...sdk.Coin)
- func (s *BaseSuite) NewBridgeCoin(module string, amounts ...sdkmath.Int) (sdk.Coin, string)
- func (s *BaseSuite) NewCoin(amounts ...sdkmath.Int) sdk.Coin
- func (s *BaseSuite) NewSigner() *Signer
- func (s *BaseSuite) Redelegate(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress)
- func (s *BaseSuite) SetAllowance(valAddr sdk.ValAddress, owner, spender sdk.AccAddress, shares *big.Int)
- func (s *BaseSuite) SetupTest()
- func (s *BaseSuite) Undelegate(delAddr sdk.AccAddress, val sdk.ValAddress)
- type ContractBaseSuite
- type CrosschainPrecompileSuite
- func (s CrosschainPrecompileSuite) BridgeCall(ctx context.Context, from common.Address, args contract.BridgeCallArgs) *evmtypes.MsgEthereumTxResponse
- func (s CrosschainPrecompileSuite) BridgeCoinAmount(ctx context.Context, args contract.BridgeCoinAmountArgs) *big.Int
- func (s CrosschainPrecompileSuite) ExecuteClaim(ctx context.Context, from common.Address, args contract.ExecuteClaimArgs) *evmtypes.MsgEthereumTxResponse
- func (s CrosschainPrecompileSuite) HasOracle(ctx context.Context, args contract.HasOracleArgs) bool
- func (s CrosschainPrecompileSuite) IsOracleOnline(ctx context.Context, args contract.IsOracleOnlineArgs) bool
- func (s CrosschainPrecompileSuite) WithError(err error) CrosschainPrecompileSuite
- type ERC20TokenSuite
- func (s ERC20TokenSuite) Allowance(ctx context.Context, owner, spender common.Address) *big.Int
- func (s ERC20TokenSuite) Approve(ctx context.Context, spender common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
- func (s ERC20TokenSuite) BalanceOf(ctx context.Context, address common.Address) *big.Int
- func (s ERC20TokenSuite) Burn(ctx context.Context, from common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
- func (s ERC20TokenSuite) Decimals(ctx context.Context) uint8
- func (s ERC20TokenSuite) DeployERC20Token(ctx sdk.Context, symbol string) common.Address
- func (s ERC20TokenSuite) Deposit(ctx context.Context, value *big.Int) *evmtypes.MsgEthereumTxResponse
- func (s ERC20TokenSuite) Error(err error)
- func (s ERC20TokenSuite) Mint(ctx context.Context, to common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
- func (s ERC20TokenSuite) Name(ctx context.Context) string
- func (s ERC20TokenSuite) OnTest(ctx context.Context, name, symbol string, decimals uint8, totalSupply *big.Int, ...)
- func (s ERC20TokenSuite) Owner(ctx context.Context) common.Address
- func (s ERC20TokenSuite) Symbol(ctx context.Context) string
- func (s ERC20TokenSuite) TotalSupply(ctx context.Context) *big.Int
- func (s ERC20TokenSuite) Transfer(ctx context.Context, recipient common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
- func (s ERC20TokenSuite) TransferFrom(ctx context.Context, sender, recipient common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
- func (s ERC20TokenSuite) TransferOwnership(ctx context.Context, newOwner common.Address) *evmtypes.MsgEthereumTxResponse
- func (s ERC20TokenSuite) WithError(err error) ERC20TokenSuite
- func (s ERC20TokenSuite) Withdraw(ctx context.Context, to common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
- func (s ERC20TokenSuite) WithdrawSelf(ctx context.Context, amount *big.Int) *evmtypes.MsgEthereumTxResponse
- type Signer
- func (s Signer) AccAddress() sdk.AccAddress
- func (s Signer) Address() common.Address
- func (s Signer) PrivKey() cryptotypes.PrivKey
- func (s Signer) Sign(_ string, msg []byte, _ signing.SignMode) ([]byte, cryptotypes.PubKey, error)
- func (s Signer) SignByAddress(address sdk.Address, msg []byte, signMode signing.SignMode) ([]byte, cryptotypes.PubKey, error)
- type StakingPrecompileSuite
- func (s StakingPrecompileSuite) AllowanceShares(ctx context.Context, args contract.AllowanceSharesArgs) *big.Int
- func (s StakingPrecompileSuite) ApproveShares(ctx context.Context, args contract.ApproveSharesArgs) *evmtypes.MsgEthereumTxResponse
- func (s StakingPrecompileSuite) DelegateV2(ctx context.Context, args contract.DelegateV2Args) *evmtypes.MsgEthereumTxResponse
- func (s StakingPrecompileSuite) Delegation(ctx context.Context, args contract.DelegationArgs) (*big.Int, *big.Int)
- func (s StakingPrecompileSuite) DelegationRewards(ctx context.Context, args contract.DelegationRewardsArgs) *big.Int
- func (s StakingPrecompileSuite) Error(err error)
- func (s StakingPrecompileSuite) RedelegateV2(ctx context.Context, args contract.RedelegateV2Args) *evmtypes.MsgEthereumTxResponse
- func (s StakingPrecompileSuite) SlashingInfo(ctx context.Context, args contract.SlashingInfoArgs) (bool, *big.Int)
- func (s StakingPrecompileSuite) TransferFromShares(ctx context.Context, args contract.TransferFromSharesArgs) (*evmtypes.MsgEthereumTxResponse, *contract.TransferFromSharesRet)
- func (s StakingPrecompileSuite) TransferShares(ctx context.Context, args contract.TransferSharesArgs) (*evmtypes.MsgEthereumTxResponse, *contract.TransferSharesRet)
- func (s StakingPrecompileSuite) UndelegateV2(ctx context.Context, args contract.UndelegateV2Args) *evmtypes.MsgEthereumTxResponse
- func (s StakingPrecompileSuite) ValidatorList(ctx context.Context, args contract.ValidatorListArgs) []string
- func (s StakingPrecompileSuite) WithError(err error) StakingPrecompileSuite
- func (s StakingPrecompileSuite) Withdraw(ctx context.Context, args contract.WithdrawArgs) (*evmtypes.MsgEthereumTxResponse, *big.Int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertJsonFile ¶
func CreateMultiECDSA ¶
func CreateMultiECDSA(count int) []*ecdsa.PrivateKey
func GenAccAddress ¶
func GenAccAddress() sdk.AccAddress
GenAccAddress generates an cosmos-sdk accAddress
func GenExternalAddr ¶
GenExternalAddr generates an Ethereum or Tron address.
func GenHexAddress ¶
GenHexAddress generates an Ethereum address.
func GenZeroExternalAddr ¶
GenZeroExternalAddr generates an Ethereum or Tron zero address.
func HexAddrToTronAddr ¶
HexAddrToTronAddr returns a Tron address from an hex string.
func IsLocalTest ¶
func IsLocalTest() bool
func NewEthPrivKey ¶
func NewEthPrivKey() cryptotypes.PrivKey
NewEthPrivKey generates an Ethereum address and its corresponding private key.
func NewMnemonic ¶
func NewMnemonic() string
func NewPriKey ¶
func NewPriKey() cryptotypes.PrivKey
NewPriKey generates cosmos-sdk accAddress private key.
func NewRandAmount ¶
func NewRandDenom ¶
func NewRandDenom() string
func NewRandSymbol ¶
func NewRandSymbol() string
func NewStakingCoin ¶
func NewStakingCoins ¶
func PrivKeyFromMnemonic ¶
func PrivKeyFromMnemonic(mnemonic string, algo hd.PubKeyType, account, index uint32) (cryptotypes.PrivKey, error)
Types ¶
type BankPrecompileSuite ¶
type BankPrecompileSuite struct { *ContractBaseSuite contract.BankPrecompileKeeper // contains filtered or unexported fields }
func NewBankPrecompileSuite ¶
func NewBankPrecompileSuite(require *require.Assertions, signer *Signer, caller contract.Caller, contractAddr common.Address) BankPrecompileSuite
func (BankPrecompileSuite) TransferFromAccountToModule ¶
func (s BankPrecompileSuite) TransferFromAccountToModule(ctx context.Context, from common.Address, args contract.TransferFromAccountToModuleArgs) *evmtypes.MsgEthereumTxResponse
func (BankPrecompileSuite) TransferFromModuleToAccount ¶
func (s BankPrecompileSuite) TransferFromModuleToAccount(ctx context.Context, from common.Address, args contract.TransferFromModuleToAccountArgs) *evmtypes.MsgEthereumTxResponse
func (BankPrecompileSuite) WithError ¶
func (s BankPrecompileSuite) WithError(err error) BankPrecompileSuite
type BaseSuite ¶
type BaseSuite struct { suite.Suite MintValNumber int ValSet *tmtypes.ValidatorSet ValAddr []sdk.ValAddress App *app.App Ctx sdk.Context }
func (*BaseSuite) AddTestAddress ¶
func (*BaseSuite) AddTestSigner ¶
func (*BaseSuite) AddTestSigners ¶
func (*BaseSuite) AssertAllBalance ¶
func (s *BaseSuite) AssertAllBalance(addr sdk.AccAddress, expBal ...sdk.Coin)
func (*BaseSuite) AssertBalance ¶
func (s *BaseSuite) AssertBalance(addr sdk.AccAddress, expBal ...sdk.Coin)
func (*BaseSuite) Delegate ¶
func (s *BaseSuite) Delegate(delAddr sdk.AccAddress, delAmount sdkmath.Int, val sdk.ValAddress)
func (*BaseSuite) GenIBCTransferChannel ¶
func (*BaseSuite) GetDelegation ¶
func (s *BaseSuite) GetDelegation(delAddr sdk.AccAddress, val sdk.ValAddress) stakingtypes.Delegation
func (*BaseSuite) GetFirstValAddr ¶
func (s *BaseSuite) GetFirstValAddr() sdk.ValAddress
func (*BaseSuite) GetFirstValidator ¶
func (s *BaseSuite) GetFirstValidator() stakingtypes.Validator
func (*BaseSuite) GetSecondValAddr ¶
func (s *BaseSuite) GetSecondValAddr() sdk.ValAddress
func (*BaseSuite) GetSecondValidator ¶
func (s *BaseSuite) GetSecondValidator() stakingtypes.Validator
func (*BaseSuite) GetStakingBalance ¶
func (s *BaseSuite) GetStakingBalance(addr sdk.AccAddress) sdkmath.Int
func (*BaseSuite) GetValidator ¶
func (s *BaseSuite) GetValidator(valAddr sdk.ValAddress) stakingtypes.Validator
func (*BaseSuite) GetValidators ¶
func (s *BaseSuite) GetValidators() []stakingtypes.Validator
func (*BaseSuite) MintToken ¶
func (s *BaseSuite) MintToken(address sdk.AccAddress, amount ...sdk.Coin)
func (*BaseSuite) MintTokenToModule ¶
func (*BaseSuite) NewBridgeCoin ¶
func (*BaseSuite) Redelegate ¶
func (s *BaseSuite) Redelegate(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress)
func (*BaseSuite) SetAllowance ¶
func (s *BaseSuite) SetAllowance(valAddr sdk.ValAddress, owner, spender sdk.AccAddress, shares *big.Int)
func (*BaseSuite) Undelegate ¶
func (s *BaseSuite) Undelegate(delAddr sdk.AccAddress, val sdk.ValAddress)
type ContractBaseSuite ¶
type ContractBaseSuite struct {
// contains filtered or unexported fields
}
func NewContractBaseSuite ¶
func NewContractBaseSuite(require *require.Assertions, signer *Signer) *ContractBaseSuite
func (*ContractBaseSuite) AccAddress ¶
func (s *ContractBaseSuite) AccAddress() sdk.AccAddress
func (*ContractBaseSuite) HexAddress ¶
func (s *ContractBaseSuite) HexAddress() common.Address
func (*ContractBaseSuite) WithContract ¶
func (s *ContractBaseSuite) WithContract(addr common.Address) *ContractBaseSuite
func (*ContractBaseSuite) WithSigner ¶
func (s *ContractBaseSuite) WithSigner(signer *Signer) *ContractBaseSuite
type CrosschainPrecompileSuite ¶
type CrosschainPrecompileSuite struct { *ContractBaseSuite contract.CrosschainPrecompileKeeper // contains filtered or unexported fields }
func NewCrosschainPrecompileSuite ¶
func NewCrosschainPrecompileSuite(require *require.Assertions, signer *Signer, caller contract.Caller, contractAddr common.Address) CrosschainPrecompileSuite
func (CrosschainPrecompileSuite) BridgeCall ¶
func (s CrosschainPrecompileSuite) BridgeCall(ctx context.Context, from common.Address, args contract.BridgeCallArgs) *evmtypes.MsgEthereumTxResponse
func (CrosschainPrecompileSuite) BridgeCoinAmount ¶
func (s CrosschainPrecompileSuite) BridgeCoinAmount(ctx context.Context, args contract.BridgeCoinAmountArgs) *big.Int
func (CrosschainPrecompileSuite) ExecuteClaim ¶
func (s CrosschainPrecompileSuite) ExecuteClaim(ctx context.Context, from common.Address, args contract.ExecuteClaimArgs) *evmtypes.MsgEthereumTxResponse
func (CrosschainPrecompileSuite) HasOracle ¶
func (s CrosschainPrecompileSuite) HasOracle(ctx context.Context, args contract.HasOracleArgs) bool
func (CrosschainPrecompileSuite) IsOracleOnline ¶
func (s CrosschainPrecompileSuite) IsOracleOnline(ctx context.Context, args contract.IsOracleOnlineArgs) bool
func (CrosschainPrecompileSuite) WithError ¶
func (s CrosschainPrecompileSuite) WithError(err error) CrosschainPrecompileSuite
type ERC20TokenSuite ¶
type ERC20TokenSuite struct { *ContractBaseSuite ERC20TokenKeeper contract.ERC20TokenKeeper // contains filtered or unexported fields }
func NewERC20Suite ¶
func NewERC20Suite(require *require.Assertions, signer *Signer, evmKeeper *fxevmkeeper.Keeper) ERC20TokenSuite
func (ERC20TokenSuite) Approve ¶
func (s ERC20TokenSuite) Approve(ctx context.Context, spender common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
func (ERC20TokenSuite) Burn ¶
func (s ERC20TokenSuite) Burn(ctx context.Context, from common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
func (ERC20TokenSuite) DeployERC20Token ¶
func (ERC20TokenSuite) Deposit ¶
func (s ERC20TokenSuite) Deposit(ctx context.Context, value *big.Int) *evmtypes.MsgEthereumTxResponse
func (ERC20TokenSuite) Error ¶
func (s ERC20TokenSuite) Error(err error)
func (ERC20TokenSuite) Mint ¶
func (s ERC20TokenSuite) Mint(ctx context.Context, to common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
func (ERC20TokenSuite) TotalSupply ¶
func (s ERC20TokenSuite) TotalSupply(ctx context.Context) *big.Int
func (ERC20TokenSuite) Transfer ¶
func (s ERC20TokenSuite) Transfer(ctx context.Context, recipient common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
func (ERC20TokenSuite) TransferFrom ¶
func (s ERC20TokenSuite) TransferFrom(ctx context.Context, sender, recipient common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
func (ERC20TokenSuite) TransferOwnership ¶
func (s ERC20TokenSuite) TransferOwnership(ctx context.Context, newOwner common.Address) *evmtypes.MsgEthereumTxResponse
func (ERC20TokenSuite) WithError ¶
func (s ERC20TokenSuite) WithError(err error) ERC20TokenSuite
func (ERC20TokenSuite) Withdraw ¶
func (s ERC20TokenSuite) Withdraw(ctx context.Context, to common.Address, amount *big.Int) *evmtypes.MsgEthereumTxResponse
func (ERC20TokenSuite) WithdrawSelf ¶
func (s ERC20TokenSuite) WithdrawSelf(ctx context.Context, amount *big.Int) *evmtypes.MsgEthereumTxResponse
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer defines a type that is used on testing for signing MsgEthereumTx
func NewSigner ¶
func NewSigner(sk cryptotypes.PrivKey) *Signer
func (Signer) AccAddress ¶
func (s Signer) AccAddress() sdk.AccAddress
func (Signer) PrivKey ¶
func (s Signer) PrivKey() cryptotypes.PrivKey
type StakingPrecompileSuite ¶
type StakingPrecompileSuite struct { *ContractBaseSuite contract.StakingPrecompileKeeper // contains filtered or unexported fields }
func NewStakingPrecompileSuite ¶
func NewStakingPrecompileSuite(require *require.Assertions, signer *Signer, caller contract.Caller, contractAddr common.Address) StakingPrecompileSuite
func (StakingPrecompileSuite) AllowanceShares ¶
func (s StakingPrecompileSuite) AllowanceShares(ctx context.Context, args contract.AllowanceSharesArgs) *big.Int
func (StakingPrecompileSuite) ApproveShares ¶
func (s StakingPrecompileSuite) ApproveShares(ctx context.Context, args contract.ApproveSharesArgs) *evmtypes.MsgEthereumTxResponse
func (StakingPrecompileSuite) DelegateV2 ¶
func (s StakingPrecompileSuite) DelegateV2(ctx context.Context, args contract.DelegateV2Args) *evmtypes.MsgEthereumTxResponse
func (StakingPrecompileSuite) Delegation ¶
func (s StakingPrecompileSuite) Delegation(ctx context.Context, args contract.DelegationArgs) (*big.Int, *big.Int)
func (StakingPrecompileSuite) DelegationRewards ¶
func (s StakingPrecompileSuite) DelegationRewards(ctx context.Context, args contract.DelegationRewardsArgs) *big.Int
func (StakingPrecompileSuite) Error ¶
func (s StakingPrecompileSuite) Error(err error)
func (StakingPrecompileSuite) RedelegateV2 ¶
func (s StakingPrecompileSuite) RedelegateV2(ctx context.Context, args contract.RedelegateV2Args) *evmtypes.MsgEthereumTxResponse
func (StakingPrecompileSuite) SlashingInfo ¶
func (s StakingPrecompileSuite) SlashingInfo(ctx context.Context, args contract.SlashingInfoArgs) (bool, *big.Int)
func (StakingPrecompileSuite) TransferFromShares ¶
func (s StakingPrecompileSuite) TransferFromShares(ctx context.Context, args contract.TransferFromSharesArgs) (*evmtypes.MsgEthereumTxResponse, *contract.TransferFromSharesRet)
func (StakingPrecompileSuite) TransferShares ¶
func (s StakingPrecompileSuite) TransferShares(ctx context.Context, args contract.TransferSharesArgs) (*evmtypes.MsgEthereumTxResponse, *contract.TransferSharesRet)
func (StakingPrecompileSuite) UndelegateV2 ¶
func (s StakingPrecompileSuite) UndelegateV2(ctx context.Context, args contract.UndelegateV2Args) *evmtypes.MsgEthereumTxResponse
func (StakingPrecompileSuite) ValidatorList ¶
func (s StakingPrecompileSuite) ValidatorList(ctx context.Context, args contract.ValidatorListArgs) []string
func (StakingPrecompileSuite) WithError ¶
func (s StakingPrecompileSuite) WithError(err error) StakingPrecompileSuite
func (StakingPrecompileSuite) Withdraw ¶
func (s StakingPrecompileSuite) Withdraw(ctx context.Context, args contract.WithdrawArgs) (*evmtypes.MsgEthereumTxResponse, *big.Int)
Click to show internal directories.
Click to hide internal directories.