Documentation ¶
Overview ¶
This package contains functions to help using the Go-ethereum library. It is not the objective of this package to replace or hide Go-ethereum.
Index ¶
- Constants
- func AddInput(ctx context.Context, client *ethclient.Client, book *addresses.Book, ...) (int, error)
- func ExecuteVoucher(ctx context.Context, client *ethclient.Client, book *addresses.Book, ...) (*common.Hash, error)
- func GetInputFromInputBox(client *ethclient.Client, book *addresses.Book, inputIndex int) (*contracts.InputBoxInputAdded, error)
- func ValidateNotice(ctx context.Context, client *ethclient.Client, book *addresses.Book, ...) error
- type MnemonicSigner
- type Signer
Constants ¶
const FoundryMnemonic = "test test test test test test test test test test test junk"
Dev mnemonic used by Foundry/Anvil.
const GasLimit = 30_000_000
Gas limit when sending transactions.
const PollInterval = 100 * time.Millisecond
Variables ¶
This section is empty.
Functions ¶
func AddInput ¶
func AddInput( ctx context.Context, client *ethclient.Client, book *addresses.Book, signer Signer, input []byte, ) (int, error)
Add input to the input box for the given DApp address. This function waits until the transaction is added to a block and return the input index.
func ExecuteVoucher ¶
func ExecuteVoucher( ctx context.Context, client *ethclient.Client, book *addresses.Book, signer Signer, voucher []byte, destination *common.Address, proof *contracts.Proof, ) (*common.Hash, error)
Executes a voucher given its payload, destination and proof. This function waits until the transaction is added to a block and returns the transaction hash.
func GetInputFromInputBox ¶
func GetInputFromInputBox( client *ethclient.Client, book *addresses.Book, inputIndex int, ) (*contracts.InputBoxInputAdded, error)
Get the given input of the given DApp from the input box. Return the event with the input sender and payload.
func ValidateNotice ¶
func ValidateNotice( ctx context.Context, client *ethclient.Client, book *addresses.Book, notice []byte, proof *contracts.Proof, ) error
ValidateNotice validates the given notice for the specified Dapp. It returns nil if the notice is valid and an execution-reverted error otherwise.
Types ¶
type MnemonicSigner ¶
type MnemonicSigner struct {
// contains filtered or unexported fields
}
Sign transactions using a mnemonic.
func NewMnemonicSigner ¶
func NewMnemonicSigner( ctx context.Context, client *ethclient.Client, mnemonic string, accountIndex uint32, ) (*MnemonicSigner, error)
Create a new mnemonic signer. Uses the client to get the chain ID.
func (*MnemonicSigner) Account ¶
func (s *MnemonicSigner) Account() common.Address
func (*MnemonicSigner) MakeTransactor ¶
func (s *MnemonicSigner) MakeTransactor() (*bind.TransactOpts, error)