Documentation
¶
Index ¶
- func NewVault(opts ...Option) vault.Service
- type Option
- func WithCheckBalanceFunc(f func(bal *big.Int) (err error)) Option
- func WithGetWithdrawTimeFunc(f func(ctx context.Context) (ti *big.Int, err error)) Option
- func WithLastChequeFunc(...) Option
- func WithLastChequesFunc(f func(token common.Address) (map[common.Address]*vault.SignedCheque, error)) Option
- func WithLiquidBalanceFunc(f func(ctx context.Context) (ti *big.Int, err error)) Option
- func WithTotalBalanceFunc(f func(ctx context.Context, token common.Address) (ti *big.Int, err error)) Option
- func WithTotalDailyReceivedCashedFunc(f func(token common.Address) (*big.Int, error)) Option
- func WithTotalDailyReceivedFunc(f func(token common.Address) (*big.Int, error)) Option
- func WithTotalIssuedCountFunc(f func(token common.Address) (int, error)) Option
- func WithTotalIssuedFunc(f func(token common.Address) (*big.Int, error)) Option
- func WithTotalPaidOutFunc(f func(ctx context.Context, token common.Address) (ti *big.Int, err error)) Option
- func WithTotalReceivedCashedCountFunc(f func(token common.Address) (int, error)) Option
- func WithTotalReceivedCashedFunc(f func(token common.Address) (*big.Int, error)) Option
- func WithTotalReceivedCountFunc(f func(token common.Address) (int, error)) Option
- func WithTotalReceivedFunc(f func(token common.Address) (*big.Int, error)) Option
- func WithVaultAddressFunc(f func() common.Address) Option
- func WithVaultAvailableBalanceFunc(f func(ctx context.Context, token common.Address) (*big.Int, error)) Option
- func WithVaultBalanceFunc(f func(ctx context.Context) (*big.Int, error)) Option
- func WithVaultDepositFunc(...) Option
- func WithVaultIssueFunc(...) Option
- func WithVaultWithdrawFunc(...) Option
- func WithWaitForDepositFunc(f func(ctx context.Context, txHash common.Hash) error) Option
- func WithWbttBalanceFunc(f func(ctx context.Context, add common.Address) (bal *big.Int, err error)) Option
- type Service
- func (s *Service) Address() common.Address
- func (s *Service) AvailableBalance(ctx context.Context, token common.Address) (bal *big.Int, err error)
- func (s *Service) BTTBalanceOf(ctx context.Context, add common.Address, block *big.Int) (bal *big.Int, err error)
- func (s *Service) Balance(ctx context.Context) (bal *big.Int, err error)
- func (s *Service) CheckBalance(bal *big.Int) (err error)
- func (s *Service) Deposit(ctx context.Context, amount *big.Int, token common.Address) (hash common.Hash, err error)
- func (s *Service) GetWithdrawTime(ctx context.Context) (ti *big.Int, 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, token common.Address) (*vault.SignedCheque, error)
- func (s *Service) LastCheques(token common.Address) (map[common.Address]*vault.SignedCheque, error)
- func (s *Service) LiquidBalance(ctx context.Context) (ti *big.Int, err error)
- func (s *Service) TokenBalanceOf(ctx context.Context, addr common.Address, tokenStr string) (*big.Int, error)
- func (s *Service) TotalBalance(ctx context.Context, token common.Address) (ti *big.Int, err error)
- func (s *Service) TotalDailyReceived(token common.Address) (*big.Int, error)
- func (s *Service) TotalDailyReceivedCashed(token common.Address) (*big.Int, error)
- func (s *Service) TotalIssued(token common.Address) (*big.Int, error)
- func (s *Service) TotalIssuedCount(token common.Address) (ti int, err error)
- func (s *Service) TotalPaidOut(ctx context.Context, token common.Address) (ti *big.Int, err error)
- func (s *Service) TotalReceived(token common.Address) (*big.Int, error)
- func (s *Service) TotalReceivedCashed(token common.Address) (*big.Int, error)
- func (s *Service) TotalReceivedCashedCount(token common.Address) (int, error)
- func (s *Service) TotalReceivedCount(token common.Address) (int, error)
- func (s *Service) UpgradeTo(ctx context.Context, newVaultImpl common.Address) (old, new common.Address, err error)
- func (s *Service) WBTTBalanceOf(ctx context.Context, add common.Address) (bal *big.Int, err error)
- func (s *Service) WaitForDeposit(ctx context.Context, txHash common.Hash) error
- func (s *Service) Withdraw(ctx context.Context, amount *big.Int, token common.Address) (hash common.Hash, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is the option passed to the mock Vault service
func WithGetWithdrawTimeFunc ¶
func WithLastChequeFunc ¶
func WithLastChequesFunc ¶
func WithLiquidBalanceFunc ¶
func WithTotalBalanceFunc ¶
func WithTotalIssuedFunc ¶
func WithTotalPaidOutFunc ¶
func WithTotalReceivedFunc ¶
func WithVaultAddressFunc ¶
func WithVaultBalanceFunc ¶
WithVault*Functions set the mock vault functions
func WithVaultDepositFunc ¶
func WithVaultIssueFunc ¶
func WithVaultWithdrawFunc ¶
func WithWaitForDepositFunc ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the mock vault service.
func (*Service) AvailableBalance ¶
func (*Service) BTTBalanceOf ¶
func (*Service) Deposit ¶
func (s *Service) Deposit(ctx context.Context, amount *big.Int, token common.Address) (hash common.Hash, err error)
Deposit mocks the vault .Deposit function
func (*Service) GetWithdrawTime ¶
func (*Service) LastCheque ¶
func (*Service) LastCheques ¶
func (*Service) LiquidBalance ¶
func (*Service) TokenBalanceOf ¶
func (*Service) TotalBalance ¶
func (*Service) TotalDailyReceived ¶
func (*Service) TotalDailyReceivedCashed ¶
func (*Service) TotalIssuedCount ¶
func (*Service) TotalPaidOut ¶
func (*Service) TotalReceived ¶
func (*Service) TotalReceivedCashed ¶
func (*Service) TotalReceivedCashedCount ¶
func (*Service) TotalReceivedCount ¶
func (*Service) WBTTBalanceOf ¶
func (*Service) WaitForDeposit ¶
Click to show internal directories.
Click to hide internal directories.