ethereum

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: LGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const EthAEndpoint = "ws://localhost:8545"
View Source
const EthBEndpoint = "ws://localhost:8546"

Variables

View Source
var AliceKp = keystore.TestKeyRing.EthereumKeys[keystore.AliceKey]
View Source
var CharlieKp = keystore.TestKeyRing.EthereumKeys[keystore.BobKey]
View Source
var DaveKp = keystore.TestKeyRing.EthereumKeys[keystore.DaveKey]
View Source
var EveKp = keystore.TestKeyRing.EthereumKeys[keystore.EveKey]
View Source
var TestTimeout = time.Second * 30

Functions

func CreateConfig

func CreateConfig(key string, chain msg.ChainId, contracts *utils.DeployedContracts, endpoint string) *core.ChainConfig

func CreateErc20Deposit

func CreateErc20Deposit(t *testing.T, client *utils.Client, destId msg.ChainId, recipient []byte, amount *big.Int, contracts *utils.DeployedContracts, rId msg.ResourceId)

func CreateErc721Deposit

func CreateErc721Deposit(t *testing.T, client *utils.Client, destId msg.ChainId, recipient []byte, tokenId *big.Int, contracts *utils.DeployedContracts, rId msg.ResourceId)

func CreateEthClient

func CreateEthClient(t *testing.T, endpoint string, kp *secp256k1.Keypair) (*ethclient.Client, *bind.TransactOpts)

func CreateGenericDeposit

func CreateGenericDeposit(t *testing.T, client *utils.Client, destId msg.ChainId, metadata []byte, contracts *utils.DeployedContracts, rId msg.ResourceId)

func DeployTestContracts

func DeployTestContracts(t *testing.T, client *utils.Client, endpoint string, id msg.ChainId, threshold *big.Int) *utils.DeployedContracts

func WaitForProposalActive

func WaitForProposalActive(t *testing.T, client *utils.Client, bridge common.Address, nonce uint64)

func WaitForProposalExecutedEvent

func WaitForProposalExecutedEvent(t *testing.T, client *utils.Client, bridge common.Address, nonce uint64)

Types

type TestContext

type TestContext struct {
	BaseContracts *utils.DeployedContracts // All the contracts required for the bridge
	TestContracts TestContracts            // Additional contracts for tests (eg. erc contracts)
	Client        *utils.Client
}

type TestContracts

type TestContracts struct {
	Erc20Sub      common.Address // Contract configured for substrate erc20 transfers
	Erc20Eth      common.Address // Contact configured for eth to eth erc20 transfer
	Erc721Sub     common.Address // Contract configured for substrate erc721 transfers
	Erc721Eth     common.Address // Contract configured for eth to eth erc721 transfer
	AssetStoreSub common.Address // Contract configure for substrate generic transfer
	AssetStoreEth common.Address // Contract configured for eth to eth generic transfer
}

Jump to

Keyboard shortcuts

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