Documentation
¶
Index ¶
- type Client
- func (c *Client) AddBalance(amount *big.Int)
- func (c *Client) Address() common.Address
- func (c *Client) Balance() *big.Int
- func (c *Client) Deposit(ctx context.Context, amount *big.Int) error
- func (c *Client) Exit(ctx context.Context, bal *tee.BalanceProof) error
- func (c *Client) InvalidTxs(rng *rand.Rand, validRecipient common.Address) (txs []*tee.Transaction)
- func (c *Client) Send(recipient common.Address, amount *big.Int) error
- func (c *Client) SendInvalidTxs(rng *rand.Rand, validRecipient common.Address) (errs []error)
- func (c *Client) SendToClient(recipient *Client, amount *big.Int) error
- func (c *Client) SetMinedBlockNum(n uint64)
- func (c *Client) SignTx(tx *tee.Transaction)
- func (c *Client) TxEpoch() tee.Epoch
- func (c *Client) UpdateLastBlockNum()
- func (c *Client) Withdraw(ctx context.Context, bal *tee.BalanceProof) error
- type EnclaveTransactor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Nonce uint64 // contains filtered or unexported fields }
func NewClient ¶
func NewClient(params tee.Parameters, wallet tee.TextSigner, ethClient *eth.Client, tr tee.Transactor) (*Client, error)
NewClient creates a testing Erdstall client. The wallet w must contain the Account of ethClient for Erdstall TX sending.
func (*Client) AddBalance ¶
func (*Client) Deposit ¶
Deposit deposits amount to the Erdstall contract and waits until the deposit TX is mined. The minedBlockNum is updated automatically.
func (*Client) Exit ¶
Exit exits the Erdstall contract and waits until the exit TX is mined. The minedBlockNum is updated automatically.
func (*Client) InvalidTxs ¶
InvalidTxs generates a list of several invalid transactions, each having one of the following fields set to an invalid value: - Sig (random) - Nonce (+-1) - Epoch (+-1) - Sender (random) - Amount (1 above max, -1) The remaining fields are set to a valid value.
func (*Client) Send ¶
Send sends amount to the given recipient. If you need proper balance tracking for testing, use SendToClient instead.
func (*Client) SendInvalidTxs ¶
SendInvalidTxs sends several invalid transactions. It uses InvalidTxs, see its documentation for which invalid transactions are used.
func (*Client) SendToClient ¶
SendToClient sends amount to the given recipient. Use this if you need proper balance tracking in your tests.
func (*Client) SetMinedBlockNum ¶
func (*Client) SignTx ¶
func (c *Client) SignTx(tx *tee.Transaction)
func (*Client) TxEpoch ¶
TxEpoch return the current transaction epoch as calculated from the currently mined block number known to the client and the enclave parameters.
func (*Client) UpdateLastBlockNum ¶
func (c *Client) UpdateLastBlockNum()
type EnclaveTransactor ¶
func (*EnclaveTransactor) Send ¶
func (et *EnclaveTransactor) Send(tx *tee.Transaction) error