Documentation ¶
Index ¶
- type AuthClientUser
- func (s *AuthClientUser) AwaitReceipt(ctx context.Context, txHash *gethcommon.Hash) (*types.Receipt, error)
- func (s *AuthClientUser) EnsureClientSetup(ctx context.Context) error
- func (s *AuthClientUser) Init(ctx context.Context) (*AuthClientUser, error)
- func (s *AuthClientUser) NativeBalance(ctx context.Context) (*big.Int, error)
- func (s *AuthClientUser) SendFunds(ctx context.Context, addr gethcommon.Address, value *big.Int) (*gethcommon.Hash, error)
- func (s *AuthClientUser) SendTransaction(ctx context.Context, tx types.TxData) (*gethcommon.Hash, error)
- func (s *AuthClientUser) Wallet() wallet.Wallet
- type GatewayUser
- func (g *GatewayUser) AwaitReceipt(ctx context.Context, txHash *gethcommon.Hash) (*types.Receipt, error)
- func (g *GatewayUser) Client() *ethclient.Client
- func (g *GatewayUser) NativeBalance(ctx context.Context) (*big.Int, error)
- func (g *GatewayUser) SendFunds(ctx context.Context, addr gethcommon.Address, value *big.Int) (*gethcommon.Hash, error)
- func (g *GatewayUser) WSClient() (*ethclient.Client, error)
- func (g *GatewayUser) Wallet() wallet.Wallet
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthClientUser ¶ added in v0.22.1
type AuthClientUser struct {
// contains filtered or unexported fields
}
AuthClientUser is a test user that uses the auth client to talk to directly to a node Note: AuthClientUser is **not** thread-safe for a single wallet (creates nonce conflicts etc.)
func NewUserWallet ¶
func (*AuthClientUser) AwaitReceipt ¶ added in v0.22.1
func (s *AuthClientUser) AwaitReceipt(ctx context.Context, txHash *gethcommon.Hash) (*types.Receipt, error)
func (*AuthClientUser) EnsureClientSetup ¶ added in v0.22.1
func (s *AuthClientUser) EnsureClientSetup(ctx context.Context) error
EnsureClientSetup creates an authenticated RPC client (with a viewing key generated, signed and registered) when first called Also fetches current nonce value.
func (*AuthClientUser) Init ¶ added in v0.22.1
func (s *AuthClientUser) Init(ctx context.Context) (*AuthClientUser, error)
Init forces VK setup: currently the faucet http server requires a viewing key for a wallet to even *receive* funds :(
func (*AuthClientUser) NativeBalance ¶ added in v0.22.1
func (*AuthClientUser) SendFunds ¶ added in v0.22.1
func (s *AuthClientUser) SendFunds(ctx context.Context, addr gethcommon.Address, value *big.Int) (*gethcommon.Hash, error)
func (*AuthClientUser) SendTransaction ¶ added in v0.22.1
func (s *AuthClientUser) SendTransaction(ctx context.Context, tx types.TxData) (*gethcommon.Hash, error)
func (*AuthClientUser) Wallet ¶ added in v0.22.1
func (s *AuthClientUser) Wallet() wallet.Wallet
type GatewayUser ¶ added in v0.22.1
type GatewayUser struct {
// contains filtered or unexported fields
}
func NewGatewayUser ¶ added in v0.22.1
func (*GatewayUser) AwaitReceipt ¶ added in v0.22.1
func (g *GatewayUser) AwaitReceipt(ctx context.Context, txHash *gethcommon.Hash) (*types.Receipt, error)
func (*GatewayUser) Client ¶ added in v0.24.2
func (g *GatewayUser) Client() *ethclient.Client
func (*GatewayUser) NativeBalance ¶ added in v0.22.1
func (*GatewayUser) SendFunds ¶ added in v0.22.1
func (g *GatewayUser) SendFunds(ctx context.Context, addr gethcommon.Address, value *big.Int) (*gethcommon.Hash, error)
func (*GatewayUser) WSClient ¶ added in v0.24.1
func (g *GatewayUser) WSClient() (*ethclient.Client, error)
func (*GatewayUser) Wallet ¶ added in v0.22.1
func (g *GatewayUser) Wallet() wallet.Wallet
type User ¶ added in v0.22.1
type User interface { Wallet() wallet.Wallet SendFunds(ctx context.Context, addr gethcommon.Address, value *big.Int) (*gethcommon.Hash, error) AwaitReceipt(ctx context.Context, txHash *gethcommon.Hash) (*types.Receipt, error) NativeBalance(ctx context.Context) (*big.Int, error) }
User - abstraction for networktest users - two implementations initially: 1. AuthClientUser - a user that uses the auth client to talk to the network 2. GatewayUser - a user that uses the gateway to talk to the network
This abstraction allows us to use the same tests for both types of users