Documentation
¶
Index ¶
- Variables
- func Init()
- type KVRWSet
- type KVRead
- type KVWrite
- type RWSetBuilder
- func (b *RWSetBuilder) AddSupplyToken(ns string, assetId, uniqueId []byte, amt uint64, createAddr common.Address) error
- func (b *RWSetBuilder) AddToReadSet(contractId []byte, ns string, key string, version *modules.StateVersion)
- func (b *RWSetBuilder) AddToWriteSet(contractId []byte, ns string, key string, value []byte)
- func (b *RWSetBuilder) AddTokenPayOut(ns string, addr string, asset *modules.Asset, amount uint64, lockTime uint32)
- func (b *RWSetBuilder) DefineToken(ns string, tokenType int32, define []byte, createAddr common.Address)
- func (b *RWSetBuilder) GetTokenDefine(ns string) *modules.TokenDefine
- func (b *RWSetBuilder) GetTokenPayOut(ns string) []*modules.TokenPayOut
- func (b *RWSetBuilder) GetTokenSupply(ns string) []*modules.TokenSupply
- type RwSetTxMgr
- type RwSetTxSimulator
- func (s *RwSetTxSimulator) CheckDone() error
- func (s *RwSetTxSimulator) Close()
- func (s *RwSetTxSimulator) DefineToken(ns string, tokenType int32, define []byte, creator string) error
- func (s *RwSetTxSimulator) DeleteState(contractId []byte, ns string, key string) error
- func (h *RwSetTxSimulator) Done()
- func (s *RwSetTxSimulator) GetContractStatesById(contractid []byte) (map[string]*modules.ContractStateValue, error)
- func (s *RwSetTxSimulator) GetGlobalProp() ([]byte, error)
- func (s *RwSetTxSimulator) GetPayOutData(ns string) ([]*modules.TokenPayOut, error)
- func (s *RwSetTxSimulator) GetRwData(ns string) ([]*KVRead, []*KVWrite, error)
- func (s *RwSetTxSimulator) GetStableTransactionByHash(ns string, hash common.Hash) (*modules.Transaction, error)
- func (s *RwSetTxSimulator) GetStableUnit(ns string, hash common.Hash, unitNumber uint64) (*modules.Unit, error)
- func (s *RwSetTxSimulator) GetState(contractid []byte, ns string, key string) ([]byte, error)
- func (s *RwSetTxSimulator) GetStatesByPrefix(contractid []byte, ns string, prefix string) ([]*modules.KeyValue, error)
- func (s *RwSetTxSimulator) GetTimestamp(ns string, rangeNumber uint32) ([]byte, error)
- func (s *RwSetTxSimulator) GetTokenBalance(ns string, addr common.Address, asset *modules.Asset) (map[modules.Asset]uint64, error)
- func (s *RwSetTxSimulator) GetTokenDefineData(ns string) (*modules.TokenDefine, error)
- func (s *RwSetTxSimulator) GetTokenSupplyData(ns string) ([]*modules.TokenSupply, error)
- func (h *RwSetTxSimulator) GetTxSimulationResults() ([]byte, error)
- func (s *RwSetTxSimulator) PayOutToken(ns string, address string, token *modules.Asset, amount uint64, ...) error
- func (s *RwSetTxSimulator) SetState(contractId []byte, ns string, key string, value []byte) error
- func (s *RwSetTxSimulator) String() string
- func (s *RwSetTxSimulator) SupplyToken(ns string, assetId, uniqueId []byte, amt uint64, creator string) error
- type TxManager
- type TxSimulator
- type Version
- type VersionedValue
Constants ¶
This section is empty.
Variables ¶
View Source
var ChainId = "palletone"
Functions ¶
Types ¶
type KVRWSet ¶
type KVRWSet struct { Reads map[string]*KVRead `protobuf:"bytes,1,rep,name=reads" json:"reads,omitempty"` Writes map[string]*KVWrite `protobuf:"bytes,3,rep,name=writes" json:"writes,omitempty"` }
func (*KVRWSet) Descriptor ¶
func (*KVRWSet) ProtoMessage ¶
func (*KVRWSet) ProtoMessage()
type KVRead ¶
type KVRead struct { ContractId []byte `protobuf:"bytes,4,opt,name=contract_id,proto3" json:"contract_id,omitempty"` // contains filtered or unexported fields }
func NewKVRead ¶
func NewKVRead(contractId []byte, key string, version *modules.StateVersion) *KVRead
NewKVRead helps constructing proto message kvrwset.KVRead
func (*KVRead) Descriptor ¶
func (*KVRead) GetVersion ¶
func (m *KVRead) GetVersion() *modules.StateVersion
func (*KVRead) ProtoMessage ¶
func (*KVRead) ProtoMessage()
type KVWrite ¶
type KVWrite struct { ContractId []byte `protobuf:"bytes,4,opt,name=contract_id,proto3" json:"contract_id,omitempty"` // contains filtered or unexported fields }
KVWrite captures a write (update/delete) operation performed during transaction simulation
func (*KVWrite) Descriptor ¶
func (*KVWrite) GetIsDelete ¶
func (*KVWrite) ProtoMessage ¶
func (*KVWrite) ProtoMessage()
type RWSetBuilder ¶
type RWSetBuilder struct {
// contains filtered or unexported fields
}
func NewRWSetBuilder ¶
func NewRWSetBuilder() *RWSetBuilder
func (*RWSetBuilder) AddSupplyToken ¶
func (*RWSetBuilder) AddToReadSet ¶
func (b *RWSetBuilder) AddToReadSet(contractId []byte, ns string, key string, version *modules.StateVersion)
func (*RWSetBuilder) AddToWriteSet ¶
func (b *RWSetBuilder) AddToWriteSet(contractId []byte, ns string, key string, value []byte)
func (*RWSetBuilder) AddTokenPayOut ¶
func (*RWSetBuilder) DefineToken ¶
func (*RWSetBuilder) GetTokenDefine ¶
func (b *RWSetBuilder) GetTokenDefine(ns string) *modules.TokenDefine
func (*RWSetBuilder) GetTokenPayOut ¶
func (b *RWSetBuilder) GetTokenPayOut(ns string) []*modules.TokenPayOut
func (*RWSetBuilder) GetTokenSupply ¶
func (b *RWSetBuilder) GetTokenSupply(ns string) []*modules.TokenSupply
type RwSetTxMgr ¶
type RwSetTxMgr struct {
// contains filtered or unexported fields
}
var RwM *RwSetTxMgr
func NewRwSetMgr ¶
func NewRwSetMgr(name string) (*RwSetTxMgr, error)
func (*RwSetTxMgr) BaseTxSim ¶
func (m *RwSetTxMgr) BaseTxSim() map[string]TxSimulator
func (*RwSetTxMgr) Close ¶
func (m *RwSetTxMgr) Close()
func (*RwSetTxMgr) CloseTxSimulator ¶
func (m *RwSetTxMgr) CloseTxSimulator(chainid, txid string) error
每次产块结束后,需要关闭该chainId的txsimulator.
func (*RwSetTxMgr) NewTxSimulator ¶
func (m *RwSetTxMgr) NewTxSimulator(idag dag.IDag, chainid string, txid string, is_sys bool) (TxSimulator, error)
NewTxSimulator implements method in interface `txmgmt.TxMgr`
type RwSetTxSimulator ¶
type RwSetTxSimulator struct {
// contains filtered or unexported fields
}
func NewBasedTxSimulator ¶
func NewBasedTxSimulator(idag dag.IDag, hash common.Hash) *RwSetTxSimulator
func (*RwSetTxSimulator) CheckDone ¶
func (s *RwSetTxSimulator) CheckDone() error
func (*RwSetTxSimulator) Close ¶
func (s *RwSetTxSimulator) Close()
func (*RwSetTxSimulator) DefineToken ¶
func (*RwSetTxSimulator) DeleteState ¶
func (s *RwSetTxSimulator) DeleteState(contractId []byte, ns string, key string) error
DeleteState implements method in interface `ledger.TxSimulator`
func (*RwSetTxSimulator) Done ¶
func (h *RwSetTxSimulator) Done()
func (*RwSetTxSimulator) GetContractStatesById ¶
func (s *RwSetTxSimulator) GetContractStatesById(contractid []byte) (map[string]*modules.ContractStateValue, error)
get all dag
func (*RwSetTxSimulator) GetGlobalProp ¶ added in v1.0.2
func (s *RwSetTxSimulator) GetGlobalProp() ([]byte, error)
func (*RwSetTxSimulator) GetPayOutData ¶
func (s *RwSetTxSimulator) GetPayOutData(ns string) ([]*modules.TokenPayOut, error)
func (*RwSetTxSimulator) GetRwData ¶
func (s *RwSetTxSimulator) GetRwData(ns string) ([]*KVRead, []*KVWrite, error)
func (*RwSetTxSimulator) GetStableTransactionByHash ¶ added in v1.0.5
func (s *RwSetTxSimulator) GetStableTransactionByHash(ns string, hash common.Hash) (*modules.Transaction, error)
func (*RwSetTxSimulator) GetStableUnit ¶ added in v1.0.5
func (*RwSetTxSimulator) GetStatesByPrefix ¶
func (*RwSetTxSimulator) GetTimestamp ¶
func (s *RwSetTxSimulator) GetTimestamp(ns string, rangeNumber uint32) ([]byte, error)
GetState implements method in interface `ledger.TxSimulator`
func (*RwSetTxSimulator) GetTokenBalance ¶
func (*RwSetTxSimulator) GetTokenDefineData ¶
func (s *RwSetTxSimulator) GetTokenDefineData(ns string) (*modules.TokenDefine, error)
func (*RwSetTxSimulator) GetTokenSupplyData ¶
func (s *RwSetTxSimulator) GetTokenSupplyData(ns string) ([]*modules.TokenSupply, error)
func (*RwSetTxSimulator) GetTxSimulationResults ¶
func (h *RwSetTxSimulator) GetTxSimulationResults() ([]byte, error)
func (*RwSetTxSimulator) PayOutToken ¶
func (*RwSetTxSimulator) String ¶
func (s *RwSetTxSimulator) String() string
func (*RwSetTxSimulator) SupplyToken ¶
type TxSimulator ¶
type TxSimulator interface { GetState(contractid []byte, ns string, key string) ([]byte, error) GetStatesByPrefix(contractid []byte, ns string, prefix string) ([]*modules.KeyValue, error) GetTimestamp(ns string, rangeNumber uint32) ([]byte, error) SetState(contractid []byte, ns string, key string, value []byte) error GetTokenBalance(ns string, addr common.Address, asset *modules.Asset) (map[modules.Asset]uint64, error) GetStableTransactionByHash(ns string, hash common.Hash) (*modules.Transaction, error) GetStableUnit(ns string, hash common.Hash, unitNumber uint64) (*modules.Unit, error) PayOutToken(ns string, address string, token *modules.Asset, amount uint64, lockTime uint32) error DefineToken(ns string, tokenType int32, define []byte, creator string) error SupplyToken(ns string, assetId, uniqueId []byte, amt uint64, creator string) error DeleteState(contractid []byte, ns string, key string) error GetContractStatesById(contractid []byte) (map[string]*modules.ContractStateValue, error) GetRwData(ns string) ([]*KVRead, []*KVWrite, error) GetPayOutData(ns string) ([]*modules.TokenPayOut, error) GetTokenDefineData(ns string) (*modules.TokenDefine, error) GetTokenSupplyData(ns string) ([]*modules.TokenSupply, error) GetTxSimulationResults() ([]byte, error) CheckDone() error Done() String() string //GetChainParameters() ([]byte, error) GetGlobalProp() ([]byte, error) }
type VersionedValue ¶
Click to show internal directories.
Click to hide internal directories.