Versions in this module Expand all Collapse all v0 v0.21.1 Apr 1, 2019 Changes in this version + const BlockDuration + const ErrCreateClient + const ErrURLScheme + const TestTXGasLimit + const TestTXGasPrice + const TestTXNonce + var ServiceChannelCloseRequested = common.HexToHash("e4007f6ff086417a4031cdcff1a975882379b19e1ed3547292e131f3c525bcab") + var ServiceChannelCreated = common.HexToHash("7699dfbb1101aec58b1cfb4a4f5375947c99cb4c645112290d1cb77fc286edc1") + var ServiceChannelToppedUp = common.HexToHash("d3020c549112ceb2d0f806cd3366f47df57bc519c46133b84ce2cdad970c22a3") + var ServiceCooperativeChannelClose = common.HexToHash("4a06175bd19aba21163e3c08e7ac80151fad270655624167c5ee9e41b48a58e0") + var ServiceOfferingCreated = common.HexToHash("a8c40ba917b58ddcfe866c5b52d417e5e425c459c3b7333bf3b1164e32ddb939") + var ServiceOfferingDeleted = common.HexToHash("c3013cd9dd5c33b95a9cc1bc076481c9a6a1970be6d7f1ed33adafad6e57d3d6") + var ServiceOfferingPopedUp = common.HexToHash("7c6ee8c3412a9ecfd989aa18d379f84f73b718366934885e21e9a399b719c53a") + var ServiceUnCooperativeChannelClose = common.HexToHash("d633584c5931ade1a274b7ce309d985207494d074d1afd2f2da5275bb645e3dc") + var TokenApproval = common.HexToHash("8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925") + var TokenTransfer = common.HexToHash("ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") + func BalanceClosingHash(clientAddr, pscAddr common.Address, block uint32, offeringHash common.Hash, ...) []byte + func BalanceProofHash(pscAddr, agentAddr common.Address, block uint32, offeringHash common.Hash, ...) []byte + type Backend interface + CooperativeClose func(*bind.TransactOpts, common.Address, uint32, [common.HashLength]byte, uint64, ...) (*types.Transaction, error) + EstimateGas func(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) + EthBalanceAt func(context.Context, common.Address) (*big.Int, error) + FilterLogs func(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) + GetTransactionByHash func(context.Context, common.Hash) (*types.Transaction, bool, error) + HeaderByNumber func(ctx context.Context, number *big.Int) (*types.Header, error) + LatestBlockNumber func(ctx context.Context) (*big.Int, error) + PSCAddBalanceERC20 func(*bind.TransactOpts, uint64) (*types.Transaction, error) + PSCAddress func() common.Address + PSCBalanceOf func(*bind.CallOpts, common.Address) (uint64, error) + PSCCreateChannel func(opts *bind.TransactOpts, agent common.Address, hash [common.HashLength]byte, ...) (*types.Transaction, error) + PSCGetChannelInfo func(opts *bind.CallOpts, client common.Address, agent common.Address, ...) (uint64, uint32, uint64, error) + PSCGetOfferingInfo func(opts *bind.CallOpts, hash [common.HashLength]byte) (agentAddr common.Address, minDeposit uint64, maxSupply uint16, ...) + PSCPopupServiceOffering func(opts *bind.TransactOpts, offeringHash [32]byte, somcType uint8, ...) (*types.Transaction, error) + PSCRemoveServiceOffering func(opts *bind.TransactOpts, offeringHash [32]byte) (*types.Transaction, error) + PSCReturnBalanceERC20 func(*bind.TransactOpts, uint64) (*types.Transaction, error) + PSCSettle func(opts *bind.TransactOpts, agent common.Address, blockNumber uint32, ...) (*types.Transaction, error) + PSCTopUpChannel func(opts *bind.TransactOpts, agent common.Address, blockNumber uint32, ...) (*types.Transaction, error) + PSCUncooperativeClose func(opts *bind.TransactOpts, agent common.Address, blockNumber uint32, ...) (*types.Transaction, error) + PTCAddress func() common.Address + PTCBalanceOf func(*bind.CallOpts, common.Address) (*big.Int, error) + PTCIncreaseApproval func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error) + PendingNonceAt func(ctx context.Context, account common.Address) (uint64, error) + RegisterServiceOffering func(*bind.TransactOpts, [common.HashLength]byte, uint64, uint16, uint8, ...) (*types.Transaction, error) + SuggestGasPrice func(ctx context.Context) (*big.Int, error) + func NewBackend(cfg *Config, logger log.Logger) Backend + type Config struct + CheckTimeout uint64 + Contract struct{ ... } + GethURL string + HTTPClient *httpClientConf + Timeout uint64 + func NewConfig() *Config + type TestEthBackCall struct + type TestEthBackend struct + Abi abi.ABI + BalanceEth *big.Int + BalancePSC uint64 + BalancePTC *big.Int + BlockNumber *big.Int + CallStack []TestEthBackCall + EstimatedGas uint64 + GasPrice *big.Int + OfferCurrentSupply uint16 + OfferMaxSupply uint16 + OfferMinDeposit uint64 + OfferUpdateBlockNumber uint32 + OfferingAgent common.Address + OfferingIsActive bool + PscAddr common.Address + Tx *types.Transaction + func NewTestEthBackend(pscAddr common.Address) *TestEthBackend + func (b *TestEthBackend) CooperativeClose(opts *bind.TransactOpts, agentAddr common.Address, block uint32, ...) (*types.Transaction, error) + func (b *TestEthBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) + func (b *TestEthBackend) EthBalanceAt(_ context.Context, addr common.Address) (*big.Int, error) + func (b *TestEthBackend) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) + func (b *TestEthBackend) GetTransactionByHash(context.Context, common.Hash) (*types.Transaction, bool, error) + func (b *TestEthBackend) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) + func (b *TestEthBackend) LatestBlockNumber(ctx context.Context) (*big.Int, error) + func (b *TestEthBackend) PSCAddBalanceERC20(opts *bind.TransactOpts, val uint64) (*types.Transaction, error) + func (b *TestEthBackend) PSCAddress() common.Address + func (b *TestEthBackend) PSCBalanceOf(opts *bind.CallOpts, addr common.Address) (uint64, error) + func (b *TestEthBackend) PSCCreateChannel(opts *bind.TransactOpts, agent common.Address, hash [common.HashLength]byte, ...) (*types.Transaction, error) + func (b *TestEthBackend) PSCGetChannelInfo(opts *bind.CallOpts, client common.Address, agent common.Address, ...) (uint64, uint32, uint64, error) + func (b *TestEthBackend) PSCGetOfferingInfo(opts *bind.CallOpts, hash [common.HashLength]byte) (agentAddr common.Address, minDeposit uint64, maxSupply uint16, ...) + func (b *TestEthBackend) PSCPopupServiceOffering(opts *bind.TransactOpts, offeringHash [32]byte, somcType uint8, ...) (*types.Transaction, error) + func (b *TestEthBackend) PSCRemoveServiceOffering(opts *bind.TransactOpts, offeringHash [32]byte) (*types.Transaction, error) + func (b *TestEthBackend) PSCReturnBalanceERC20(opts *bind.TransactOpts, val uint64) (*types.Transaction, error) + func (b *TestEthBackend) PSCSettle(opts *bind.TransactOpts, agent common.Address, blockNumber uint32, ...) (*types.Transaction, error) + func (b *TestEthBackend) PSCTopUpChannel(opts *bind.TransactOpts, agent common.Address, blockNumber uint32, ...) (*types.Transaction, error) + func (b *TestEthBackend) PSCUncooperativeClose(opts *bind.TransactOpts, agent common.Address, blockNumber uint32, ...) (*types.Transaction, error) + func (b *TestEthBackend) PTCAddress() common.Address + func (b *TestEthBackend) PTCBalanceOf(opts *bind.CallOpts, addr common.Address) (*big.Int, error) + func (b *TestEthBackend) PTCIncreaseApproval(opts *bind.TransactOpts, addr common.Address, amount *big.Int) (*types.Transaction, error) + func (b *TestEthBackend) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) + func (b *TestEthBackend) RegisterServiceOffering(opts *bind.TransactOpts, offeringHash [32]byte, minDeposit uint64, ...) (*types.Transaction, error) + func (b *TestEthBackend) SetTransaction(t *testing.T, opts *bind.TransactOpts, input []byte) + func (b *TestEthBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error) + func (b *TestEthBackend) TestCalled(t *testing.T, method string, caller common.Address, gasLimit uint64, ...)