contracttest

package
v0.0.0-...-9f791b1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ChannelStateClosed uint8 = 2

ChannelStateClosed :

View Source
const ChannelStateOpened uint8 = 1

ChannelStateOpened :

View Source
const ChannelStateSettledOrNotExist uint8 = 0

ChannelStateSettledOrNotExist :

View Source
const EmptyBalanceHash = "000000000000000000000000000000000000000000000000"

EmptyBalanceHash :

Variables

View Source
var EmptyAccountAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")

EmptyAccountAddress :

View Source
var FakeAccountAddress = common.HexToAddress("0x03432")

FakeAccountAddress :

View Source
var TestSettleTimeoutMax uint64 = 2700000

TestSettleTimeoutMax :

View Source
var TestSettleTimeoutMin uint64 = 6

TestSettleTimeoutMin :

Functions

func InitEnv

func InitEnv(t *testing.T, configFilePath string)

InitEnv :

func TestXXXXAttack

func TestXXXXAttack(t *testing.T)

TestXXXXAttack : 恶意调用测试

func TestXXXXEdge

func TestXXXXEdge(t *testing.T)

TestXXXXEdge : 边界测试

func TestXXXXException

func TestXXXXException(t *testing.T)

TestXXXXException : 异常调用测试

func TestXXXXRight

func TestXXXXRight(t *testing.T)

TestXXXXRight : 正确调用测试

Types

type Account

type Account struct {
	Address common.Address
	Key     *ecdsa.PrivateKey
	Auth    *bind.TransactOpts
}

Account :

type BalanceData

type BalanceData struct {
	TransferAmount *big.Int
	LocksRoot      common.Hash
}

BalanceData of contract

func (*BalanceData) Hash

func (b *BalanceData) Hash() common.Hash

Hash :

type BalanceProofForContract

type BalanceProofForContract struct {
	AdditionalHash      common.Hash
	ChannelIdentifier   contracts.ChannelIdentifier
	TokenNetworkAddress common.Address
	ChainID             *big.Int
	Signature           []byte
	OpenBlockNumber     uint64
	Nonce               uint64
	BalanceData
}

BalanceProofForContract for contract

type BalanceProofUpdateForContracts

type BalanceProofUpdateForContracts struct {
	BalanceProofForContract
	NonClosingSignature []byte
}

BalanceProofUpdateForContracts :

type CoOperativeSettleForContracts

type CoOperativeSettleForContracts struct {
	Particiant1         common.Address
	Participant2        common.Address
	Participant1Balance *big.Int
	Participant2Balance *big.Int
	ChannelIdentifier   contracts.ChannelIdentifier
	OpenBlockNumber     uint64
	TokenNetworkAddress common.Address
	ChainID             *big.Int
}

CoOperativeSettleForContracts : param for CoOperativeSettle

type Env

type Env struct {
	KeystorePath          string
	EthRPCEndpoint        string
	TokenAddress          common.Address
	Token                 *contracts.Token
	TokenNetworkAddress   common.Address
	TokenNetwork          *contracts.TokensNetwork
	Client                *ethclient.Client
	SecretRegistryAddress common.Address
	SecretRegistry        *contracts.SecretRegistry
	Accounts              []*Account
	// contains filtered or unexported fields
}

Env :

type UnlockDelegateForContract

type UnlockDelegateForContract struct {
	Agent             common.Address
	Expiraition       int64
	Amount            *big.Int
	SecretHash        common.Hash
	ChannelIdentifier contracts.ChannelIdentifier
	ChainID           *big.Int
	OpenBlockNumber   uint64
	MerkleProof       []byte
}

UnlockDelegateForContract :

type WithDrawForContract

type WithDrawForContract struct {
	Participant1         common.Address
	Participant2         common.Address
	Participant1Deposit  *big.Int
	Participant1Withdraw *big.Int
	ChannelIdentifier    contracts.ChannelIdentifier
	OpenBlockNumber      uint64
	TokenNetworkAddress  common.Address
	ChainID              *big.Int
}

WithDrawForContract : param for withdraw 1

Jump to

Keyboard shortcuts

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