storage

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package storage is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound indicates that a requested resource was not found.
	ErrNotFound = errors.New("resource not found")

	// ErrDuplicateEntry indicates that a duplicate entry was attempted to be inserted.
	ErrDuplicateEntry = errors.New("duplicate entry")

	// ErrInvalidInput indicates that the input provided is invalid.
	ErrInvalidInput = errors.New("invalid input")
)

Functions

This section is empty.

Types

type IStorage

type IStorage interface {
	WalletInfo() *types.WalletInfo
	Vault() *vault.Vault
	UpdateVault(vault *vault.Vault) error
	SetDefaultFee(fee amount.Amount) error

	AllAddresses() []types.AddressInfo
	AddressInfo(address string) (*types.AddressInfo, error)
	HasAddress(address string) bool
	AddressCount() int
	InsertAddress(info *types.AddressInfo) error
	UpdateAddress(info *types.AddressInfo) error

	InsertTransaction(info *types.TransactionInfo) error
	GetPendingTransactions() (map[string]*types.TransactionInfo, error)
	UpdateTransactionStatus(no int64, status types.TransactionStatus, blockHeight uint32) error
	GetTransaction(no int64) (*types.TransactionInfo, error)
	HasTransaction(txID string) bool
	QueryTransactions(params QueryParams) ([]*types.TransactionInfo, error)

	Close() error
	Clone(path string) (IStorage, error)
	IsLegacy() bool
}

type MockIStorage

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

MockIStorage is a mock of IStorage interface.

func NewMockIStorage

func NewMockIStorage(ctrl *gomock.Controller) *MockIStorage

NewMockIStorage creates a new mock instance.

func (*MockIStorage) AddressCount

func (m *MockIStorage) AddressCount() int

AddressCount mocks base method.

func (*MockIStorage) AddressInfo

func (m *MockIStorage) AddressInfo(address string) (*types.AddressInfo, error)

AddressInfo mocks base method.

func (*MockIStorage) AllAddresses

func (m *MockIStorage) AllAddresses() []types.AddressInfo

AllAddresses mocks base method.

func (*MockIStorage) Clone

func (m *MockIStorage) Clone(path string) (IStorage, error)

Clone mocks base method.

func (*MockIStorage) Close

func (m *MockIStorage) Close() error

Close mocks base method.

func (*MockIStorage) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIStorage) GetPendingTransactions

func (m *MockIStorage) GetPendingTransactions() (map[string]*types.TransactionInfo, error)

GetPendingTransactions mocks base method.

func (*MockIStorage) GetTransaction

func (m *MockIStorage) GetTransaction(no int64) (*types.TransactionInfo, error)

GetTransaction mocks base method.

func (*MockIStorage) HasAddress

func (m *MockIStorage) HasAddress(address string) bool

HasAddress mocks base method.

func (*MockIStorage) HasTransaction

func (m *MockIStorage) HasTransaction(txID string) bool

HasTransaction mocks base method.

func (*MockIStorage) InsertAddress

func (m *MockIStorage) InsertAddress(info *types.AddressInfo) error

InsertAddress mocks base method.

func (*MockIStorage) InsertTransaction

func (m *MockIStorage) InsertTransaction(info *types.TransactionInfo) error

InsertTransaction mocks base method.

func (*MockIStorage) IsLegacy

func (m *MockIStorage) IsLegacy() bool

IsLegacy mocks base method.

func (*MockIStorage) QueryTransactions

func (m *MockIStorage) QueryTransactions(params QueryParams) ([]*types.TransactionInfo, error)

QueryTransactions mocks base method.

func (*MockIStorage) SetDefaultFee

func (m *MockIStorage) SetDefaultFee(fee amount.Amount) error

SetDefaultFee mocks base method.

func (*MockIStorage) UpdateAddress

func (m *MockIStorage) UpdateAddress(info *types.AddressInfo) error

UpdateAddress mocks base method.

func (*MockIStorage) UpdateTransactionStatus

func (m *MockIStorage) UpdateTransactionStatus(no int64, status types.TransactionStatus, blockHeight uint32) error

UpdateTransactionStatus mocks base method.

func (*MockIStorage) UpdateVault

func (m *MockIStorage) UpdateVault(arg0 *vault.Vault) error

UpdateVault mocks base method.

func (*MockIStorage) Vault

