keyring

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntegrationKeyring

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

IntegrationKeyring is a keyring designed for integration tests.

func (*IntegrationKeyring) AddKey

func (kr *IntegrationKeyring) AddKey() int

AddKey adds a new account to the keyring. It returns the index for the key

func (*IntegrationKeyring) GetAccAddr

func (kr *IntegrationKeyring) GetAccAddr(index int) sdktypes.AccAddress

GetAccAddr returns the sdk address of the specified account.

func (*IntegrationKeyring) GetAddr

func (kr *IntegrationKeyring) GetAddr(index int) common.Address

GetAddr returns the address of the specified account.

func (*IntegrationKeyring) GetAllAccAddrs

func (kr *IntegrationKeyring) GetAllAccAddrs() []sdktypes.AccAddress

GetAllAccAddrs returns all the sdk addresses of the accounts in the keyring.

func (*IntegrationKeyring) GetKey

func (kr *IntegrationKeyring) GetKey(index int) Key

GetKey returns the key specified by index

func (*IntegrationKeyring) GetPrivKey

func (kr *IntegrationKeyring) GetPrivKey(index int) cryptotypes.PrivKey

GetPrivKey returns the private key of the specified account.

func (*IntegrationKeyring) Sign

func (kr *IntegrationKeyring) Sign(index int, msg []byte) ([]byte, error)

Sign signs message with the specified key.

type Key

type Key struct {
	Addr    common.Address
	AccAddr sdktypes.AccAddress
	Priv    cryptotypes.PrivKey
}

func NewKey

func NewKey() Key

type Keyring

type Keyring interface {
	// GetPrivKey returns the private key of the account at the given keyring index.
	GetPrivKey(index int) cryptotypes.PrivKey
	// GetAddr returns the address of the account at the given keyring index.
	GetAddr(index int) common.Address
	// GetAccAddr returns the SDK address of the account at the given keyring index.
	GetAccAddr(index int) sdktypes.AccAddress
	// GetAllAccAddrs returns all the SDK addresses of the accounts in the keyring.
	GetAllAccAddrs() []sdktypes.AccAddress
	// GetKey returns the key at the given keyring index
	GetKey(index int) Key

	// AddKey adds a new account to the keyring
	AddKey() int

	// Sign signs message with the specified account.
	Sign(index int, msg []byte) ([]byte, error)
}

func New

func New(nAccs int) Keyring

New returns a new keyring with nAccs accounts.

Jump to

Keyboard shortcuts

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