mock

package
v0.0.0-...-7838e69 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Processes map[uint64]process.Service

Processes is a map of local process services.

Functions

This section is empty.

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

Account is a mock account.

func NewAccount

func NewAccount(name string, passphrase []byte) *Account

NewAccount creates a new account.

func (*Account) ID

func (a *Account) ID() uuid.UUID

ID provides the ID for the account.

func (*Account) IsUnlocked

func (a *Account) IsUnlocked(ctx context.Context) (bool, error)

IsUnlocked returns true if the account is unlocked.

func (*Account) Lock

func (a *Account) Lock(ctx context.Context) error

Lock locks the account. A locked account cannot sign.

func (*Account) Name

func (a *Account) Name() string

Name provides the name for the account.

func (*Account) Path

func (a *Account) Path() string

Path provides the path for the account. Can be empty if the account is not derived from a path.

func (*Account) PublicKey

func (a *Account) PublicKey() e2types.PublicKey

PublicKey provides the public key for the account.

func (*Account) Sign

func (a *Account) Sign(ctx context.Context, data []byte) (e2types.Signature, error)

Sign signs data with the account.

func (*Account) Unlock

func (a *Account) Unlock(ctx context.Context, passphrase []byte) error

Unlock unlocks the account. An unlocked account can sign.

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

Wallet is a mock wallet structure.

func NewWallet

func NewWallet(name string) *Wallet

NewWallet creates a new wallet.

func (*Wallet) Accounts

func (a *Wallet) Accounts(ctx context.Context) <-chan e2wtypes.Account

Accounts returns the accounts in the wallet.

func (*Wallet) ID

func (a *Wallet) ID() uuid.UUID

ID provides the ID for the wallet.

func (*Wallet) Name

func (a *Wallet) Name() string

Name provides the name for the wallet.

func (*Wallet) Type

func (a *Wallet) Type() string

Type returns the type for the wallet.

func (*Wallet) Version

func (a *Wallet) Version() uint

Version returns the version for the wallet.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL