Documentation ¶
Index ¶
- type Enclave
- func (e *Enclave) BalanceProofs() (ret []*tee.BalanceProof, err error)
- func (e *Enclave) DepositProofs() (ret []*tee.DepositProof, err error)
- func (e *Enclave) Init() (common.Address, []byte, error)
- func (e *Enclave) Log() *log.Entry
- func (e *Enclave) ProcessBlocks(...*tee.Block) error
- func (e *Enclave) ProcessTXs(txs ...*tee.Transaction) error
- func (e *Enclave) PushBalanceProof(proof *tee.BalanceProof)
- func (e *Enclave) PushDepositProof(proof *tee.DepositProof)
- func (e *Enclave) Run(tee.Parameters) error
- func (e *Enclave) SetProcessTXsError(err error)
- func (e *Enclave) Shutdown()
- func (e *Enclave) Transactions() <-chan *tee.Transaction
- type RPCOperator
- type User
- func (u *User) Account() accounts.Account
- func (u *User) Address() common.Address
- func (u *User) BalanceProof(ctx context.Context)
- func (u *User) Challenge()
- func (u *User) Deposit()
- func (u *User) DepositProof(ctx context.Context)
- func (u *User) Nonce() uint64
- func (u *User) SubscribeExitEvents() (event.Subscription, chan *bindings.ErdstallExiting)
- func (u *User) Transfer(ctx context.Context, receiver *User, amount int64)
- func (u *User) TxReceipt(ctx context.Context) tee.Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Enclave ¶
type Enclave struct {
// contains filtered or unexported fields
}
func NewMockedEnclave ¶
func NewMockedEnclave() *Enclave
func (*Enclave) BalanceProofs ¶
func (e *Enclave) BalanceProofs() (ret []*tee.BalanceProof, err error)
func (*Enclave) DepositProofs ¶
func (e *Enclave) DepositProofs() (ret []*tee.DepositProof, err error)
func (*Enclave) ProcessTXs ¶
func (e *Enclave) ProcessTXs(txs ...*tee.Transaction) error
func (*Enclave) PushBalanceProof ¶
func (e *Enclave) PushBalanceProof(proof *tee.BalanceProof)
func (*Enclave) PushDepositProof ¶
func (e *Enclave) PushDepositProof(proof *tee.DepositProof)
func (*Enclave) SetProcessTXsError ¶
func (*Enclave) Transactions ¶
func (e *Enclave) Transactions() <-chan *tee.Transaction
type RPCOperator ¶
type RPCOperator struct {
// contains filtered or unexported fields
}
RPCOperator is a mocked operator.WireAPI. It can be used as an WireAPI for testing the operators RPC module, since it expects an operator.WireAPI.
There are two functions for setting errors that should be returned when the mocked functions are called.
func NewRPROperator ¶
func NewRPROperator(enclave *Enclave) *RPCOperator
NewRPROperator returns a new mocked WireAPI.
func (*RPCOperator) Run ¶
func (r *RPCOperator) Run()
Run pulls the proofs from the enclave and writes them to the subscriptions. This is normally done by the Operator. Returns immediately.
func (*RPCOperator) Send ¶
func (r *RPCOperator) Send(tx tee.Transaction) error
Send is part of the operator.WireAPI interface and adds a Transaction to the enclave. Can be read back from Transactions() which bufferes one TX. Returns the error that was set by SetSendError.
func (*RPCOperator) SetSubscribeProofsError ¶
func (r *RPCOperator) SetSubscribeProofsError(err error)
SetSubscribeProofsError sets the error that should be returned by SubscribeProofs.
func (*RPCOperator) SubscribeProofs ¶
SubscribeProofs subscribed to the proofs that can be added via PushDepositProof and PushBalanceProof which buffers one proof. Returns the error that was set by SetSubscribeProofsError.
type User ¶
User represents a TEE Plasma user.
func CreateUser ¶
func CreateUser( t *testing.T, ethURL string, wallet accounts.Wallet, account accounts.Account, rpcHost string, rpcPort uint16, contractAddress common.Address, enclaveParameters tee.Parameters, ) *User
CreateUser creates a new user and connects it to the operator.
func (*User) BalanceProof ¶
BalanceProof returns the balance proof for the last epoch.
func (*User) Challenge ¶
func (u *User) Challenge()
Challenge challenges the operator for the balance proof of the current epoch.
func (*User) Deposit ¶
func (u *User) Deposit()
Deposit deposits the current target balance at the TEE Plasma.
func (*User) DepositProof ¶
DepositProof returns the deposit proof for the last epoch.
func (*User) SubscribeExitEvents ¶
func (u *User) SubscribeExitEvents() (event.Subscription, chan *bindings.ErdstallExiting)
SubscribeExitEvents subscribes the user the exit events.