Skip to content

Commit

Permalink
fixed GetTransactionResults bug.
Browse files Browse the repository at this point in the history
bug: GetTransactionResults() will return assets only occured in output.

pass the version to payload, and payload can decide how to Deserialize.

Signed-off-by: luodanwg <[email protected]>
  • Loading branch information
Arbio5zt authored and dreamfly281 committed Jul 28, 2017
1 parent 6bd4f3b commit b0225d8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/transaction/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,12 @@ func (tx *Transaction) GetTransactionResults() (TransactionResult, error) {
if inputValue, ok := InputResult[outputAssetid]; ok {
result[outputAssetid] = inputValue - outputValue
} else {
result[outputAssetid] = outputValue * Fixed64(-1)
result[outputAssetid] -= outputValue
}
}
for inputAssetid, inputValue := range InputResult {
if _, exist := result[inputAssetid]; !exist {
result[inputAssetid] += inputValue
}
}
return result, nil
Expand Down

0 comments on commit b0225d8

Please sign in to comment.