Documentation ¶
Index ¶
- func GetGenesisConsensusConf() []byte
- func NewP2P(node string) (p2p.Server, *nctx.NetCtx, error)
- func NewXContent() *xctx.BaseCtx
- type FReaderItem
- type 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
- 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
- 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) QueryBlockHeader(blockId []byte) (ledger.BlockHandle, error)
- func (l *FakeLedger) QueryBlockHeaderByHeight(height int64) (ledger.BlockHandle, error)
- func (l *FakeLedger) QueryTipBlockHeader() ledger.BlockHandle
- 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
- type FakeMeta
- type FakeP2p
- type FakeRegistry
- 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
- type FakeXMReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGenesisConsensusConf ¶
func GetGenesisConsensusConf() []byte
func NewXContent ¶
Types ¶
type FReaderItem ¶
type FakeBlock ¶
type FakeBlock struct { Proposer string Height int64 Blockid []byte ConsensusStorage []byte Timestamp int64 Nonce int32 PublicKey string Sign []byte PreHash []byte }
func (*FakeBlock) GetBlockid ¶
func (*FakeBlock) GetConsensusStorage ¶
func (*FakeBlock) GetInTrunk ¶
func (*FakeBlock) GetNextHash ¶
func (*FakeBlock) GetPreHash ¶
func (*FakeBlock) GetProposer ¶
func (*FakeBlock) GetPublicKey ¶
func (*FakeBlock) GetTimestamp ¶
func (*FakeBlock) MakeBlockId ¶
func (*FakeBlock) SetProposer ¶
func (*FakeBlock) SetTimestamp ¶
type FakeKContext ¶
type FakeKContext struct {
// contains filtered or unexported fields
}
func NewFakeKContext ¶
func (*FakeKContext) AddEvent ¶
func (c *FakeKContext) AddEvent(events ...*protos.ContractEvent)
func (*FakeKContext) AddResourceUsed ¶
func (c *FakeKContext) AddResourceUsed(delta contract.Limits)
func (*FakeKContext) Args ¶
func (c *FakeKContext) Args() map[string][]byte
func (*FakeKContext) AuthRequire ¶
func (c *FakeKContext) AuthRequire() []string
func (*FakeKContext) Caller ¶
func (c *FakeKContext) Caller() string
func (*FakeKContext) EmitAsyncTask ¶
func (c *FakeKContext) EmitAsyncTask(event string, args interface{}) error
func (*FakeKContext) Flush ¶
func (c *FakeKContext) Flush() error
func (*FakeKContext) GetAccountAddresses ¶
func (c *FakeKContext) GetAccountAddresses(accountName string) ([]string, error)
func (*FakeKContext) Initiator ¶
func (c *FakeKContext) Initiator() string
func (*FakeKContext) QueryBlock ¶
func (c *FakeKContext) QueryBlock(blockid []byte) (*xldgpb.InternalBlock, error)
func (*FakeKContext) QueryTransaction ¶
func (c *FakeKContext) QueryTransaction(txid []byte) (*pb.Transaction, error)
func (*FakeKContext) RWSet ¶
func (c *FakeKContext) RWSet() *contract.RWSet
func (*FakeKContext) ResourceLimit ¶
func (c *FakeKContext) ResourceLimit() contract.Limits
func (*FakeKContext) UTXORWSet ¶
func (c *FakeKContext) UTXORWSet() *contract.UTXORWSet
func (*FakeKContext) VerifyContractOwnerPermission ¶
func (c *FakeKContext) VerifyContractOwnerPermission(contractName string, authRequire []string) error
func (*FakeKContext) VerifyContractPermission ¶
type FakeLedger ¶
type FakeLedger struct {
// contains filtered or unexported fields
}
func NewFakeLedger ¶
func NewFakeLedger(conf []byte) *FakeLedger
func (*FakeLedger) CreateSnapshot ¶
func (l *FakeLedger) CreateSnapshot(blkId []byte) (ledger.XMReader, error)
func (*FakeLedger) GetConsensusConf ¶
func (l *FakeLedger) GetConsensusConf() ([]byte, error)
func (*FakeLedger) GetGenesisConsensusConf ¶
func (l *FakeLedger) GetGenesisConsensusConf() []byte
func (*FakeLedger) GetTipBlock ¶
func (l *FakeLedger) GetTipBlock() ledger.BlockHandle
func (*FakeLedger) GetTipSnapshot ¶
func (l *FakeLedger) GetTipSnapshot() (ledger.XMReader, error)
func (*FakeLedger) GetTipXMSnapshotReader ¶
func (l *FakeLedger) GetTipXMSnapshotReader() (ledger.XMSnapshotReader, error)
func (*FakeLedger) Put ¶
func (l *FakeLedger) Put(block *FakeBlock) error
func (*FakeLedger) QueryBlockHeader ¶ added in v1.0.2
func (l *FakeLedger) QueryBlockHeader(blockId []byte) (ledger.BlockHandle, error)
func (*FakeLedger) QueryBlockHeaderByHeight ¶ added in v1.0.2
func (l *FakeLedger) QueryBlockHeaderByHeight(height int64) (ledger.BlockHandle, error)
func (*FakeLedger) QueryTipBlockHeader ¶ added in v1.0.2
func (l *FakeLedger) QueryTipBlockHeader() ledger.BlockHandle
func (*FakeLedger) SetConsensusStorage ¶
func (l *FakeLedger) SetConsensusStorage(height int, s []byte)
func (*FakeLedger) SetSnapshot ¶
func (l *FakeLedger) SetSnapshot(bucket string, key []byte, value []byte)
func (*FakeLedger) VerifyMerkle ¶
func (l *FakeLedger) VerifyMerkle(context.BlockInterface) error
type FakeManager ¶
type FakeManager struct {
R *FakeRegistry
}
func (*FakeManager) GetKernRegistry ¶
func (m *FakeManager) GetKernRegistry() contract.KernRegistry
func (*FakeManager) NewContext ¶
func (m *FakeManager) NewContext(cfg *contract.ContextConfig) (contract.Context, error)
func (*FakeManager) NewStateSandbox ¶
func (m *FakeManager) NewStateSandbox(cfg *contract.SandboxConfig) (contract.StateSandbox, error)
type FakeMeta ¶
type FakeMeta struct {
// contains filtered or unexported fields
}
func (*FakeMeta) GetTipBlockid ¶
func (*FakeMeta) GetTrunkHeight ¶
type FakeP2p ¶
type FakeP2p struct{}
func (*FakeP2p) GetCurrentPeerAddress ¶
func (*FakeP2p) GetLocalAccount ¶
type FakeRegistry ¶
type FakeRegistry struct {
M map[string]contract.KernMethod
}
func (*FakeRegistry) GetKernMethod ¶
func (r *FakeRegistry) GetKernMethod(contract, method string) (contract.KernMethod, error)
func (*FakeRegistry) RegisterKernMethod ¶
func (r *FakeRegistry) RegisterKernMethod(contract, method string, handler contract.KernMethod)
func (*FakeRegistry) RegisterShortcut ¶
func (r *FakeRegistry) RegisterShortcut(oldmethod, contract, method string)
func (*FakeRegistry) UnregisterKernMethod ¶
func (r *FakeRegistry) UnregisterKernMethod(ctract, method string)
type FakeSandBox ¶
type FakeSandBox struct {
// contains filtered or unexported fields
}
func (*FakeSandBox) SetContext ¶
func (s *FakeSandBox) SetContext(bucket string, key, value []byte)
type FakeXMReader ¶
type FakeXMReader map[string]FReaderItem
func NewFakeXMReader ¶
func NewFakeXMReader() FakeXMReader
func (FakeXMReader) Get ¶
func (r FakeXMReader) Get(bucket string, key []byte) (*ledger.VersionedData, error)
func (*FakeXMReader) Select ¶
func (r *FakeXMReader) Select(bucket string, startKey []byte, endKey []byte) (ledger.XMIterator, error)
Click to show internal directories.
Click to hide internal directories.