localAccount := account.Account{}
sha3pool.Sum256(hash[:], program)
- rawProgram := store.GetRawProgramByHash(hash)
+ rawProgram := store.GetRawProgram(hash)
if rawProgram == nil {
return nil, fmt.Errorf("failed get account control program:%x ", hash)
}
var hash [32]byte
sha3pool.Sum256(hash[:], v.ControlProgram())
- if bytes := w.store.GetRawProgramByHash(hash); bytes != nil {
+ if bytes := w.store.GetRawProgram(hash); bytes != nil {
annotatedTxs = append(annotatedTxs, w.buildAnnotatedTransaction(tx, b, statusFail, pos))
continue transactionLoop
}
type Store interface {
GetAssetDefinition(*bc.AssetID) []byte
SetAssetDefinition(*bc.AssetID, []byte)
- GetRawProgramByHash(common.Hash) []byte
+ GetRawProgram(common.Hash) []byte
GetAccount(string) []byte
DeleteTransaction(uint64)
SetTransaction(uint64, uint32, string, []byte)
store.DB.Set(asset.ExtAssetKey(assetID), definition)
}
-// GetRawProgramByHash get raw program by hash
-func (store *LevelDBStore) GetRawProgramByHash(hash common.Hash) []byte {
+// GetRawProgram get raw program by hash
+func (store *LevelDBStore) GetRawProgram(hash common.Hash) []byte {
return store.DB.Get(account.ContractKey(hash))
}
for _, v := range tx.Outputs {
var hash [32]byte
sha3pool.Sum256(hash[:], v.ControlProgram())
- if bytes := w.store.GetRawProgramByHash(hash); bytes != nil {
+ if bytes := w.store.GetRawProgram(hash); bytes != nil {
return true
}
}
var hash [32]byte
sha3pool.Sum256(hash[:], []byte(s))
- data := w.store.GetRawProgramByHash(hash)
+ data := w.store.GetRawProgram(hash)
if data == nil {
continue
}