• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revisione282f43ba31da597b375c3d7d2e61b3f2fbcbd98 (tree)
Time2019-06-03 16:09:52
Authormars <mars@byto...>
Commitermars

Log Message

modify list transaction

Change Summary

Incremental Difference

--- a/blockchain/query/annotated.go
+++ b/blockchain/query/annotated.go
@@ -53,6 +53,7 @@ type AnnotatedOutput struct {
5353 AccountAlias string `json:"account_alias,omitempty"`
5454 ControlProgram chainjson.HexBytes `json:"control_program"`
5555 Address string `json:"address,omitempty"`
56+ Vote chainjson.HexBytes `json:"vote,omitempty"`
5657 }
5758
5859 //AnnotatedAccount means an annotated account.
--- a/wallet/annotated.go
+++ b/wallet/annotated.go
@@ -16,7 +16,6 @@ import (
1616 dbm "github.com/vapor/database/leveldb"
1717 "github.com/vapor/protocol/bc"
1818 "github.com/vapor/protocol/bc/types"
19- "github.com/vapor/protocol/vm/vmutil"
2019 )
2120
2221 // annotateTxs adds asset data to transactions
@@ -248,10 +247,15 @@ func (w *Wallet) BuildAnnotatedOutput(tx *types.Tx, idx int) *query.AnnotatedOut
248247 Address: w.getAddressFromControlProgram(orig.ControlProgram()),
249248 }
250249
251- if vmutil.IsUnspendable(out.ControlProgram) {
252- out.Type = "retire"
253- } else {
250+ switch e := tx.Entries[*outid].(type) {
251+ case *bc.IntraChainOutput:
254252 out.Type = "control"
253+ case *bc.CrossChainOutput:
254+ out.Type = "cross_Output"
255+ case *bc.VoteOutput:
256+ out.Type = "vote"
257+ out.Vote = e.Vote
255258 }
259+
256260 return out
257261 }
Show on old repository browser