OSDN Git Service
(root)
/
bytom
/
vapor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
586a9e3
)
modify list transaction
v0.1_vote_list_transaction
author
mars
<mars@bytom.io>
Mon, 3 Jun 2019 07:09:52 +0000
(15:09 +0800)
committer
mars
<mars@bytom.io>
Mon, 3 Jun 2019 07:09:52 +0000
(15:09 +0800)
blockchain/query/annotated.go
patch
|
blob
|
history
wallet/annotated.go
patch
|
blob
|
history
diff --git
a/blockchain/query/annotated.go
b/blockchain/query/annotated.go
index
1696b0e
..
2b1894a
100644
(file)
--- a/
blockchain/query/annotated.go
+++ b/
blockchain/query/annotated.go
@@
-53,6
+53,7
@@
type AnnotatedOutput struct {
AccountAlias string `json:"account_alias,omitempty"`
ControlProgram chainjson.HexBytes `json:"control_program"`
Address string `json:"address,omitempty"`
AccountAlias string `json:"account_alias,omitempty"`
ControlProgram chainjson.HexBytes `json:"control_program"`
Address string `json:"address,omitempty"`
+ Vote chainjson.HexBytes `json:"vote,omitempty"`
}
//AnnotatedAccount means an annotated account.
}
//AnnotatedAccount means an annotated account.
diff --git
a/wallet/annotated.go
b/wallet/annotated.go
index
5696e34
..
e4a4976
100644
(file)
--- a/
wallet/annotated.go
+++ b/
wallet/annotated.go
@@
-16,7
+16,6
@@
import (
dbm "github.com/vapor/database/leveldb"
"github.com/vapor/protocol/bc"
"github.com/vapor/protocol/bc/types"
dbm "github.com/vapor/database/leveldb"
"github.com/vapor/protocol/bc"
"github.com/vapor/protocol/bc/types"
- "github.com/vapor/protocol/vm/vmutil"
)
// annotateTxs adds asset data to transactions
)
// annotateTxs adds asset data to transactions
@@
-248,10
+247,15
@@
func (w *Wallet) BuildAnnotatedOutput(tx *types.Tx, idx int) *query.AnnotatedOut
Address: w.getAddressFromControlProgram(orig.ControlProgram()),
}
Address: w.getAddressFromControlProgram(orig.ControlProgram()),
}
- if vmutil.IsUnspendable(out.ControlProgram) {
- out.Type = "retire"
- } else {
+ switch e := tx.Entries[*outid].(type) {
+ case *bc.IntraChainOutput:
out.Type = "control"
out.Type = "control"
+ case *bc.CrossChainOutput:
+ out.Type = "cross_Output"
+ case *bc.VoteOutput:
+ out.Type = "vote"
+ out.Vote = e.Vote
}
}
+
return out
}
return out
}