Documentation ¶
Index ¶
- Constants
- type BaseGenerator
- type ContractArtifact
- type ContractTxnGenerator
- type ContractTxnsGenerator
- func (gen *ContractTxnsGenerator) GenerateTransaction() (*types.Transaction, error)
- func (gen *ContractTxnsGenerator) GetExampleTransaction() (*types.Transaction, error)
- func (gen *ContractTxnsGenerator) MarkFailedContractTxn(failedContractTxn *FailedContractTxnInfo)
- func (gen *ContractTxnsGenerator) SetContractAddress(addr types.Address)
- type DeployGenerator
- type FailedContractTxnInfo
- type FailedTxnInfo
- type GeneratorParams
- type TransactionGenerator
- type TransferGenerator
- type TxnError
- type TxnErrorType
Constants ¶
View Source
const ( //nolint:lll DefaultContractBytecode = "" /* 8436-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseGenerator ¶
type BaseGenerator struct {
// contains filtered or unexported fields
}
func (*BaseGenerator) GetTransactionErrors ¶
func (bg *BaseGenerator) GetTransactionErrors() []*FailedTxnInfo
func (*BaseGenerator) MarkFailedTxn ¶
func (bg *BaseGenerator) MarkFailedTxn(failedTxn *FailedTxnInfo)
func (*BaseGenerator) SetGasEstimate ¶
func (bg *BaseGenerator) SetGasEstimate(gasEstimate uint64)
type ContractArtifact ¶
func ReadContractArtifact ¶
func ReadContractArtifact(configPath string) (*ContractArtifact, error)
ReadContractArtifact reads the contract bytecode from the specified path
type ContractTxnGenerator ¶
type ContractTxnGenerator interface { TransactionGenerator MarkFailedContractTxn(failedContractTxn *FailedContractTxnInfo) SetContractAddress(types.Address) }
type ContractTxnsGenerator ¶
type ContractTxnsGenerator struct { BaseGenerator // contains filtered or unexported fields }
func NewERC20Generator ¶
func NewERC20Generator(params *GeneratorParams) (*ContractTxnsGenerator, error)
call ERC20 contract method and encode parameters
func NewERC721Generator ¶
func NewERC721Generator(params *GeneratorParams) (*ContractTxnsGenerator, error)
call ERC721 contract method and encode parameters
func (*ContractTxnsGenerator) GenerateTransaction ¶
func (gen *ContractTxnsGenerator) GenerateTransaction() (*types.Transaction, error)
func (*ContractTxnsGenerator) GetExampleTransaction ¶
func (gen *ContractTxnsGenerator) GetExampleTransaction() (*types.Transaction, error)
Returns contract deployment tx if contractAddress is empty, otherwise returns a token transfer tx
func (*ContractTxnsGenerator) MarkFailedContractTxn ¶
func (gen *ContractTxnsGenerator) MarkFailedContractTxn(failedContractTxn *FailedContractTxnInfo)
func (*ContractTxnsGenerator) SetContractAddress ¶
func (gen *ContractTxnsGenerator) SetContractAddress(addr types.Address)
type DeployGenerator ¶
type DeployGenerator struct { BaseGenerator // contains filtered or unexported fields }
func NewDeployGenerator ¶
func NewDeployGenerator(params *GeneratorParams) (*DeployGenerator, error)
func (*DeployGenerator) GenerateTransaction ¶
func (dg *DeployGenerator) GenerateTransaction() (*types.Transaction, error)
func (*DeployGenerator) GetExampleTransaction ¶
func (dg *DeployGenerator) GetExampleTransaction() (*types.Transaction, error)
type FailedContractTxnInfo ¶
type FailedTxnInfo ¶
type GeneratorParams ¶
type GeneratorParams struct { Nonce uint64 ChainID uint64 SenderAddress types.Address RecieverAddress types.Address SenderKey *ecdsa.PrivateKey Value *big.Int GasPrice *big.Int ContractArtifact *ContractArtifact ConstructorArgs []byte // smart contract constructor arguments ContractAddress web3.Address }
type TransactionGenerator ¶
type TransactionGenerator interface { GenerateTransaction() (*types.Transaction, error) GetExampleTransaction() (*types.Transaction, error) GetTransactionErrors() []*FailedTxnInfo SetGasEstimate(gasEstimate uint64) MarkFailedTxn(failedTxn *FailedTxnInfo) }
type TransferGenerator ¶
type TransferGenerator struct { BaseGenerator // contains filtered or unexported fields }
func NewTransferGenerator ¶
func NewTransferGenerator(params *GeneratorParams) (*TransferGenerator, error)
func (*TransferGenerator) GenerateTransaction ¶
func (tg *TransferGenerator) GenerateTransaction() (*types.Transaction, error)
func (*TransferGenerator) GetExampleTransaction ¶
func (tg *TransferGenerator) GetExampleTransaction() (*types.Transaction, error)
type TxnError ¶
type TxnError struct { Error error ErrorType TxnErrorType }
type TxnErrorType ¶
type TxnErrorType string
const ( ReceiptErrorType TxnErrorType = "ReceiptErrorType" AddErrorType TxnErrorType = "AddErrorType" ContractDeployType TxnErrorType = "ContractDeployErrorType" )
Click to show internal directories.
Click to hide internal directories.