mock

package
v0.0.0-...-9fdd194 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChequeStore

func NewChequeStore(opts ...Option) vault.ChequeStore

NewChequeStore creates the mock chequeStore implementation

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is the option passed to the mock ChequeStore service

func WithLastChequeFunc

func WithLastChequeFunc(f func(vault common.Address) (*vault.SignedCheque, error)) Option

func WithLastChequesFunc

func WithLastChequesFunc(f func() (map[common.Address]*vault.SignedCheque, error)) Option

func WithLastReceivedChequeFunc

func WithLastReceivedChequeFunc(f func(vault common.Address) (*vault.SignedCheque, error)) Option

func WithLastReceivedChequesFunc

func WithLastReceivedChequesFunc(f func() (map[common.Address]*vault.SignedCheque, error)) Option

func WithReceiveChequeFunc

func WithReceiveChequeFunc(f func(ctx context.Context, cheque *vault.SignedCheque, exchangeRate *big.Int) (*big.Int, error)) Option

func WithReceivedChequeRecordsAllFunc

func WithReceivedChequeRecordsAllFunc(f func() (map[common.Address][]vault.ChequeRecord, error)) Option

func WithReceivedChequeRecordsByPeerFunc

func WithReceivedChequeRecordsByPeerFunc(f func(vault common.Address) ([]vault.ChequeRecord, error)) Option

func WithReceivedStatsHistoryFunc

func WithReceivedStatsHistoryFunc(f func(days int) ([]vault.DailyReceivedStats, error)) Option

func WithSendChequeRecordsAllFunc

func WithSendChequeRecordsAllFunc(f func() (map[common.Address][]vault.ChequeRecord, error)) Option

func WithSendChequeRecordsByPeerFunc

func WithSendChequeRecordsByPeerFunc(f func(beneficiary common.Address) ([]vault.ChequeRecord, error)) Option

func WithSentStatsHistoryFunc

func WithSentStatsHistoryFunc(f func(days int) ([]vault.DailySentStats, error)) Option

func WithStoreSendChequeRecordFunc

func WithStoreSendChequeRecordFunc(f func(vault, beneficiary common.Address, amount *big.Int) error) Option

type Service

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

Service is the mock chequeStore service.

func (*Service) LastCheque

func (s *Service) LastCheque(vault common.Address) (*vault.SignedCheque, error)

func (*Service) LastCheques

func (s *Service) LastCheques() (map[common.Address]*vault.SignedCheque, error)

func (*Service) LastReceivedCheque

func (s *Service) LastReceivedCheque(vault common.Address, token common.Address) (*vault.SignedCheque, error)

LastReceivedCheque returns the last cheque we received from a specific vault.

func (*Service) LastReceivedCheques

func (s *Service) LastReceivedCheques(token common.Address) (map[common.Address]*vault.SignedCheque, error)

LastReceivedCheques return map[vault]cheque

func (*Service) ReceiveCheque

func (s *Service) ReceiveCheque(ctx context.Context, cheque *vault.SignedCheque, exchangeRate *big.Int, token common.Address) (*big.Int, error)

func (*Service) ReceivedChequeRecordsAll

func (s *Service) ReceivedChequeRecordsAll() (map[common.Address][]vault.ChequeRecord, error)

ListReceivedChequeRecords returns the records we received from a specific vault.

func (*Service) ReceivedChequeRecordsByPeer

func (s *Service) ReceivedChequeRecordsByPeer(vault common.Address) ([]vault.ChequeRecord, error)

ReceivedChequeRecordsByPeer returns the records we received from a specific vault.

func (*Service) ReceivedStatsHistory

func (s *Service) ReceivedStatsHistory(days int, token common.Address) ([]vault.DailyReceivedStats, error)

func (*Service) SendChequeRecordsAll

func (s *Service) SendChequeRecordsAll() (map[common.Address][]vault.ChequeRecord, error)

SendChequeRecordsAll returns the records we send to a specific vault.

func (*Service) SendChequeRecordsByPeer

func (s *Service) SendChequeRecordsByPeer(beneficiary common.Address) ([]vault.ChequeRecord, error)

SendChequeRecordsByPeer returns the records we send to a specific vault.

func (*Service) SentStatsHistory

func (s *Service) SentStatsHistory(days int, token common.Address) ([]vault.DailySentStats, error)

func (*Service) StoreSendChequeRecord

func (s *Service) StoreSendChequeRecord(vault, beneficiary common.Address, amount *big.Int, token common.Address) error

StoreSendChequeRecord store send cheque records.

Jump to

Keyboard shortcuts

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