smartcontractdatastore

package
v0.0.0-...-4f0ab6e Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenesisPrivateKeys = privateKeys()

GenesisPrivateKeys is a map whose key is Index and value is privateKey.

View Source
var GenesisPublicKeys = publicKeys()

GenesisPublicKeys is a map whose key is Index and value is pk.

View Source
var NumberOfOutsInEachGenesisBlock = 3

NumberOfOutsInEachGenesisBlock is a int value for test.

View Source
var TotalAmountOfEachShard *big.Int

TotalAmountOfEachShard is defined as *big.Int.

Functions

func CreateDeploySmartContractGenesisOutState

func CreateDeploySmartContractGenesisOutState(shard shard.Index, txHash *chainhash.Hash) []*wire.OutState

CreateDeploySmartContractGenesisOutState creates some OutStates using shard and txHash.

func GenerateGenesisTx

func GenerateGenesisTx(shard shard.Index) *wire.MsgTx

GenerateGenesisTx returns a new instance of MsgTx using the given shardIndex.

func NewMsgTx

func NewMsgTx(version int32, shard shard.Index) *wire.MsgTx

NewMsgTx returns a new instance of MsgTx using the given version and shardIndex.

Types

type SContractDataStore

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

SContractDataStore used to store smart-contract data

func NewSmartContractDataStore

func NewSmartContractDataStore(shardIdx shard.Index) *SContractDataStore

NewSmartContractDataStore returns a new instance of smartContractDataStore.

func (*SContractDataStore) AddSmartContractInfo

func (sCDS *SContractDataStore) AddSmartContractInfo(sCInfo *wire.SmartContractInfo, root *merkle.MerkleHash) error

AddSmartContractInfo adds infos to data store

func (*SContractDataStore) GetSmartContractInfo

func (sCDS *SContractDataStore) GetSmartContractInfo(pKHash multivacaddress.PublicKeyHash) *wire.SmartContractInfo

GetSmartContractInfo 返回指定智能合约指定分片编号的SmartContractInfo

func (*SContractDataStore) RefreshDataStore

func (sCDS *SContractDataStore) RefreshDataStore(update *state.Update, actions []*wire.UpdateAction)

RefreshDataStore updates the smartContractDataStore according to the given StateUpdate and Actions.

func (*SContractDataStore) Reset

func (sCDS *SContractDataStore) Reset()

Reset sets all smartContractInfo's shard data and code data in the smartContractDataStore into null info.

type SmartContractDataStore

type SmartContractDataStore interface {
	AddSmartContractInfo(scInfo *wire.SmartContractInfo, root *merkle.MerkleHash) error
	GetSmartContractInfo(addr multivacaddress.PublicKeyHash) *wire.SmartContractInfo
	RefreshDataStore(update *state.Update, actions []*wire.UpdateAction)
	Reset()
}

SmartContractDataStore is a interface that contains some methods used for getting or updating the smart contract.

Jump to

Keyboard shortcuts

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