Documentation ¶
Index ¶
- func NewChequebook(opts ...Option) chequebook.Service
- type Option
- func WithChequebookAddressFunc(f func() common.Address) Option
- func WithChequebookAvailableBalanceFunc(f func(ctx context.Context) (*big.Int, error)) Option
- func WithChequebookBalanceFunc(f func(ctx context.Context) (*big.Int, error)) Option
- func WithChequebookDepositFunc(f func(ctx context.Context, amount *big.Int) (hash common.Hash, err error)) Option
- func WithChequebookIssueFunc(...) Option
- func WithChequebookWithdrawFunc(f func(ctx context.Context, amount *big.Int) (hash common.Hash, err error)) Option
- func WithLastChequeFunc(f func(beneficiary common.Address) (*chequebook.SignedCheque, error)) Option
- func WithLastChequesFunc(f func() (map[common.Address]*chequebook.SignedCheque, error)) Option
- type Service
- func (s *Service) Address() common.Address
- func (s *Service) AvailableBalance(ctx context.Context) (bal *big.Int, err error)
- func (s *Service) Balance(ctx context.Context) (bal *big.Int, err error)
- func (s *Service) Deposit(ctx context.Context, amount *big.Int) (hash common.Hash, err error)
- func (s *Service) Issue(ctx context.Context, beneficiary common.Address, amount *big.Int, ...) (*big.Int, error)
- func (s *Service) LastCheque(beneficiary common.Address) (*chequebook.SignedCheque, error)
- func (s *Service) LastCheques() (map[common.Address]*chequebook.SignedCheque, error)
- func (s *Service) WaitForDeposit(ctx context.Context, txHash common.Hash) error
- func (s *Service) Withdraw(ctx context.Context, amount *big.Int) (hash common.Hash, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewChequebook ¶
func NewChequebook(opts ...Option) chequebook.Service
NewChequebook creates the mock chequebook implementation
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is the option passed to the mock Chequebook service
func WithChequebookBalanceFunc ¶
WithChequebook*Functions set the mock chequebook functions
func WithChequebookIssueFunc ¶
func WithLastChequeFunc ¶
func WithLastChequeFunc(f func(beneficiary common.Address) (*chequebook.SignedCheque, error)) Option
func WithLastChequesFunc ¶
func WithLastChequesFunc(f func() (map[common.Address]*chequebook.SignedCheque, error)) Option
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the mock chequebook service.
func (*Service) AvailableBalance ¶
func (*Service) LastCheque ¶
func (s *Service) LastCheque(beneficiary common.Address) (*chequebook.SignedCheque, error)
func (*Service) LastCheques ¶
func (s *Service) LastCheques() (map[common.Address]*chequebook.SignedCheque, error)
func (*Service) WaitForDeposit ¶
WaitForDeposit mocks the chequebook .WaitForDeposit function
Click to show internal directories.
Click to hide internal directories.