test_utils

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Deployer = NewAccountFromKey(deployerPrivateKey)
)

Functions

func NewPrivateKeySigner

func NewPrivateKeySigner(key *ecdsa.PrivateKey) *privateKeySigner

Types

type AbiData

type AbiData struct {
	AbiData string
	BinData string
}

type AbiList

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

func ParseAbis

func ParseAbis(abiMap AbiMap) (*AbiList, error)

func (*AbiList) InputLookup

func (abis *AbiList) InputLookup(data []byte) (string, *abi.Method, error)

func (*AbiList) LookupByTx

func (abis *AbiList) LookupByTx(tx *types.Transaction) (string, *abi.Method, error)

func (*AbiList) Register

func (abis *AbiList) Register(abi NamedABI, codeHash string)

type AbiMap

type AbiMap map[string]AbiData

type EthAccount

type EthAccount struct {
	PrivateKey *ecdsa.PrivateKey
	PublicKey  ecdsa.PublicKey
	Address    common.Address
	Transactor *bind.TransactOpts
}

func NewAccountFromKey

func NewAccountFromKey(privateKey *ecdsa.PrivateKey) *EthAccount

func NewRandomAccount

func NewRandomAccount() (*EthAccount, error)

type MystIdentity

type MystIdentity struct {
	PublicKey *ecdsa.PublicKey
	Address   common.Address
	// contains filtered or unexported fields
}

func NewMystIdentity

func NewMystIdentity() (*MystIdentity, error)

func (MystIdentity) GetPublicKey

func (pkh MystIdentity) GetPublicKey() (ecdsa.PublicKey, error)

func (MystIdentity) Sign

func (pkh MystIdentity) Sign(data ...[]byte) ([]byte, error)

type NamedABI

type NamedABI struct {
	Abi  abi.ABI
	Name string
}

type TransactionalBackend

type TransactionalBackend interface {
	bind.ContractBackend
	Commit()                                                                            //taken from Simulated backend
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) //taken from Simulated backend
}

func LoggingBackend

func LoggingBackend(sb TransactionalBackend, abis *AbiList) TransactionalBackend

func NewSimulatedBackend

func NewSimulatedBackend(genesisAddress common.Address, initialAmmount int64) TransactionalBackend

Keep in mind that initial amount is actually in Gwei - you need really HUGE numbers here to make more than few simple transactions

type TxLoggingBackend

type TxLoggingBackend struct {
	TransactionalBackend
	// contains filtered or unexported fields
}

func (*TxLoggingBackend) CallContract

func (sb *TxLoggingBackend) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

func (*TxLoggingBackend) SendTransaction

func (sb *TxLoggingBackend) SendTransaction(ctx context.Context, tx *types.Transaction) error

Jump to

Keyboard shortcuts

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