test

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SendTypeUnicast = SendType(iota)
	SendTypeMulticast
	SendTypeBroadcast
)
View Source
const VarTest = "test"

Variables

This section is empty.

Functions

func AssertBlock added in v0.9.10

func AssertBlock(
	t T, blk module.Block,
	version int, height int64, id []byte, prevID []byte,
)

func AssertBlockInBM added in v0.9.10

func AssertBlockInBM(
	t T, bm module.BlockManager,
	version int, height int64, id []byte, prevID []byte,
)

func AssertLastBlock added in v0.9.10

func AssertLastBlock(
	t T, bm module.BlockManager,
	height int64, prevID []byte, version int,
)

func DumpRLP added in v1.3.0

func DumpRLP(indent string, data []byte) string

func FinalizeBlock added in v0.9.10

func FinalizeBlock(
	t T, bm module.BlockManager, bc module.BlockCandidate,
)

func GetLastBlock added in v0.9.10

func GetLastBlock(t T, bm module.BlockManager) module.Block

func ImportBlock added in v0.9.10

func ImportBlock(
	t T, bm module.BlockManager,
	bc module.BlockCandidate, flag int,
) (resBc module.BlockCandidate, err error, cbErr error)

func ImportBlockByReader added in v0.9.10

func ImportBlockByReader(
	t T, bm module.BlockManager,
	r io.Reader, flag int,
) (resBc module.BlockCandidate, err error, cbErr error)

func NewRegulator added in v0.9.10

func NewRegulator() module.Regulator

func NewWalletProvider added in v1.3.0

func NewWalletProvider() module.WalletProvider

func NodeInterconnect added in v0.9.10

func NodeInterconnect(nodes []*Node)

func NodeWaitForBlock added in v1.3.0

func NodeWaitForBlock(nodes []*Node, h int64) module.Block

func PeerConnect added in v0.9.10

func PeerConnect(p1 Peer, p2 Peer)

func ProposeBlock added in v0.9.10

func ProposeBlock(
	bm module.BlockManager,
	prevID []byte, votes module.CommitVoteSet,
) (bc module.BlockCandidate, err error, cbError error)

func RegisterTransactionFactory added in v0.9.10

func RegisterTransactionFactory()

Types

type Chain added in v0.9.10

type Chain struct {
	module.Chain
	// contains filtered or unexported fields
}

func NewChain added in v0.9.10

func NewChain(
	t T,
	w module.Wallet,
	database db.Database,
	logger log.Logger,
	cvd module.CommitVoteSetDecoder,
	gsStr string,
) (*Chain, error)

func (*Chain) Backup added in v0.9.10

func (c *Chain) Backup(file string, extra []string) error

func (*Chain) BlockManager added in v0.9.10

func (c *Chain) BlockManager() module.BlockManager

func (*Chain) CID added in v0.9.10

func (c *Chain) CID() int

func (*Chain) Channel added in v0.9.10

func (c *Chain) Channel() string

func (*Chain) ChildrenLimit added in v1.0.0

func (c *Chain) ChildrenLimit() int

func (*Chain) Close added in v1.2.14

func (c *Chain) Close()

func (*Chain) CommitVoteSetDecoder added in v0.9.10

func (c *Chain) CommitVoteSetDecoder() module.CommitVoteSetDecoder

func (*Chain) ConcurrencyLevel added in v0.9.10

func (c *Chain) ConcurrencyLevel() int

func (*Chain) Consensus added in v0.9.10

func (c *Chain) Consensus() module.Consensus

func (*Chain) Database added in v0.9.10

func (c *Chain) Database() db.Database

func (*Chain) DefaultWaitTimeout added in v0.9.10

func (c *Chain) DefaultWaitTimeout() time.Duration

func (*Chain) DoDBTask added in v1.2.13

func (c *Chain) DoDBTask(f func(database db.Database))

func (*Chain) Genesis added in v0.9.10

func (c *Chain) Genesis() []byte

