rwset

package
v0.0.0-...-84a2c7a Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChainId = "palletone"

Functions

func Init

func Init()

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) Descriptor() ([]byte, []int)

func (*KVRWSet) GetReads

func (m *KVRWSet) GetReads() map[string]*KVRead

func (*KVRWSet) GetWrites

func (m *KVRWSet) GetWrites() map[string]*KVWrite

func (*KVRWSet) ProtoMessage

func (*KVRWSet) ProtoMessage()

func (*KVRWSet) Reset

func (m *KVRWSet) Reset()

func (*KVRWSet) String

func (m *KVRWSet) String() string

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) Descriptor() ([]byte, []int)

func (*KVRead) GetKey

func (m *KVRead) GetKey() string

func (*KVRead) GetValue

func (m *KVRead) GetValue() []byte

func (*KVRead) GetVersion

func (m *KVRead) GetVersion() *modules.StateVersion

func (*KVRead) ProtoMessage

func (*KVRead) ProtoMessage()

func (*KVRead) Reset

func (m *KVRead) Reset()

func (*KVRead) String

func (m *KVRead) String() string

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) Descriptor() ([]byte, []int)

func (*KVWrite) GetIsDelete

func (m *KVWrite) GetIsDelete() bool

func (*KVWrite) GetKey

func (m *KVWrite) GetKey() string

func (*KVWrite) GetValue

func (m *KVWrite) GetValue() []byte

func (*KVWrite) ProtoMessage

func (*KVWrite) ProtoMessage()

func (*KVWrite) Reset

func (m *KVWrite) Reset()

func (*KVWrite) String

func (m *KVWrite) String() string

type RWSetBuilder

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

func NewRWSetBuilder

func NewRWSetBuilder() *RWSetBuilder

func (*RWSetBuilder) AddSupplyToken

func (b *RWSetBuilder) AddSupplyToken(ns string, assetId, uniqueId []byte, amt uint64,
	createAddr common.Address) error

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 (b *RWSetBuilder) AddTokenPayOut(ns string, addr string, asset *modules.Asset, amount uint64, lockTime uint32)

func (*RWSetBuilder) DefineToken

func (b *RWSetBuilder) DefineToken(ns string, tokenType int32, define []byte, createAddr common.Address)

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 (s *RwSetTxSimulator) DefineToken(ns string, tokenType int32, define []byte, creator string) error

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

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

func (s *RwSetTxSimulator) GetStableTransactionByHash(ns string, hash common.Hash) (*modules.Transaction, error)

func (*RwSetTxSimulator) GetStableUnit

func (s *RwSetTxSimulator) GetStableUnit(ns string, hash common.Hash, unitNumber uint64) (*modules.Unit, error)

func (*RwSetTxSimulator) GetState

func (s *RwSetTxSimulator) GetState(contractid []byte, ns string, key string) ([]byte, error)

GetState implements method in interface `ledger.TxSimulator`

func (*RwSetTxSimulator) GetStatesByPrefix

func (s *RwSetTxSimulator) GetStatesByPrefix(contractid []byte, ns string, prefix string) ([]*modules.KeyValue, error)

func (*RwSetTxSimulator) GetTimestamp

func (s *RwSetTxSimulator) GetTimestamp(ns string, rangeNumber uint32) ([]byte, error)

GetState implements method in interface `ledger.TxSimulator`

func (*RwSetTxSimulator) GetTokenBalance

func (s *RwSetTxSimulator) GetTokenBalance(ns string, addr common.Address, asset *modules.Asset) (
	map[modules.Asset]uint64, error)

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 (s *RwSetTxSimulator) PayOutToken(ns string, address string, token *modules.Asset, amount uint64,
	lockTime uint32) error

func (*RwSetTxSimulator) SetState

func (s *RwSetTxSimulator) SetState(contractId []byte, ns string, key string, value []byte) error

func (*RwSetTxSimulator) String

func (s *RwSetTxSimulator) String() string

func (*RwSetTxSimulator) SupplyToken

func (s *RwSetTxSimulator) SupplyToken(ns string, assetId, uniqueId []byte, amt uint64, creator string) error

type TxManager

type TxManager interface {
	Close()
	CloseTxSimulator(chainid, txid string) error
	NewTxSimulator(idag dag.IDag, chainid string, txid string, is_sys bool) (TxSimulator, error)
}

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 Version

type Version struct {
}

type VersionedValue

type VersionedValue struct {
	Value   []byte
	Version *Version
}

Jump to

Keyboard shortcuts

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