status-go/contracts/ethscan/ethscan_iface.go
Ivan Belyakov 3983114ae5 test(wallet)_: add unit tests for balance fetcher
replace types with interfaces where necessary to allow mocking
implement fake eth scanner and erc20 contracts
2024-07-04 09:29:49 +02:00

16 lines
664 B
Go

package ethscan
import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
)
type BalanceScannerIface interface {
EtherBalances(opts *bind.CallOpts, addresses []common.Address) ([]BalanceScannerResult, error)
TokenBalances(opts *bind.CallOpts, addresses []common.Address, tokenAddress common.Address) ([]BalanceScannerResult, error)
TokensBalance(opts *bind.CallOpts, owner common.Address, contracts []common.Address) ([]BalanceScannerResult, error)
}
// Verify that BalanceScanner implements BalanceScannerIface. If contract changes, this will fail to compile.
var _ BalanceScannerIface = (*BalanceScanner)(nil)