func (*Chain) GenesisStorage added in v0.9.10

func (c *Chain) GenesisStorage() module.GenesisStorage

func (*Chain) GetLocatorManager added in v1.3.10

func (c *Chain) GetLocatorManager() (module.LocatorManager, error)

func (*Chain) Import added in v0.9.10

func (c *Chain) Import(src string, height int64) error

func (*Chain) Init added in v0.9.10

func (c *Chain) Init() error

func (*Chain) IsStarted added in v0.9.10

func (c *Chain) IsStarted() bool

func (*Chain) IsStopped added in v0.9.10

func (c *Chain) IsStopped() bool

func (*Chain) Logger added in v0.9.10

func (c *Chain) Logger() log.Logger

func (*Chain) MaxBlockTxBytes added in v0.9.10

func (c *Chain) MaxBlockTxBytes() int

func (*Chain) MaxWaitTimeout added in v0.9.10

func (c *Chain) MaxWaitTimeout() time.Duration

func (*Chain) MetricContext added in v0.9.10

func (c *Chain) MetricContext() context.Context

func (*Chain) NID added in v0.9.10

func (c *Chain) NID() int

func (*Chain) NephewsLimit added in v1.0.0

func (c *Chain) NephewsLimit() int

func (*Chain) NetID added in v0.9.10

func (c *Chain) NetID() int

func (*Chain) NetworkManager added in v0.9.10

func (c *Chain) NetworkManager() module.NetworkManager

func (*Chain) NormalTxPoolSize added in v0.9.10

func (c *Chain) NormalTxPoolSize() int

func (*Chain) PatchDecoder added in v0.9.10

func (c *Chain) PatchDecoder() module.PatchDecoder

func (*Chain) PatchTxPoolSize added in v0.9.10

func (c *Chain) PatchTxPoolSize() int

func (*Chain) Prune added in v0.9.10

func (c *Chain) Prune(gs string, dbt string, height int64) error

func (*Chain) Regulator added in v0.9.10

func (c *Chain) Regulator() module.Regulator

func (*Chain) Reset added in v0.9.10

func (c *Chain) Reset(gs string, height int64, blockHash []byte) error

func (*Chain) RunTask added in v0.9.10

func (c *Chain) RunTask(task string, params json.RawMessage) error

func (*Chain) ServiceManager added in v0.9.10

func (c *Chain) ServiceManager() module.ServiceManager

func (*Chain) SetBlockManager added in v0.9.10

func (c *Chain) SetBlockManager(bm module.BlockManager)

func (*Chain) SetServiceManager added in v0.9.10

func (c *Chain) SetServiceManager(sm module.ServiceManager)

func (*Chain) SetWalletFor added in v1.3.0

func (c *Chain) SetWalletFor(keyType string, bw module.BaseWallet)

func (*Chain) Start added in v0.9.10

func (c *Chain) Start() error

func (*Chain) State added in v0.9.10

func (c *Chain) State() (string, int64, error)

func (*Chain) Stop added in v0.9.10

func (c *Chain) Stop() error

func (*Chain) Term added in v0.9.10

func (c *Chain) Term() error

func (*Chain) TransactionTimeout added in v0.9.10

func (c *Chain) TransactionTimeout() time.Duration

func (*Chain) ValidateTxOnSend added in v1.1.1

func (c *Chain) ValidateTxOnSend() bool

func (*Chain) Verify added in v0.9.10

func (c *Chain) Verify() error

func (*Chain) Wallet added in v0.9.10

func (c *Chain) Wallet() module.Wallet

func (*Chain) WalletFor added in v1.3.0

func (c *Chain) WalletFor(dsa string) module.BaseWallet

type Fixture added in v0.9.10

type Fixture struct {
	// default node
	*Node
	BaseConfig *FixtureConfig

	// all nodes
	Nodes      []*Node
	Validators []*Node
	Height     int64
}

func NewFixture added in v0.9.10

