Versions in this module Expand all Collapse all v1 v1.0.2 Jan 27, 2022 Changes in this version type FakeLedger + func (l *FakeLedger) QueryBlockHeader(blockId []byte) (ledger.BlockHandle, error) + func (l *FakeLedger) QueryBlockHeaderByHeight(height int64) (ledger.BlockHandle, error) + func (l *FakeLedger) QueryTipBlockHeader() ledger.BlockHandle v1.0.1 Dec 1, 2021 Changes in this version + func GetGenesisConsensusConf() []byte + func NewP2P(node string) (p2p.Server, *nctx.NetCtx, error) + func NewXContent() *xctx.BaseCtx + type FReaderItem struct + Bucket string + Key []byte + Value []byte + type FakeBlock struct + Blockid []byte + ConsensusStorage []byte + Height int64 + Nonce int32 + PreHash []byte + Proposer string + PublicKey string + Sign []byte + Timestamp int64 + func NewBlock(height int) *FakeBlock + func (b *FakeBlock) GetBlockid() []byte + func (b *FakeBlock) GetConsensusStorage() ([]byte, error) + func (b *FakeBlock) GetHeight() int64 + func (b *FakeBlock) GetInTrunk() bool + func (b *FakeBlock) GetNextHash() []byte + func (b *FakeBlock) GetPreHash() []byte + func (b *FakeBlock) GetProposer() []byte + func (b *FakeBlock) GetPublicKey() string + func (b *FakeBlock) GetSign() []byte + func (b *FakeBlock) GetTimestamp() int64 + func (b *FakeBlock) GetTxIDs() []string + func (b *FakeBlock) MakeBlockId() ([]byte, error) + func (b *FakeBlock) SetItem(param string, value interface{}) error + func (b *FakeBlock) SetProposer(m string) + func (b *FakeBlock) SetTimestamp(t int64) + type FakeKContext struct + func NewFakeKContext(args map[string][]byte, m map[string]map[string][]byte) *FakeKContext + func (c *FakeKContext) AddEvent(events ...*protos.ContractEvent) + func (c *FakeKContext) AddResourceUsed(delta contract.Limits) + func (c *FakeKContext) Args() map[string][]byte + func (c *FakeKContext) AuthRequire() []string + func (c *FakeKContext) Call(module, contract, method string, args map[string][]byte) (*contract.Response, error) + func (c *FakeKContext) Caller() string + func (c *FakeKContext) Del(bucket string, key []byte) error + func (c *FakeKContext) EmitAsyncTask(event string, args interface{}) error + func (c *FakeKContext) Flush() error + func (c *FakeKContext) Get(bucket string, key []byte) ([]byte, error) + func (c *FakeKContext) GetAccountAddresses(accountName string) ([]string, error) + func (c *FakeKContext) Initiator() string + func (c *FakeKContext) Put(bucket string, key, value []byte) error + func (c *FakeKContext) QueryBlock(blockid []byte) (*xldgpb.InternalBlock, error) + func (c *FakeKContext) QueryTransaction(txid []byte) (*pb.Transaction, error) + func (c *FakeKContext) RWSet() *contract.RWSet + func (c *FakeKContext) ResourceLimit() contract.Limits + func (c *FakeKContext) Select(bucket string, startKey []byte, endKey []byte) (contract.Iterator, error) + func (c *FakeKContext) Transfer(from string, to string, amount *big.Int) error + func (c *FakeKContext) UTXORWSet() *contract.UTXORWSet + func (c *FakeKContext) VerifyContractOwnerPermission(contractName string, authRequire []string) error + func (c *FakeKContext) VerifyContractPermission(initiator string, authRequire []string, contractName string, methodName string) (bool, error) + type FakeLedger struct + func NewFakeLedger(conf []byte) *FakeLedger + func (l *FakeLedger) CreateSnapshot(blkId []byte) (ledger.XMReader, error) + func (l *FakeLedger) GetConsensusConf() ([]byte, error) + func (l *FakeLedger) GetGenesisConsensusConf() []byte + func (l *FakeLedger) GetTipBlock() ledger.BlockHandle + func (l *FakeLedger) GetTipSnapshot() (ledger.XMReader, error) + func (l *FakeLedger) GetTipXMSnapshotReader() (ledger.XMSnapshotReader, error) + func (l *FakeLedger) Put(block *FakeBlock) error + func (l *FakeLedger) QueryBlock(blockId []byte) (ledger.BlockHandle, error) + func (l *FakeLedger) QueryBlockByHeight(height int64) (ledger.BlockHandle, error) + func (l *FakeLedger) SetConsensusStorage(height int, s []byte) + func (l *FakeLedger) SetSnapshot(bucket string, key []byte, value []byte) + func (l *FakeLedger) VerifyMerkle(context.BlockInterface) error + type FakeManager struct + R *FakeRegistry + func (m *FakeManager) GetKernRegistry() contract.KernRegistry + func (m *FakeManager) NewContext(cfg *contract.ContextConfig) (contract.Context, error) + func (m *FakeManager) NewStateSandbox(cfg *contract.SandboxConfig) (contract.StateSandbox, error) + type FakeMeta struct + func (m *FakeMeta) GetTipBlockid() []byte + func (m *FakeMeta) GetTrunkHeight() int64 + type FakeP2p struct + func (p *FakeP2p) GetCurrentPeerAddress() []string + func (p *FakeP2p) GetLocalAccount() string + type FakeRegistry struct + M map[string]contract.KernMethod + func (r *FakeRegistry) GetKernMethod(contract, method string) (contract.KernMethod, error) + func (r *FakeRegistry) RegisterKernMethod(contract, method string, handler contract.KernMethod) + func (r *FakeRegistry) RegisterShortcut(oldmethod, contract, method string) + func (r *FakeRegistry) UnregisterKernMethod(ctract, method string) + type FakeSandBox struct + func (s *FakeSandBox) Get(bucket string, key []byte) ([]byte, error) + func (s *FakeSandBox) SetContext(bucket string, key, value []byte) + type FakeXMReader map[string]FReaderItem + func NewFakeXMReader() FakeXMReader + func (r *FakeXMReader) Select(bucket string, startKey []byte, endKey []byte) (ledger.XMIterator, error) + func (r FakeXMReader) Get(bucket string, key []byte) (*ledger.VersionedData, error)