Documentation ¶
Index ¶
- Constants
- func AssertBlock(t *testing.T, blk module.Block, version int, height int64, id []byte, ...)
- func AssertBlockInBM(t *testing.T, bm module.BlockManager, version int, height int64, id []byte, ...)
- func AssertLastBlock(t *testing.T, bm module.BlockManager, height int64, prevID []byte, version int)
- func DumpRLP(indent string, data []byte) string
- func FinalizeBlock(t *testing.T, bm module.BlockManager, bc module.BlockCandidate)
- func GetLastBlock(t *testing.T, bm module.BlockManager) module.Block
- func ImportBlock(t *testing.T, bm module.BlockManager, bc module.BlockCandidate, flag int) (resBc module.BlockCandidate, err error, cbErr error)
- func ImportBlockByReader(t *testing.T, bm module.BlockManager, r io.Reader, flag int) (resBc module.BlockCandidate, err error, cbErr error)
- func NewRegulator() module.Regulator
- func NewWalletProvider() module.WalletProvider
- func NodeInterconnect(nodes []*Node)
- func NodeWaitForBlock(nodes []*Node, h int64) module.Block
- func PeerConnect(p1 Peer, p2 Peer)
- func ProposeBlock(bm module.BlockManager, prevID []byte, votes module.CommitVoteSet) (bc module.BlockCandidate, err error, cbError error)
- func RegisterTransactionFactory()
- type Chain
- func (c *Chain) Backup(file string, extra []string) error
- func (c *Chain) BlockManager() module.BlockManager
- func (c *Chain) CID() int
- func (c *Chain) Channel() string
- func (c *Chain) ChildrenLimit() int
- func (c *Chain) Close()
- func (c *Chain) CommitVoteSetDecoder() module.CommitVoteSetDecoder
- func (c *Chain) ConcurrencyLevel() int
- func (c *Chain) Consensus() module.Consensus
- func (c *Chain) Database() db.Database
- func (c *Chain) DefaultWaitTimeout() time.Duration
- func (c *Chain) DoDBTask(f func(database db.Database))
- func (c *Chain) Genesis() []byte
- func (c *Chain) GenesisStorage() module.GenesisStorage
- func (c *Chain) Import(src string, height int64) error
- func (c *Chain) Init() error
- func (c *Chain) IsStarted() bool
- func (c *Chain) IsStopped() bool
- func (c *Chain) Logger() log.Logger
- func (c *Chain) MaxBlockTxBytes() int
- func (c *Chain) MaxWaitTimeout() time.Duration
- func (c *Chain) MetricContext() context.Context
- func (c *Chain) NID() int
- func (c *Chain) NephewsLimit() int
- func (c *Chain) NetID() int
- func (c *Chain) NetworkManager() module.NetworkManager
- func (c *Chain) NormalTxPoolSize() int
- func (c *Chain) PatchDecoder() module.PatchDecoder
- func (c *Chain) PatchTxPoolSize() int
- func (c *Chain) Prune(gs string, dbt string, height int64) error
- func (c *Chain) Regulator() module.Regulator
- func (c *Chain) Reset(gs string, height int64, blockHash []byte) error
- func (c *Chain) RunTask(task string, params json.RawMessage) error
- func (c *Chain) ServiceManager() module.ServiceManager
- func (c *Chain) SetBlockManager(bm module.BlockManager)
- func (c *Chain) SetServiceManager(sm module.ServiceManager)
- func (c *Chain) SetWalletFor(keyType string, bw module.BaseWallet)
- func (c *Chain) Start() error
- func (c *Chain) State() (string, int64, error)
- func (c *Chain) Stop() error
- func (c *Chain) Term() error
- func (c *Chain) TransactionTimeout() time.Duration
- func (c *Chain) ValidateTxOnSend() bool
- func (c *Chain) Verify() error
- func (c *Chain) Wallet() module.Wallet
- func (c *Chain) WalletFor(dsa string) module.BaseWallet
- type Fixture
- func (f *Fixture) AddNode(o ...FixtureOption) *Node
- func (f *Fixture) AddNodes(n int, o ...FixtureOption) []*Node
- func (f *Fixture) Close()
- func (f *Fixture) NewCommitVoteListForLastBlock(round int32, ntsVoteCount int) module.CommitVoteSet
- func (f *Fixture) NewPrecommitList(blk module.BlockData, round int32, ntsVoteCount int) []*consensus.VoteMessage
- func (f *Fixture) SendTXToAllAndWaitForBlock(tx StringerTransaction) module.Block
- func (f *Fixture) SendTXToAllAndWaitForResultBlock(tx StringerTransaction) module.Block
- func (f *Fixture) SendTransactionToAll(tx StringerTransaction)
- func (f *Fixture) SendTransactionToProposer(tx StringerTransaction)
- func (f *Fixture) TXInBlock(tx StringerTransaction, blk module.Block) bool
- func (f *Fixture) WaitForBlock(h int64) module.Block
- func (f *Fixture) WaitForNextBlock() module.Block
- func (f *Fixture) WaitForNextNthBlock(n int) module.Block
- type FixtureConfig
- type FixtureOption
- func AddDefaultNode(v bool) FixtureOption
- func AddValidatorNodes(n int) FixtureOption
- func UseBMFactory(f func(ctx *NodeContext) module.BlockManager) FixtureOption
- func UseConfig(cf2 *FixtureConfig) FixtureOption
- func UseDB(dbase db.Database) FixtureOption
- func UseGenesis(gs string) FixtureOption
- func UseGenesisStorage(gs module.GenesisStorage) FixtureOption
- func UseWAL(wal consensus.WALManager) FixtureOption
- func UseWallet(w module.Wallet) FixtureOption
- type NetworkManager
- func (n *NetworkManager) Close()
- func (n *NetworkManager) Connect(n2 *NetworkManager)
- func (n *NetworkManager) GetPeers() []module.PeerID
- func (n *NetworkManager) ID() module.PeerID
- func (n *NetworkManager) NewPeerFor(mpi module.ProtocolInfo) (*SimplePeer, *SimplePeerHandler)
- func (n *NetworkManager) NewPeerForWithAddress(mpi module.ProtocolInfo, w module.Wallet) (*SimplePeer, *SimplePeerHandler)
- func (n *NetworkManager) RegisterReactor(name string, mpi module.ProtocolInfo, reactor module.Reactor, ...) (module.ProtocolHandler, error)
- func (n *NetworkManager) RegisterReactorForStreams(name string, pi module.ProtocolInfo, reactor module.Reactor, ...) (module.ProtocolHandler, error)
- func (n *NetworkManager) SetRole(version int64, role module.Role, peers ...module.PeerID)
- func (n *NetworkManager) UnregisterReactor(reactor module.Reactor) error
- type Node
- func (t *Node) Address() module.Address
- func (t *Node) AssertLastBlock(prev module.Block, version int)
- func (t *Node) Close()
- func (t *Node) CommonAddress() *common.Address
- func (t *Node) FinalizeBlock(bc module.BlockCandidate)
- func (t *Node) GetLastBlock() module.Block
- func (t *Node) ImportBlock(bc module.BlockCandidate, flag int)
- func (t *Node) ImportBlockByReader(r io.Reader, flag int) module.BlockCandidate
- func (t *Node) ImportFinalizeBlockByReader(r io.Reader)
- func (t *Node) InvalidProposalBytesFor(blk module.Block) (pmBS_ []byte, bpmBS_ []byte, bps_ consensus.PartSet)
- func (t *Node) NewTx() *Transaction
- func (t *Node) NewVoteListForLastBlock() module.CommitVoteSet
- func (t *Node) NilVoteFor(vt consensus.VoteType, blk module.Block, r int32) *consensus.VoteMessage
- func (t *Node) ProposalBytesFor(blk module.Block, round int32) (pmBS_ []byte, bpmBS_ []byte, bps_ consensus.PartSet)
- func (t *Node) ProposeBlock(votes module.CommitVoteSet) module.BlockCandidate
- func (t *Node) ProposeFinalizeBlock(votes module.CommitVoteSet)
- func (t *Node) ProposeFinalizeBlockWithTX(votes module.CommitVoteSet, txJson string)
- func (t *Node) ProposeImportFinalizeBlock(votes module.CommitVoteSet)
- func (t *Node) ProposeImportFinalizeBlockWithTX(votes module.CommitVoteSet, txJson string)
- func (t *Node) UpdateLastBlock()
- func (t *Node) VoteFor(vt consensus.VoteType, blk module.Block, bpsID *consensus.PartSetID, ...) *consensus.VoteMessage
- func (t *Node) WaitForBlock(h int64) module.Block
- type NodeContext
- type Packet
- type Peer
- type SendType
- type ServiceManager
- func (sm *ServiceManager) BTPDigestFromResult(result []byte) (module.BTPDigest, error)
- func (sm *ServiceManager) BTPNetworkFromResult(result []byte, nid int64) (module.BTPNetwork, error)
- func (sm *ServiceManager) BTPNetworkTypeFromResult(result []byte, ntid int64) (module.BTPNetworkType, error)
- func (sm *ServiceManager) BTPNetworkTypeIDsFromResult(result []byte) ([]int64, error)
- func (sm *ServiceManager) BTPSectionFromResult(result []byte) (module.BTPSection, error)
- func (sm *ServiceManager) CreateInitialTransition(result []byte, nextValidators module.ValidatorList) (module.Transition, error)
- func (sm *ServiceManager) CreateSyncTransition(transition module.Transition, result []byte, vlHash []byte, noBuffer bool) module.Transition
- func (sm *ServiceManager) CreateTransition(parent module.Transition, txs module.TransactionList, bi module.BlockInfo, ...) (module.Transition, error)
- func (sm *ServiceManager) ExportResult(result []byte, vh []byte, dst db.Database) error
- func (sm *ServiceManager) Finalize(transition module.Transition, opt int) error
- func (sm *ServiceManager) GenesisTransactionFromBytes(b []byte, blockVersion int) (module.Transaction, error)
- func (sm *ServiceManager) GetChainID(result []byte) (int64, error)
- func (sm *ServiceManager) GetMembers(result []byte) (module.MemberList, error)
- func (sm *ServiceManager) GetMinimizeBlockGen(result []byte) bool
- func (sm *ServiceManager) GetNetworkID(result []byte) (int64, error)
- func (sm *ServiceManager) GetNextBlockVersion(result []byte) int
- func (sm *ServiceManager) GetPatches(parent module.Transition, bi module.BlockInfo) module.TransactionList
- func (sm *ServiceManager) GetRoundLimit(result []byte, vl int) int64
- func (sm *ServiceManager) ImportResult(result []byte, vh []byte, src db.Database) error
- func (sm *ServiceManager) NextProofContextMapFromResult(result []byte) (module.BTPProofContextMap, error)
- func (sm *ServiceManager) PatchTransition(transition module.Transition, patches module.TransactionList, ...) module.Transition
- func (sm *ServiceManager) ProposeTransition(parent module.Transition, bi module.BlockInfo, csi module.ConsensusInfo) (module.Transition, error)
- func (sm *ServiceManager) ReceiptListFromResult(result []byte, g module.TransactionGroup) (module.ReceiptList, error)
- func (sm *ServiceManager) SendTransaction(result []byte, height int64, tx interface{}) ([]byte, error)
- func (sm *ServiceManager) SendTransactionAndWait(result []byte, height int64, tx interface{}) ([]byte, <-chan interface{}, error)
- func (sm *ServiceManager) TransactionFromBytes(b []byte, blockVersion int) (module.Transaction, error)
- func (sm *ServiceManager) TransactionListFromHash(hash []byte) module.TransactionList
- func (sm *ServiceManager) TransactionListFromSlice(txs []module.Transaction, version int) module.TransactionList
- func (sm *ServiceManager) ValidatorListFromHash(hash []byte) module.ValidatorList
- func (sm *ServiceManager) WaitForTransaction(parent module.Transition, bi module.BlockInfo, cb func()) bool
- func (sm *ServiceManager) WaitTransactionResult(id []byte) (<-chan interface{}, error)
- type SimplePeer
- type SimplePeerHandler
- func (h *SimplePeerHandler) Address() module.Address
- func (h *SimplePeerHandler) AssertReceiveUnicast(pi module.ProtocolInfo, m interface{})
- func (h *SimplePeerHandler) Broadcast(pi module.ProtocolInfo, m interface{}, btype module.BroadcastType, ...)
- func (h *SimplePeerHandler) Multicast(pi module.ProtocolInfo, m interface{}, role module.Role, cb func(bool, error))
- func (h *SimplePeerHandler) Peer() *SimplePeer
- func (h *SimplePeerHandler) Receive(pi module.ProtocolInfo, expMsg interface{}, outMsg interface{}) *Packet
- func (h *SimplePeerHandler) Unicast(pi module.ProtocolInfo, m interface{}, cb func(bool, error))
- func (h *SimplePeerHandler) Wallet() module.Wallet
- type StringerTransaction
- type Transaction
- func (t *Transaction) Bytes() []byte
- func (t *Transaction) Call(method string, params map[string]string) *Transaction
- func (t *Transaction) CallFrom(from *common.Address, method string, params map[string]string) *Transaction
- func (t *Transaction) ClearCache()
- func (t *Transaction) Dispose()
- func (t *Transaction) Equal(object trie.Object) bool
- func (t *Transaction) Execute(ctx contract.Context, wcs state.WorldSnapshot, estimate bool) (txresult.Receipt, error)
- func (t *Transaction) Flush() error
- func (t *Transaction) From() module.Address
- func (t *Transaction) GetHandler(cm contract.ContractManager) (transaction.Handler, error)
- func (t *Transaction) Group() module.TransactionGroup
- func (t *Transaction) Hash() []byte
- func (t *Transaction) ID() []byte
- func (t *Transaction) IsSkippable() bool
- func (t *Transaction) Nonce() *big.Int
- func (t *Transaction) PreValidate(wc state.WorldContext, update bool) error
- func (t *Transaction) Prepare(ctx contract.Context) (state.WorldContext, error)
- func (t *Transaction) Reset(s db.Database, k []byte) error
- func (t *Transaction) Resolve(builder merkle.Builder) error
- func (t *Transaction) SetNextBlockVersion(v *int32) *Transaction
- func (t *Transaction) SetTimestamp(ts int64) *Transaction
- func (t *Transaction) SetValidators(addrs ...module.Address) *Transaction
- func (t *Transaction) SetValidatorsAddresser(addrs ...addresser) *Transaction
- func (t *Transaction) SetValidatorsNode(addrs ...*Node) *Transaction
- func (t *Transaction) SetVarTest(v *string) *Transaction
- func (t Transaction) String() string
- func (t *Transaction) Timestamp() int64
- func (t *Transaction) To() module.Address
- func (t *Transaction) ToJSON(version module.JSONVersion) (interface{}, error)
- func (t *Transaction) ValidateNetwork(nid int) bool
- func (t *Transaction) Verify() error
- func (t *Transaction) Version() int
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 AssertBlockInBM ¶ added in v0.9.10
func AssertLastBlock ¶ added in v0.9.10
func FinalizeBlock ¶ added in v0.9.10
func FinalizeBlock( t *testing.T, bm module.BlockManager, bc module.BlockCandidate, )
func GetLastBlock ¶ added in v0.9.10
func ImportBlock ¶ added in v0.9.10
func ImportBlock( t *testing.T, bm module.BlockManager, bc module.BlockCandidate, flag int, ) (resBc module.BlockCandidate, err error, cbErr error)
func ImportBlockByReader ¶ added in v0.9.10
func NewRegulator ¶ added in v0.9.10
func NewWalletProvider ¶ added in v1.3.0
func NewWalletProvider() module.WalletProvider
func NodeInterconnect ¶ added in v0.9.10
func NodeInterconnect(nodes []*Node)
func PeerConnect ¶ added in v0.9.10
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
func (*Chain) BlockManager ¶ added in v0.9.10
func (c *Chain) BlockManager() module.BlockManager
func (*Chain) ChildrenLimit ¶ added in v1.0.0
func (*Chain) CommitVoteSetDecoder ¶ added in v0.9.10
func (c *Chain) CommitVoteSetDecoder() module.CommitVoteSetDecoder
func (*Chain) ConcurrencyLevel ¶ added in v0.9.10
func (*Chain) DefaultWaitTimeout ¶ added in v0.9.10
func (*Chain) GenesisStorage ¶ added in v0.9.10
func (c *Chain) GenesisStorage() module.GenesisStorage
func (*Chain) MaxBlockTxBytes ¶ added in v0.9.10
func (*Chain) MaxWaitTimeout ¶ added in v0.9.10
func (*Chain) MetricContext ¶ added in v0.9.10
func (*Chain) NephewsLimit ¶ added in v1.0.0
func (*Chain) NetworkManager ¶ added in v0.9.10
func (c *Chain) NetworkManager() module.NetworkManager
func (*Chain) NormalTxPoolSize ¶ added in v0.9.10
func (*Chain) PatchDecoder ¶ added in v0.9.10
func (c *Chain) PatchDecoder() module.PatchDecoder
func (*Chain) PatchTxPoolSize ¶ added in v0.9.10
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) TransactionTimeout ¶ added in v0.9.10
func (*Chain) ValidateTxOnSend ¶ added in v1.1.1
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 *testing.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) 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 (*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) WaitForNextBlock ¶ added in v1.3.0
type FixtureConfig ¶ added in v0.9.10
type FixtureConfig struct { T *testing.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 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 *testing.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 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 UseWAL ¶ added in v1.3.2
func UseWAL(wal consensus.WALManager) FixtureOption
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 *testing.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 (n *NetworkManager) NewPeerFor(mpi module.ProtocolInfo) (*SimplePeer, *SimplePeerHandler)
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) UnregisterReactor ¶ added in v0.9.10
func (n *NetworkManager) UnregisterReactor(reactor module.Reactor) error
type Node ¶ added in v0.9.10
type Node struct { *testing.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 (*Node) AssertLastBlock ¶ added in v0.9.10
func (*Node) CommonAddress ¶ added in v1.3.0
func (*Node) FinalizeBlock ¶ added in v0.9.10
func (t *Node) FinalizeBlock(bc module.BlockCandidate)
func (*Node) GetLastBlock ¶ added in v0.9.10
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 (*Node) ImportFinalizeBlockByReader ¶ added in v0.9.10
func (*Node) InvalidProposalBytesFor ¶ added in v1.3.3
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 (*Node) ProposalBytesFor ¶ added in v1.3.3
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()
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 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 (*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 (sm *ServiceManager) GetPatches(parent module.Transition, bi module.BlockInfo) module.TransactionList
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 (*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 *testing.T) *SimplePeer
func NewPeerWithAddress ¶ added in v0.9.10
func NewPeerWithAddress(t *testing.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 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) 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 (t *Transaction) GetHandler(cm contract.ContractManager) (transaction.Handler, error)
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.