func NewFixture(t T, o ...FixtureOption) *Fixture

func (*Fixture) AddNode added in v0.9.10

func (f *Fixture) AddNode(o ...FixtureOption) *Node

func (*Fixture) AddNodes added in v0.9.10

func (f *Fixture) AddNodes(n int, o ...FixtureOption) []*Node

func (*Fixture) Close added in v0.9.10

func (f *Fixture) Close()

func (*Fixture) NewCommitVoteListForLastBlock added in v1.3.0

func (f *Fixture) NewCommitVoteListForLastBlock(round int32, ntsVoteCount int) module.CommitVoteSet

func (*Fixture) NewPrecommitList added in v1.3.0

func (f *Fixture) NewPrecommitList(blk module.BlockData, round int32, ntsVoteCount int) []*consensus.VoteMessage

func (*Fixture) SendTXToAllAndWaitForBlock added in v1.3.0

func (f *Fixture) SendTXToAllAndWaitForBlock(tx StringerTransaction) module.Block

func (*Fixture) SendTXToAllAndWaitForResultBlock added in v1.3.0

func (f *Fixture) SendTXToAllAndWaitForResultBlock(tx StringerTransaction) module.Block

func (*Fixture) SendTransactionToAll added in v1.3.0

func (f *Fixture) SendTransactionToAll(tx StringerTransaction)

func (*Fixture) SendTransactionToProposer added in v1.3.0

func (f *Fixture) SendTransactionToProposer(tx StringerTransaction)

func (*Fixture) TXInBlock added in v1.3.0

func (f *Fixture) TXInBlock(tx StringerTransaction, blk module.Block) bool

func (*Fixture) WaitForBlock added in v1.3.0

func (f *Fixture) WaitForBlock(h int64) module.Block

func (*Fixture) WaitForNextBlock added in v1.3.0

func (f *Fixture) WaitForNextBlock() module.Block

func (*Fixture) WaitForNextNthBlock added in v1.3.0

func (f *Fixture) WaitForNextNthBlock(n int) module.Block

type FixtureConfig added in v0.9.10

type FixtureConfig struct {
	T                 T
	MerkleRoot        []byte
	MerkleLeaves      int64
	MerkleLastVotes   []byte
	Prefix            string
	Dbase             func() db.Database
	CVSD              module.CommitVoteSetDecoder
	NewPlatform       func(ctx *NodeContext) base.Platform
	NewSM             func(ctx *NodeContext) module.ServiceManager
	NewBM             func(ctx *NodeContext) module.BlockManager
	NewCS             func(ctx *NodeContext) module.Consensus
	TimeoutPropose    time.Duration
	AddValidatorNodes int
	Genesis           string
	GenesisStorage    module.GenesisStorage
	Wallet            module.Wallet
	AddDefaultNode    *bool
	WAL               func() consensus.WALManager
}

func NewFixtureConfig added in v0.9.10

func NewFixtureConfig(t T, o ...FixtureOption) *FixtureConfig

func (*FixtureConfig) ApplyOption added in v0.9.10

func (cf *FixtureConfig) ApplyOption(o ...FixtureOption) *FixtureConfig

func (*FixtureConfig) Override added in v0.9.10

func (cf *FixtureConfig) Override(cf2 *FixtureConfig) *FixtureConfig

type FixtureOption added in v0.9.10

type FixtureOption func(cf *FixtureConfig) *FixtureConfig

func AddDefaultNode added in v0.9.10

func AddDefaultNode(v bool) FixtureOption

func AddValidatorNodes added in v0.9.10

func AddValidatorNodes(n int) FixtureOption

AddValidatorNodes option makes n validators and the first validator becomes default node

func SetTimeoutPropose added in v1.3.10

func SetTimeoutPropose(to time.Duration) FixtureOption

func UseBMFactory added in v1.3.3

func UseBMFactory(f func(ctx *NodeContext) module.BlockManager) FixtureOption

func UseConfig added in v0.9.10

func UseConfig(cf2 *FixtureConfig) FixtureOption

func UseDB added in v0.9.10

func UseDB(dbase db.Database) FixtureOption

func UseGenesis added in v0.9.10

func UseGenesis(gs string) FixtureOption

func UseGenesisStorage added in v1.3.0

func UseGenesisStorage(gs module.GenesisStorage) FixtureOption

func UseSMFactory added in v1.3.13

func UseSMFactory(f func(ctx *NodeContext) module.ServiceManager) FixtureOption

func UseWAL added in v1.3.2

func UseWallet added in v0.9.10

func UseWallet(w module.Wallet) FixtureOption

type NetworkManager added in v0.9.10

type NetworkManager struct {
	module.NetworkManager
	// contains filtered or unexported fields
}

func NewNetworkManager added in v0.9.10

func NewNetworkManager(t T, a module.Address) *NetworkManager

func (*NetworkManager) Close added in v1.2.14

func (n *NetworkManager) Close()

func (*NetworkManager) Connect added in v0.9.10

func (n *NetworkManager) Connect(n2 *NetworkManager)

func (*NetworkManager) GetPeers added in v0.9.10

func (n *NetworkManager) GetPeers() []module.PeerID

func (*NetworkManager) ID added in v0.9.10

func (n *NetworkManager) ID() module.PeerID

func (*NetworkManager) NewPeerFor added in v0.9.10

func (*NetworkManager) NewPeerForWithAddress added in v1.3.0

func (n *NetworkManager) NewPeerForWithAddress(mpi module.ProtocolInfo, w module.Wallet) (*SimplePeer, *SimplePeerHandler)

func (*NetworkManager) RegisterReactor added in v0.9.10

func (n *NetworkManager) RegisterReactor(name string, mpi module.ProtocolInfo, reactor module.Reactor, piList []module.ProtocolInfo, priority uint8, policy module.NotRegisteredProtocolPolicy) (module.ProtocolHandler, error)

func (*NetworkManager) RegisterReactorForStreams added in v0.9.10

func (n *NetworkManager) RegisterReactorForStreams(name string, pi module.ProtocolInfo, reactor module.Reactor, piList []module.ProtocolInfo, priority uint8, policy module.NotRegisteredProtocolPolicy) (module.ProtocolHandler, error)

func (*NetworkManager) SetRole added in v0.9.10

func (n *NetworkManager) SetRole(version int64, role module.Role, peers ...module.PeerID)

func (*NetworkManager) UnregisterReactor added in v0.9.10

func (n *NetworkManager) UnregisterReactor(reactor module.Reactor) error

type Node added in v0.9.10

type Node struct {
	T
	Chain *Chain
	Base  string

	NM        *NetworkManager
	SM        module.ServiceManager
	BM        module.BlockManager
	CS        module.Consensus
	PrevBlock module.Block
	LastBlock module.Block
	Platform  base.Platform
	// contains filtered or unexported fields
}

func NewNode added in v0.9.10

func NewNode(t T, o ...FixtureOption) *Node

func (*Node) Address added in v0.9.10

func (t *Node) Address() module.Address

func (*Node) AssertLastBlock added in v0.9.10

func (t *Node) AssertLastBlock(
	prev module.Block, version int,
)

func (*Node) Close added in v0.9.10

func (t *Node) Close()

func (*Node) CommonAddress added in v1.3.0

func (t *Node) CommonAddress() *common.Address

func (*Node) FinalizeBlock added in v0.9.10

func (t *Node) FinalizeBlock(bc module.BlockCandidate)

func (*Node) GetLastBlock added in v0.9.10

func (t *Node) GetLastBlock() module.Block

func (*Node) ImportBlock added in v0.9.10

func (t *Node) ImportBlock(bc module.BlockCandidate, flag int)

func (*Node) ImportBlockByReader added in v0.9.10

