• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版c0dec37312c3f1953a1df48c0e970bcf78bb6032 (tree)
时间2019-06-20 12:17:01
作者Chengcheng Zhang <943420582@qq.c...>
CommiterChengcheng Zhang

Log Message

add wallet DB interface

更改概述

差异

--- a/wallet/annotated.go
+++ b/wallet/annotated.go
@@ -33,6 +33,7 @@ func annotateTxsAsset(w *Wallet, txs []*query.AnnotatedTx) {
3333 }
3434
3535 func (w *Wallet) getExternalDefinition(assetID *bc.AssetID) json.RawMessage {
36+ // definitionByte := w.DB.GetAssetDefinitionByAssetID(assetID) will replace next line
3637 definitionByte := w.DB.Get(asset.ExtAssetKey(assetID))
3738 if definitionByte == nil {
3839 return nil
--- /dev/null
+++ b/wallet/store.go
@@ -0,0 +1,13 @@
1+package wallet
2+
3+import (
4+ "github.com/vapor/common"
5+ "github.com/vapor/protocol/bc"
6+)
7+
8+// DB interface contains wallet storage functions.
9+type DB interface {
10+ GetAssetDefinitionByAssetID(*bc.AssetID) []byte
11+ GetRawProgramByAccountHash(common.Hash) []byte
12+ GetAccountValueByAccountID(string) []byte
13+}
Show on old repository browser