Documentation ¶
Index ¶
- func NewChequeStore(opts ...Option) cheque.ChequeStore
- type ChequeStoreMock
- func (s *ChequeStoreMock) GetAllRetrieveTransferAddresses() (map[common.Address]struct{}, error)
- func (s *ChequeStoreMock) GetChainRetrieveTraffic(chainAddress common.Address) (traffic *big.Int, err error)
- func (s *ChequeStoreMock) GetChainTransferTraffic(chainAddress common.Address) (traffic *big.Int, err error)
- func (s *ChequeStoreMock) GetRetrieveTraffic(chainAddress common.Address) (traffic *big.Int, err error)
- func (s *ChequeStoreMock) GetTransferTraffic(chainAddress common.Address) (traffic *big.Int, err error)
- func (s *ChequeStoreMock) LastReceivedCheque(chainAddress common.Address) (*cheque.SignedCheque, error)
- func (s *ChequeStoreMock) LastReceivedCheques() (map[common.Address]*cheque.SignedCheque, error)
- func (s *ChequeStoreMock) LastSendCheque(chainAddress common.Address) (*cheque.Cheque, error)
- func (s *ChequeStoreMock) LastSendCheques() (map[common.Address]*cheque.Cheque, error)
- func (s *ChequeStoreMock) PutChainRetrieveTraffic(chainAddress common.Address, traffic *big.Int) error
- func (s *ChequeStoreMock) PutChainTransferTraffic(chainAddress common.Address, traffic *big.Int) error
- func (s *ChequeStoreMock) PutReceivedCheques(chainAddress common.Address, cheque cheque.SignedCheque) error
- func (s *ChequeStoreMock) PutRetrieveTraffic(chainAddress common.Address, traffic *big.Int) error
- func (s *ChequeStoreMock) PutSendCheque(ctx context.Context, cheque *cheque.Cheque, chainAddress common.Address) error
- func (s *ChequeStoreMock) PutTransferTraffic(chainAddress common.Address, traffic *big.Int) error
- func (s *ChequeStoreMock) ReceiveCheque(ctx context.Context, cheque *cheque.SignedCheque) (*big.Int, error)
- func (s *ChequeStoreMock) VerifyCheque(cheque *cheque.SignedCheque, chainID int64) (common.Address, error)
- type Option
- func WithLastReceivedCheque(f func(chainAddress common.Address) (*cheque.SignedCheque, error)) Option
- func WithLastReceivedCheques(f func() (map[common.Address]*cheque.SignedCheque, error)) Option
- func WithLastSendCheque(f func(chainAddress common.Address) (*cheque.Cheque, error)) Option
- func WithLastSendCheques(f func() (map[common.Address]*cheque.Cheque, error)) Option
- func WithPutReceivedCheques(f func(chainAddress common.Address, cheque cheque.SignedCheque) error) Option
- func WithPutRetrieveTraffic(f func(chainAddress common.Address, traffic *big.Int) error) Option
- func WithPutSendCheque(...) Option
- func WithPutTransferTraffic(f func(chainAddress common.Address, traffic *big.Int) error) Option
- func WithRetrieveChequeFunc(f func(ctx context.Context, cheque *cheque.SignedCheque) (*big.Int, error)) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewChequeStore ¶
func NewChequeStore(opts ...Option) cheque.ChequeStore
NewChequeStore creates the mock chequeStore implementation
Types ¶
type ChequeStoreMock ¶
type ChequeStoreMock struct {
// contains filtered or unexported fields
}
ChequeStoreMock Service is the mock chequeStore service.
func (*ChequeStoreMock) GetAllRetrieveTransferAddresses ¶
func (s *ChequeStoreMock) GetAllRetrieveTransferAddresses() (map[common.Address]struct{}, error)
func (*ChequeStoreMock) GetChainRetrieveTraffic ¶
func (*ChequeStoreMock) GetChainTransferTraffic ¶
func (*ChequeStoreMock) GetRetrieveTraffic ¶
func (*ChequeStoreMock) GetTransferTraffic ¶
func (*ChequeStoreMock) LastReceivedCheque ¶
func (s *ChequeStoreMock) LastReceivedCheque(chainAddress common.Address) (*cheque.SignedCheque, error)
LastReceivedCheque returns the last cheque we received from a specific chainAddress.
func (*ChequeStoreMock) LastReceivedCheques ¶
func (s *ChequeStoreMock) LastReceivedCheques() (map[common.Address]*cheque.SignedCheque, error)
LastReceivedCheques returns the last received cheques from every known chainAddress.
func (*ChequeStoreMock) LastSendCheque ¶
func (*ChequeStoreMock) LastSendCheques ¶
func (*ChequeStoreMock) PutChainRetrieveTraffic ¶
func (*ChequeStoreMock) PutChainTransferTraffic ¶
func (*ChequeStoreMock) PutReceivedCheques ¶
func (s *ChequeStoreMock) PutReceivedCheques(chainAddress common.Address, cheque cheque.SignedCheque) error
func (*ChequeStoreMock) PutRetrieveTraffic ¶
func (*ChequeStoreMock) PutSendCheque ¶
func (*ChequeStoreMock) PutTransferTraffic ¶
func (*ChequeStoreMock) ReceiveCheque ¶
func (s *ChequeStoreMock) ReceiveCheque(ctx context.Context, cheque *cheque.SignedCheque) (*big.Int, error)
ReceiveCheque verifies and stores a cheque. It returns the totam amount earned.
func (*ChequeStoreMock) VerifyCheque ¶
func (s *ChequeStoreMock) VerifyCheque(cheque *cheque.SignedCheque, chainID int64) (common.Address, error)
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is the option passed to the mock ChequeStore service
func WithLastReceivedCheque ¶
func WithLastReceivedCheques ¶
func WithLastSendCheque ¶
func WithLastSendCheques ¶
func WithPutReceivedCheques ¶
func WithPutRetrieveTraffic ¶
func WithPutSendCheque ¶
func WithPutTransferTraffic ¶
func WithRetrieveChequeFunc ¶
Click to show internal directories.
Click to hide internal directories.