func (t *Node) ImportBlockByReader(
	r io.Reader, flag int,
) module.BlockCandidate

func (*Node) ImportFinalizeBlockByReader added in v0.9.10

func (t *Node) ImportFinalizeBlockByReader(r io.Reader)

func (*Node) InvalidProposalBytesFor added in v1.3.3

func (t *Node) InvalidProposalBytesFor(blk module.Block) (pmBS_ []byte, bpmBS_ []byte, bps_ consensus.PartSet)

func (*Node) NewTx added in v1.3.0

func (t *Node) NewTx() *Transaction

func (*Node) NewVoteListForLastBlock added in v0.9.10

func (t *Node) NewVoteListForLastBlock() module.CommitVoteSet

func (*Node) NilVoteFor added in v1.3.3

func (t *Node) NilVoteFor(vt consensus.VoteType, blk module.Block, r int32) *consensus.VoteMessage

func (*Node) ProposalBytesFor added in v1.3.3

func (t *Node) ProposalBytesFor(blk module.Block, round int32) (pmBS_ []byte, bpmBS_ []byte, bps_ consensus.PartSet)

func (*Node) ProposeBlock added in v0.9.10

func (t *Node) ProposeBlock(
	votes module.CommitVoteSet,
) module.BlockCandidate

func (*Node) ProposeFinalizeBlock added in v0.9.10

func (t *Node) ProposeFinalizeBlock(votes module.CommitVoteSet)

func (*Node) ProposeFinalizeBlockWithTX added in v0.9.10

func (t *Node) ProposeFinalizeBlockWithTX(
	votes module.CommitVoteSet, txJson string,
)

func (*Node) ProposeImportFinalizeBlock added in v0.9.10

func (t *Node) ProposeImportFinalizeBlock(
	votes module.CommitVoteSet,
)

func (*Node) ProposeImportFinalizeBlockWithTX added in v0.9.10

func (t *Node) ProposeImportFinalizeBlockWithTX(
	votes module.CommitVoteSet, txJson string,
)

func (*Node) UpdateLastBlock added in v1.3.0

func (t *Node) UpdateLastBlock()

func (*Node) VoteFor added in v1.3.3

func (t *Node) VoteFor(vt consensus.VoteType, blk module.Block, bpsID *consensus.PartSetID, round int32) *consensus.VoteMessage

func (*Node) WaitForBlock added in v1.3.0

func (t *Node) WaitForBlock(h int64) module.Block

type NodeContext added in v0.9.10

type NodeContext struct {
	C        *Chain
	Config   *FixtureConfig
	Base     string
	Platform base.Platform
	CM       contract.ContractManager
	EM       eeproxy.Manager
}

type Packet added in v0.9.10

type Packet struct {
	SendType SendType
	Src      module.PeerID

	// DstSpec specifies destination.
	// DstSpec is PeerID if SendType is SendTypeUnicast.
	// DstSpec is Role if SendType is SendTypeMulticast.
	// DstSpec is BroadcastType if SendType is SendTypeBroadcast.
	DstSpec interface{}
	MPI     module.ProtocolInfo
	PI      module.ProtocolInfo
	Data    []byte
}

type Peer added in v0.9.10

type Peer interface {
	ID() module.PeerID
	// contains filtered or unexported methods
}

type SendType added in v0.9.10

type SendType int

type ServiceManager added in v0.9.10

type ServiceManager struct {
	module.ServiceManager
	// contains filtered or unexported fields
}

func NewServiceManager added in v0.9.10

func NewServiceManager(
	c *Chain,
	plt base.Platform,
	cm contract.ContractManager,
	em eeproxy.Manager,
) *ServiceManager

func (*ServiceManager) BTPDigestFromResult added in v1.3.0

func (sm *ServiceManager) BTPDigestFromResult(result []byte) (module.BTPDigest, error)

func (*ServiceManager) BTPNetworkFromResult added in v1.3.0

func (sm *ServiceManager) BTPNetworkFromResult(result []byte, nid int64) (module.BTPNetwork, error)

