ethereum

package
v8.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GWEI  = 1_000_000_000
	ETHER = 1_000_000_000 * GWEI
)

Variables

This section is empty.

Functions

func AddSignature

func AddSignature(cmd []string, signature string) []string

Add signature function to cmd, if present

func DefaultEthereumAnvilChainConfig

func DefaultEthereumAnvilChainConfig(
	name string,
) ibc.ChainConfig

func GetConfigFilePath

func GetConfigFilePath(configFile, localContractRootDir, solidityContractDir string) string

func NewWallet

func NewWallet(keyname string, address string) ibc.Wallet

func PanicFunctionName

func PanicFunctionName()

func ReadAndAppendConfigFile

func ReadAndAppendConfigFile(cmd []string, configFile, localContractRootDir, solidityContractDir string) ([]string, []byte, error)

ReadAndAppendConfigFile, returns the cmd, configFileBz

func WriteConfigFile

func WriteConfigFile(configFile string, localContractRootDir string, solidityContractDir string, configFileBz []byte) error

WriteConfigFile - if config file is present, we need to overwrite what forge changed

Types

type EthereumChain

type EthereumChain struct {
	VolumeName   string
	NetworkID    string
	DockerClient *dockerclient.Client
	// contains filtered or unexported fields
}

func NewEthereumChain

func NewEthereumChain(testName string, chainConfig ibc.ChainConfig, log *zap.Logger) *EthereumChain

func (*EthereumChain) Acknowledgements

func (c *EthereumChain) Acknowledgements(ctx context.Context, height int64) ([]ibc.PacketAcknowledgement, error)

func (*EthereumChain) AddKey

func (c *EthereumChain) AddKey(cmd []string, keyName string) []string

Add private-key or keystore to cmd

func (*EthereumChain) Bind

func (c *EthereumChain) Bind() []string

func (*EthereumChain) BuildRelayerWallet

func (c *EthereumChain) BuildRelayerWallet(ctx context.Context, keyName string) (ibc.Wallet, error)

func (*EthereumChain) BuildWallet

func (c *EthereumChain) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error)

func (*EthereumChain) Config

func (c *EthereumChain) Config() ibc.ChainConfig

func (*EthereumChain) CreateKey

func (c *EthereumChain) CreateKey(ctx context.Context, keyName string) error

func (*EthereumChain) Exec

func (c *EthereumChain) Exec(ctx context.Context, cmd []string, env []string) (stdout, stderr []byte, err error)

func (*EthereumChain) ExportState

func (c *EthereumChain) ExportState(ctx context.Context, height int64) (string, error)

func (*EthereumChain) ForgeScript

func (c *EthereumChain) ForgeScript(ctx context.Context, keyName string, opts ForgeScriptOpts) (stdout, stderr []byte, err error)

Run "forge script" see: https://book.getfoundry.sh/reference/forge/forge-script

func (*EthereumChain) GetAddress

func (c *EthereumChain) GetAddress(ctx context.Context, keyName string) ([]byte, error)

Get address of account, cast to a string to use

func (*EthereumChain) GetBalance

func (c *EthereumChain) GetBalance(ctx context.Context, address string, denom string) (sdkmath.Int, error)

func (*EthereumChain) GetGRPCAddress

func (c *EthereumChain) GetGRPCAddress() string

func (*EthereumChain) GetGasFeesInNativeDenom

func (c *EthereumChain) GetGasFeesInNativeDenom(gasPaid int64) int64

func (*EthereumChain) GetHostGRPCAddress

func (c *EthereumChain) GetHostGRPCAddress() string

func (*EthereumChain) GetHostPeerAddress

func (*EthereumChain) GetHostPeerAddress() string

func (*EthereumChain) GetHostRPCAddress

func (c *EthereumChain) GetHostRPCAddress() string

func (*EthereumChain) GetHostWSAddress

func (c *EthereumChain) GetHostWSAddress() string

func (*EthereumChain) GetRPCAddress

func (c *EthereumChain) GetRPCAddress() string

func (*EthereumChain) GetWSAddress

func (c *EthereumChain) GetWSAddress() string

func (*EthereumChain) Height

func (c *EthereumChain) Height(ctx context.Context) (int64, error)

func (*EthereumChain) HomeDir

func (c *EthereumChain) HomeDir() string

func (*EthereumChain) HostName

func (c *EthereumChain) HostName() string

func (*EthereumChain) Initialize

func (c *EthereumChain) Initialize(ctx context.Context, testName string, cli *dockerclient.Client, networkID string) error

func (*EthereumChain) KeystoreDir

func (c *EthereumChain) KeystoreDir() string

func (*EthereumChain) MakeKeystoreDir

func (c *EthereumChain) MakeKeystoreDir(ctx context.Context) error

func (*EthereumChain) Name

func (c *EthereumChain) Name() string

func (*EthereumChain) RecoverKey

func (c *EthereumChain) RecoverKey(ctx context.Context, keyName, mnemonic string) error

cast wallet import requires a password prompt which docker isn't properly handling. For now, we only use CreateKey().

func (*EthereumChain) SendFunds

func (c *EthereumChain) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error

func (*EthereumChain) SendIBCTransfer

func (c *EthereumChain) SendIBCTransfer(ctx context.Context, channelID, keyName string, amount ibc.WalletAmount, options ibc.TransferOptions) (ibc.Tx, error)

func (*EthereumChain) Start

func (c *EthereumChain) Start(testName string, ctx context.Context, additionalGenesisWallets ...ibc.WalletAmount) error

func (*EthereumChain) Timeouts

func (c *EthereumChain) Timeouts(ctx context.Context, height int64) ([]ibc.PacketTimeout, error)

type EthereumWallet

type EthereumWallet struct {
	// contains filtered or unexported fields
}

func (*EthereumWallet) Address

func (w *EthereumWallet) Address() []byte

Get Address with chain's prefix

func (*EthereumWallet) FormattedAddress

func (w *EthereumWallet) FormattedAddress() string

Get formatted address, passing in a prefix

func (*EthereumWallet) KeyName

func (w *EthereumWallet) KeyName() string

func (*EthereumWallet) Mnemonic

func (w *EthereumWallet) Mnemonic() string

Get mnemonic, only used for relayer wallets

type ForgeScriptOpts

type ForgeScriptOpts struct {
	ContractRootDir  string   // required, root directory of the contract with all local dependencies
	SolidityContract string   // required, contract script to run
	SignatureFn      string   // optional, signature function to run, empty string uses default run()
	ConfigFile       string   // optional, json config file used for sol contract
	RawOptions       []string // optional, appends additional options to command
}

cli options for the `forge script` command see: https://book.getfoundry.sh/reference/forge/forge-script

type GenesisWallets

type GenesisWallets struct {
	// contains filtered or unexported fields
}

func NewGenesisWallet

func NewGenesisWallet() GenesisWallets

func (*GenesisWallets) GetFaucetWallet

func (w *GenesisWallets) GetFaucetWallet(keyname string) ibc.Wallet

type NewWalletOutput

type NewWalletOutput struct {
	Address string `json:"address"`
	Path    string `json:"path"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL