Documentation ¶
Overview ¶
Package keychain is a generated GoMock package.
Index ¶
- Variables
- type Keychain
- type Ledger
- type MockLedger
- func (m *MockLedger) Address(arg0 string, arg1 uint32) (ids.ShortID, error)
- func (m *MockLedger) Addresses(arg0 []uint32) ([]ids.ShortID, error)
- func (m *MockLedger) Disconnect() error
- func (m *MockLedger) EXPECT() *MockLedgerMockRecorder
- func (m *MockLedger) Sign(arg0 []byte, arg1 []uint32) ([][]byte, error)
- func (m *MockLedger) SignHash(arg0 []byte, arg1 []uint32) ([][]byte, error)
- func (m *MockLedger) Version() (*version.Semantic, error)
- type MockLedgerMockRecorder
- func (mr *MockLedgerMockRecorder) Address(arg0, arg1 any) *gomock.Call
- func (mr *MockLedgerMockRecorder) Addresses(arg0 any) *gomock.Call
- func (mr *MockLedgerMockRecorder) Disconnect() *gomock.Call
- func (mr *MockLedgerMockRecorder) Sign(arg0, arg1 any) *gomock.Call
- func (mr *MockLedgerMockRecorder) SignHash(arg0, arg1 any) *gomock.Call
- func (mr *MockLedgerMockRecorder) Version() *gomock.Call
- type Signer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidIndicesLength = errors.New("number of indices should be greater than 0") ErrInvalidNumAddrsToDerive = errors.New("number of addresses to derive should be greater than 0") ErrInvalidNumAddrsDerived = errors.New("incorrect number of ledger derived addresses") ErrInvalidNumSignatures = errors.New("incorrect number of signatures") )
Functions ¶
This section is empty.
Types ¶
type Keychain ¶
type Keychain interface { // The returned Signer can provide a signature for [addr] Get(addr ids.ShortID) (Signer, bool) // Returns the set of addresses for which the accessor keeps an associated // signer Addresses() set.Set[ids.ShortID] }
Keychain maintains a set of addresses together with their corresponding signers
func NewLedgerKeychain ¶
NewLedgerKeychain creates a new Ledger with [numToDerive] addresses.
type Ledger ¶
type Ledger interface { Version() (v *version.Semantic, err error) Address(displayHRP string, addressIndex uint32) (ids.ShortID, error) Addresses(addressIndices []uint32) ([]ids.ShortID, error) SignHash(hash []byte, addressIndices []uint32) ([][]byte, error) Sign(unsignedTxBytes []byte, addressIndices []uint32) ([][]byte, error) Disconnect() error }
Ledger interface for the ledger wrapper
type MockLedger ¶
type MockLedger struct {
// contains filtered or unexported fields
}
MockLedger is a mock of Ledger interface.
func NewMockLedger ¶
func NewMockLedger(ctrl *gomock.Controller) *MockLedger
NewMockLedger creates a new mock instance.
func (*MockLedger) Addresses ¶
func (m *MockLedger) Addresses(arg0 []uint32) ([]ids.ShortID, error)
Addresses mocks base method.
func (*MockLedger) Disconnect ¶
func (m *MockLedger) Disconnect() error
Disconnect mocks base method.
func (*MockLedger) EXPECT ¶
func (m *MockLedger) EXPECT() *MockLedgerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLedger) Sign ¶
func (m *MockLedger) Sign(arg0 []byte, arg1 []uint32) ([][]byte, error)
Sign mocks base method.
type MockLedgerMockRecorder ¶
type MockLedgerMockRecorder struct {
// contains filtered or unexported fields
}
MockLedgerMockRecorder is the mock recorder for MockLedger.
func (*MockLedgerMockRecorder) Address ¶
func (mr *MockLedgerMockRecorder) Address(arg0, arg1 any) *gomock.Call
Address indicates an expected call of Address.
func (*MockLedgerMockRecorder) Addresses ¶
func (mr *MockLedgerMockRecorder) Addresses(arg0 any) *gomock.Call
Addresses indicates an expected call of Addresses.
func (*MockLedgerMockRecorder) Disconnect ¶
func (mr *MockLedgerMockRecorder) Disconnect() *gomock.Call
Disconnect indicates an expected call of Disconnect.
func (*MockLedgerMockRecorder) Sign ¶
func (mr *MockLedgerMockRecorder) Sign(arg0, arg1 any) *gomock.Call
Sign indicates an expected call of Sign.
func (*MockLedgerMockRecorder) SignHash ¶
func (mr *MockLedgerMockRecorder) SignHash(arg0, arg1 any) *gomock.Call
SignHash indicates an expected call of SignHash.
func (*MockLedgerMockRecorder) Version ¶
func (mr *MockLedgerMockRecorder) Version() *gomock.Call
Version indicates an expected call of Version.