func (*ServiceManager) BTPNetworkTypeFromResult added in v1.3.0

func (sm *ServiceManager) BTPNetworkTypeFromResult(result []byte, ntid int64) (module.BTPNetworkType, error)

func (*ServiceManager) BTPNetworkTypeIDsFromResult added in v1.3.0

func (sm *ServiceManager) BTPNetworkTypeIDsFromResult(result []byte) ([]int64, error)

func (*ServiceManager) BTPSectionFromResult added in v1.3.0

func (sm *ServiceManager) BTPSectionFromResult(result []byte) (module.BTPSection, error)

func (*ServiceManager) CreateInitialTransition added in v0.9.10

func (sm *ServiceManager) CreateInitialTransition(
	result []byte,
	nextValidators module.ValidatorList,
) (module.Transition, error)

func (*ServiceManager) CreateSyncTransition added in v0.9.10

func (sm *ServiceManager) CreateSyncTransition(transition module.Transition, result []byte, vlHash []byte, noBuffer bool) module.Transition

func (*ServiceManager) CreateTransition added in v0.9.10

func (sm *ServiceManager) CreateTransition(parent module.Transition, txs module.TransactionList, bi module.BlockInfo, csi module.ConsensusInfo, validated bool) (module.Transition, error)

func (*ServiceManager) ExportResult added in v0.9.10

func (sm *ServiceManager) ExportResult(result []byte, vh []byte, dst db.Database) error

func (*ServiceManager) Finalize added in v0.9.10

func (sm *ServiceManager) Finalize(transition module.Transition, opt int) error

func (*ServiceManager) GenesisTransactionFromBytes added in v0.9.10

func (sm *ServiceManager) GenesisTransactionFromBytes(b []byte, blockVersion int) (module.Transaction, error)

func (*ServiceManager) GetChainID added in v0.9.10

func (sm *ServiceManager) GetChainID(result []byte) (int64, error)

func (*ServiceManager) GetMembers added in v0.9.10

func (sm *ServiceManager) GetMembers(result []byte) (module.MemberList, error)

func (*ServiceManager) GetMinimizeBlockGen added in v0.9.10

func (sm *ServiceManager) GetMinimizeBlockGen(result []byte) bool

func (*ServiceManager) GetNetworkID added in v0.9.10

func (sm *ServiceManager) GetNetworkID(result []byte) (int64, error)

func (*ServiceManager) GetNextBlockVersion added in v0.9.10

func (sm *ServiceManager) GetNextBlockVersion(result []byte) int

func (*ServiceManager) GetPatches added in v0.9.10

func (*ServiceManager) GetRevision added in v1.3.13

func (sm *ServiceManager) GetRevision(result []byte) module.Revision

func (*ServiceManager) GetRoundLimit added in v0.9.10

func (sm *ServiceManager) GetRoundLimit(result []byte, vl int) int64

func (*ServiceManager) ImportResult added in v0.9.10

func (sm *ServiceManager) ImportResult(result []byte, vh []byte, src db.Database) error

func (*ServiceManager) NextProofContextMapFromResult added in v1.3.0

func (sm *ServiceManager) NextProofContextMapFromResult(result []byte) (module.BTPProofContextMap, error)

func (*ServiceManager) PatchTransition added in v0.9.10

func (sm *ServiceManager) PatchTransition(transition module.Transition, patches module.TransactionList, bi module.BlockInfo) module.Transition

func (*ServiceManager) ProposeTransition added in v0.9.10

func (sm *ServiceManager) ProposeTransition(parent module.Transition, bi module.BlockInfo, csi module.ConsensusInfo) (module.Transition, error)

func (*ServiceManager) ReceiptListFromResult added in v0.9.10

func (sm *ServiceManager) ReceiptListFromResult(result []byte, g module.TransactionGroup) (module.ReceiptList, error)

func (*ServiceManager) SendTransaction added in v0.9.10