func (m *MockIStorage) Vault() *vault.Vault

Vault mocks base method.

func (*MockIStorage) WalletInfo

func (m *MockIStorage) WalletInfo() *types.WalletInfo

WalletInfo mocks base method.

type MockIStorageMockRecorder

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

MockIStorageMockRecorder is the mock recorder for MockIStorage.

func (*MockIStorageMockRecorder) AddressCount

func (mr *MockIStorageMockRecorder) AddressCount() *gomock.Call

AddressCount indicates an expected call of AddressCount.

func (*MockIStorageMockRecorder) AddressInfo

func (mr *MockIStorageMockRecorder) AddressInfo(address any) *gomock.Call

AddressInfo indicates an expected call of AddressInfo.

func (*MockIStorageMockRecorder) AllAddresses

func (mr *MockIStorageMockRecorder) AllAddresses() *gomock.Call

AllAddresses indicates an expected call of AllAddresses.

func (*MockIStorageMockRecorder) Clone

func (mr *MockIStorageMockRecorder) Clone(path any) *gomock.Call

Clone indicates an expected call of Clone.

func (*MockIStorageMockRecorder) Close

func (mr *MockIStorageMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockIStorageMockRecorder) GetPendingTransactions

func (mr *MockIStorageMockRecorder) GetPendingTransactions() *gomock.Call

GetPendingTransactions indicates an expected call of GetPendingTransactions.

func (*MockIStorageMockRecorder) GetTransaction

func (mr *MockIStorageMockRecorder) GetTransaction(no any) *gomock.Call

GetTransaction indicates an expected call of GetTransaction.

func (*MockIStorageMockRecorder) HasAddress

func (mr *MockIStorageMockRecorder) HasAddress(address any) *gomock.Call

HasAddress indicates an expected call of HasAddress.

func (*MockIStorageMockRecorder) HasTransaction

func (mr *MockIStorageMockRecorder) HasTransaction(txID any) *gomock.Call

HasTransaction indicates an expected call of HasTransaction.

func (*MockIStorageMockRecorder) InsertAddress

func (mr *MockIStorageMockRecorder) InsertAddress(info any) *gomock.Call

InsertAddress indicates an expected call of InsertAddress.

func (*MockIStorageMockRecorder) InsertTransaction

func (mr *MockIStorageMockRecorder) InsertTransaction(info any) *gomock.Call

InsertTransaction indicates an expected call of InsertTransaction.

func (*MockIStorageMockRecorder) IsLegacy

func (mr *MockIStorageMockRecorder) IsLegacy() *gomock.Call

IsLegacy indicates an expected call of IsLegacy.

func (*MockIStorageMockRecorder) QueryTransactions

func (mr *MockIStorageMockRecorder) QueryTransactions(params any) *gomock.Call

QueryTransactions indicates an expected call of QueryTransactions.

func (*MockIStorageMockRecorder) SetDefaultFee

func (mr *MockIStorageMockRecorder) SetDefaultFee(fee any) *gomock.Call

SetDefaultFee indicates an expected call of SetDefaultFee.

func (*MockIStorageMockRecorder) UpdateAddress

func (mr *MockIStorageMockRecorder) UpdateAddress(info any) *gomock.Call

UpdateAddress indicates an expected call of UpdateAddress.

func (*MockIStorageMockRecorder) UpdateTransactionStatus

func (mr *MockIStorageMockRecorder) UpdateTransactionStatus(no, status, blockHeight any) *gomock.Call

UpdateTransactionStatus indicates an expected call of UpdateTransactionStatus.

func (*MockIStorageMockRecorder) UpdateVault

func (mr *MockIStorageMockRecorder) UpdateVault(arg0 any) *gomock.Call

UpdateVault indicates an expected call of UpdateVault.

func (*MockIStorageMockRecorder) Vault

func (mr *MockIStorageMockRecorder) Vault() *gomock.Call

Vault indicates an expected call of Vault.

func (*MockIStorageMockRecorder) WalletInfo

func (mr *MockIStorageMockRecorder) WalletInfo() *gomock.Call

WalletInfo indicates an expected call of WalletInfo.

type QueryParams

type QueryParams struct {
	Address   string
	Direction types.TxDirection
	Count     int
	Skip      int
}

QueryParams specifies filters for querying stored transactions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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