mock

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) erc20.Service

Types

type Option

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

Option is the option passed to the mock Chequebook service

func WithBalanceOfFunc

func WithBalanceOfFunc(f func(ctx context.Context, address common.Address) (*big.Int, error)) Option

func WithTransferFunc

func WithTransferFunc(f func(ctx context.Context, address common.Address, value *big.Int) (common.Hash, error)) Option

type Service

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

func (*Service) Allowance

func (s *Service) Allowance(ctx context.Context, owner, spender common.Address) (*big.Int, error)

func (*Service) Approve

func (s *Service) Approve(ctx context.Context, spender common.Address, value *big.Int) (common.Hash, error)

func (*Service) BalanceOf

func (s *Service) BalanceOf(ctx context.Context, address common.Address) (*big.Int, error)

func (*Service) Transfer

func (s *Service) Transfer(ctx context.Context, address common.Address, value *big.Int) (common.Hash, error)

func (*Service) WaitForApprove

func (s *Service) WaitForApprove(ctx context.Context, hash common.Hash) error

Jump to

Keyboard shortcuts

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