func (sm *ServiceManager) SendTransaction(result []byte, height int64, tx interface{}) ([]byte, error)

func (*ServiceManager) SendTransactionAndWait added in v0.9.10

func (sm *ServiceManager) SendTransactionAndWait(result []byte, height int64, tx interface{}) ([]byte, <-chan interface{}, error)

func (*ServiceManager) TransactionFromBytes added in v0.9.10

func (sm *ServiceManager) TransactionFromBytes(b []byte, blockVersion int) (module.Transaction, error)

func (*ServiceManager) TransactionListFromHash added in v0.9.10

func (sm *ServiceManager) TransactionListFromHash(hash []byte) module.TransactionList

func (*ServiceManager) TransactionListFromSlice added in v0.9.10

func (sm *ServiceManager) TransactionListFromSlice(txs []module.Transaction, version int) module.TransactionList

func (*ServiceManager) ValidatorListFromHash added in v0.9.10

func (sm *ServiceManager) ValidatorListFromHash(hash []byte) module.ValidatorList

func (*ServiceManager) WaitForTransaction added in v0.9.10

func (sm *ServiceManager) WaitForTransaction(parent module.Transition, bi module.BlockInfo, cb func()) bool

func (*ServiceManager) WaitTransactionResult added in v0.9.10

func (sm *ServiceManager) WaitTransactionResult(id []byte) (<-chan interface{}, error)

type SimplePeer added in v0.9.10

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

func NewPeer added in v0.9.10

func NewPeer(t T) *SimplePeer

func NewPeerWithAddress added in v0.9.10

func NewPeerWithAddress(t T, w module.Wallet) *SimplePeer

func (*SimplePeer) Address added in v0.9.10

func (p *SimplePeer) Address() module.Address

func (*SimplePeer) Connect added in v0.9.10

func (p *SimplePeer) Connect(p2 Peer) *SimplePeer

func (*SimplePeer) ID added in v0.9.10

func (p *SimplePeer) ID() module.PeerID

func (*SimplePeer) RegisterProto added in v0.9.10

func (p *SimplePeer) RegisterProto(mpi module.ProtocolInfo) *SimplePeerHandler

func (*SimplePeer) Wallet added in v0.9.10

func (p *SimplePeer) Wallet() module.Wallet

type SimplePeerHandler added in v0.9.10

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

func (*SimplePeerHandler) Address added in v0.9.10

func (h *SimplePeerHandler) Address() module.Address

func (*SimplePeerHandler) AssertReceiveUnicast added in v0.9.10

func (h *SimplePeerHandler) AssertReceiveUnicast(pi module.ProtocolInfo, m interface{})

func (*SimplePeerHandler) Broadcast added in v0.9.10

func (h *SimplePeerHandler) Broadcast(
	pi module.ProtocolInfo,
	m interface{},
	btype module.BroadcastType,
	cb func(bool, error),
)

func (*SimplePeerHandler) Multicast added in v0.9.10

func (h *SimplePeerHandler) Multicast(
	pi module.ProtocolInfo,
	m interface{},
	role module.Role,
	cb func(bool, error),
)

func (*SimplePeerHandler) Peer added in v0.9.10

func (h *SimplePeerHandler) Peer() *SimplePeer

func (*SimplePeerHandler) Receive added in v0.9.10

func (h *SimplePeerHandler) Receive(
	pi module.ProtocolInfo,
	expMsg interface{},
	outMsg interface{},
) *Packet

func (*SimplePeerHandler) Unicast added in v0.9.10

func (h *SimplePeerHandler) Unicast(
	pi module.ProtocolInfo,
	m interface{},
	cb func(bool, error),
)

func (*SimplePeerHandler) Wallet added in v0.9.10

func (h *SimplePeerHandler) Wallet() module.Wallet

type StringerTransaction added in v1.3.0

type StringerTransaction interface {
	module.Transaction
	String() string
}

