• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revision3fa10c81be9d571f14821525167c9a9664a23332 (tree)
Time2019-07-11 11:43:17
AuthorChengcheng Zhang <943420582@qq.c...>
CommiterChengcheng Zhang

Log Message

update getExternalDefinition

Change Summary

Incremental Difference

--- a/wallet/annotated.go
+++ b/wallet/annotated.go
@@ -16,8 +16,6 @@ import (
1616 "github.com/vapor/protocol/bc/types"
1717 )
1818
19-var ZeroAssetID = new(bc.AssetID)
20-
2119 // annotateTxs adds asset data to transactions
2220 func annotateTxsAsset(w *Wallet, txs []*query.AnnotatedTx) {
2321 for i, tx := range txs {
@@ -34,7 +32,7 @@ func annotateTxsAsset(w *Wallet, txs []*query.AnnotatedTx) {
3432
3533 func (w *Wallet) getExternalDefinition(assetID *bc.AssetID) json.RawMessage {
3634 externalAsset, err := w.Store.GetAsset(assetID)
37- if err != nil && assetID.String() != ZeroAssetID.String() {
35+ if err != nil {
3836 log.WithFields(log.Fields{"module": logModule, "err": err, "assetID": assetID.String()}).Info("fail on get asset definition.")
3937 }
4038 if externalAsset == nil {
@@ -146,6 +144,8 @@ func (w *Wallet) BuildAnnotatedInput(tx *types.Tx, i uint32) *query.AnnotatedInp
146144 if orig.InputType() != types.CoinbaseInputType {
147145 in.AssetID = orig.AssetID()
148146 in.Amount = orig.Amount()
147+ } else {
148+ in.AssetID = *consensus.BTMAssetID
149149 }
150150
151151 id := tx.Tx.InputIDs[i]
Show on old repository browser