Documentation ¶
Index ¶
- Variables
- func CreateDeploySmartContractGenesisOutState(shard shard.Index, txHash *chainhash.Hash) []*wire.OutState
- func GenerateGenesisTx(shard shard.Index) *wire.MsgTx
- func NewMsgTx(version int32, shard shard.Index) *wire.MsgTx
- type SContractDataStore
- func (sCDS *SContractDataStore) AddSmartContractInfo(sCInfo *wire.SmartContractInfo, root *merkle.MerkleHash) error
- func (sCDS *SContractDataStore) GetSmartContractInfo(pKHash multivacaddress.PublicKeyHash) *wire.SmartContractInfo
- func (sCDS *SContractDataStore) RefreshDataStore(update *state.Update, actions []*wire.UpdateAction)
- func (sCDS *SContractDataStore) Reset()
- type SmartContractDataStore
Constants ¶
This section is empty.
Variables ¶
var GenesisPrivateKeys = privateKeys()
GenesisPrivateKeys is a map whose key is Index and value is privateKey.
var GenesisPublicKeys = publicKeys()
GenesisPublicKeys is a map whose key is Index and value is pk.
var NumberOfOutsInEachGenesisBlock = 3
NumberOfOutsInEachGenesisBlock is a int value for test.
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 ¶
GenerateGenesisTx returns a new instance of MsgTx using the given 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.