type T added in v1.3.9

type T interface {
	Errorf(format string, args ...interface{})
	Logf(format string, args ...any)
}

type Transaction added in v0.9.10

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

func NewTransaction added in v0.9.10

func NewTransaction() *Transaction

func NewTx added in v0.9.10

func NewTx() *Transaction

func (*Transaction) Bytes added in v0.9.10

func (t *Transaction) Bytes() []byte

func (*Transaction) Call added in v1.3.0

func (t *Transaction) Call(method string, params map[string]string) *Transaction

func (*Transaction) CallFrom added in v1.3.0

func (t *Transaction) CallFrom(from *common.Address, method string, params map[string]string) *Transaction

func (*Transaction) ClearCache added in v0.9.10

func (t *Transaction) ClearCache()

func (*Transaction) Dispose added in v0.9.10

func (t *Transaction) Dispose()

func (*Transaction) Equal added in v0.9.10

func (t *Transaction) Equal(object trie.Object) bool

func (*Transaction) Execute added in v0.9.10

func (t *Transaction) Execute(ctx contract.Context, wcs state.WorldSnapshot, estimate bool) (txresult.Receipt, error)

func (*Transaction) Flush added in v0.9.10

func (t *Transaction) Flush() error

func (*Transaction) From added in v0.9.10

func (t *Transaction) From() module.Address

func (*Transaction) GetHandler added in v0.9.10

func (*Transaction) Group added in v0.9.10

func (t *Transaction) Group() module.TransactionGroup

func (*Transaction) Hash added in v0.9.10

func (t *Transaction) Hash() []byte

func (*Transaction) ID added in v0.9.10

func (t *Transaction) ID() []byte

func (*Transaction) IsSkippable added in v0.9.10

func (t *Transaction) IsSkippable() bool

func (*Transaction) Nonce added in v0.9.10

func (t *Transaction) Nonce() *big.Int

func (*Transaction) PreValidate added in v0.9.10

func (t *Transaction) PreValidate(wc state.WorldContext, update bool) error

func (*Transaction) Prepare added in v0.9.10

func (t *Transaction) Prepare(ctx contract.Context) (state.WorldContext, error)

func (*Transaction) Reset added in v0.9.10

func (t *Transaction) Reset(s db.Database, k []byte) error

func (*Transaction) Resolve added in v0.9.10

func (t *Transaction) Resolve(builder merkle.Builder) error

func (*Transaction) SetNextBlockVersion added in v0.9.10

func (t *Transaction) SetNextBlockVersion(v *int32) *Transaction

func (*Transaction) SetTimestamp added in v1.3.0

func (t *Transaction) SetTimestamp(ts int64) *Transaction

func (*Transaction) SetValidators added in v0.9.10

func (t *Transaction) SetValidators(addrs ...module.Address) *Transaction

func (*Transaction) SetValidatorsAddresser added in v0.9.10

func (t *Transaction) SetValidatorsAddresser(addrs ...addresser) *Transaction

func (*Transaction) SetValidatorsNode added in v0.9.10

func (t *Transaction) SetValidatorsNode(addrs ...*Node) *Transaction

func (*Transaction) SetVarTest added in v0.9.10

func (t *Transaction) SetVarTest(v *string) *Transaction

func (Transaction) String added in v0.9.10

func (t Transaction) String() string

func (*Transaction) Timestamp added in v0.9.10

func (t *Transaction) Timestamp() int64

func (*Transaction) To added in v0.9.10

func (t *Transaction) To() module.Address

func (*Transaction) ToJSON added in v0.9.10

func (t *Transaction) ToJSON(version module.JSONVersion) (interface{}, error)

func (*Transaction) ValidateNetwork added in v0.9.10

func (t *Transaction) ValidateNetwork(nid int) bool

func (*Transaction) Verify added in v0.9.10

func (t *Transaction) Verify() error

func (*Transaction) Version added in v0.9.10

func (t *Transaction) Version() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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