0x-mesh: github.com/0xProject/0x-mesh/ethereum Index | Files | Directories

package ethereum

import "github.com/0xProject/0x-mesh/ethereum"

Index

Package Files

blockchain_lifecycle.go contract_addresses.go

Variables

var GanacheAddresses = ganacheAddresses()

GanacheAddresses The addresses that the 0x contracts were deployed to on the Ganache snapshot (chainID = 1337).

func ValidateContractAddressesForChainID Uses

func ValidateContractAddressesForChainID(chainID int, addresses ContractAddresses) error

type BlockchainLifecycle Uses

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 Uses

func NewBlockchainLifecycle(rpcClient *rpc.Client) (*BlockchainLifecycle, error)

NewBlockchainLifecycle instantiates a new blockchainLifecycle instance

func (*BlockchainLifecycle) Mine Uses

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 Uses

func (b *BlockchainLifecycle) Revert(t *testing.T)

Revert reverts the latest snapshot of blockchain state created

func (*BlockchainLifecycle) Start Uses

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 Uses

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 Uses

func NewContractAddressesForChainID(chainID int) (ContractAddresses, error)

NewContractAddressesForChainID The default contract addresses for the standard chainIDs.

Directories

PathSynopsis
blockwatch
ethrpcclient
ratelimit
signer
simplestack
wrappers

Package ethereum imports 7 packages (graph) and is imported by 7 packages. Updated 2020-10-19. Refresh now. Tools for package owners.