Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GanacheAddresses = ganacheAddresses()
GanacheAddresses The addresses that the 0x contracts were deployed to on the Ganache snapshot (chainID = 1337).
Functions ¶
func ValidateContractAddressesForChainID ¶
func ValidateContractAddressesForChainID(chainID int, addresses ContractAddresses) error
Types ¶
type BlockchainLifecycle ¶
type BlockchainLifecycle struct {
// contains filtered or unexported fields
}
BlockchainLifecycle is a testing utility for taking snapshots of the blockchain state on Ganache and reverting those snapshots at a later point in time. Ganache supports performing multiple snapshots that can then be reverted in LIFO order.
func NewBlockchainLifecycle ¶
func NewBlockchainLifecycle(rpcClient *rpc.Client) (*BlockchainLifecycle, error)
NewBlockchainLifecycle instantiates a new blockchainLifecycle instance
func (*BlockchainLifecycle) Mine ¶
func (b *BlockchainLifecycle) Mine(t *testing.T, blockTimestamp time.Time)
Mine force-mines a block with the specified block timestamp WARNING(fabio): Using this method will brick `eth_getLogs` such that it always returns the logs for the latest block, even if a specific blockHash is specified Source: https://github.com/trufflesuite/ganache-cli/issues/708
func (*BlockchainLifecycle) Revert ¶
func (b *BlockchainLifecycle) Revert(t *testing.T)
Revert reverts the latest snapshot of blockchain state created
func (*BlockchainLifecycle) Start ¶
func (b *BlockchainLifecycle) Start(t *testing.T)
Start creates a snapshot of the blockchain state at that point in time and adds it's snapshotId to a stack
type ContractAddresses ¶
type ContractAddresses struct { ERC20Proxy common.Address `json:"erc20Proxy"` ERC721Proxy common.Address `json:"erc721Proxy"` ERC1155Proxy common.Address `json:"erc1155Proxy"` Exchange common.Address `json:"exchange"` // TODO(jalextowle): This should be removed when 0x v4 is released. ExchangeProxyFlashWallet common.Address `json:"exchangeProxyFlashWallet"` DevUtils common.Address `json:"devUtils"` WETH9 common.Address `json:"weth9"` ZRXToken common.Address `json:"zrxToken"` ChaiBridge common.Address `json:"chaiBridge"` ChaiToken common.Address `json:"chaiToken"` MaximumGasPrice common.Address `json:"maximumGasPrice"` }
ContractAddresses maps a contract's name to it's Ethereum address
func NewContractAddressesForChainID ¶
func NewContractAddressesForChainID(chainID int) (ContractAddresses, error)
NewContractAddressesForChainID The default contract addresses for the standard chainIDs.