Skip to content

Commit ad3df4b

Browse files
authored
Merge pull request #107 from MinterTeam/dev
Add Code and Log fields in transaction api
2 parents 3be4dc0 + 37d2eb3 commit ad3df4b

5 files changed

Lines changed: 19 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.3.5
4+
*Sept 13th, 2018*
5+
6+
IMPROVEMENT
7+
8+
- [api] Add Code and Log fields in transaction api
9+
310
## 0.3.4
411
*Sept 13th, 2018*
512

api/block.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ type BlockTransactionResponse struct {
4242
GasCoin types.CoinSymbol `json:"gas_coin"`
4343
GasUsed int64 `json:"gas_used"`
4444
Tags map[string]string `json:"tags"`
45+
Code uint32 `json:"code,omitempty"`
46+
Log string `json:"log,omitempty"`
4547
}
4648

4749
func Block(w http.ResponseWriter, r *http.Request) {
@@ -90,6 +92,8 @@ func Block(w http.ResponseWriter, r *http.Request) {
9092
GasCoin: tx.GasCoin,
9193
GasUsed: blockResults.Results.DeliverTx[i].GasUsed,
9294
Tags: tags,
95+
Code: blockResults.Results.DeliverTx[i].Code,
96+
Log: blockResults.Results.DeliverTx[i].Log,
9397
}
9498
}
9599

api/transaction.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ func Transaction(w http.ResponseWriter, r *http.Request) {
5757
Data: decodedTx.GetDecodedData(),
5858
Payload: decodedTx.Payload,
5959
Tags: tags,
60+
Code: tx.TxResult.Code,
61+
Log: tx.TxResult.Log,
6062
},
6163
})
6264

api/transactions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ type TransactionResponse struct {
2525
Data transaction.Data `json:"data"`
2626
Payload []byte `json:"payload"`
2727
Tags map[string]string `json:"tags"`
28+
Code uint32 `json:"code,omitempty"`
29+
Log string `json:"log,omitempty"`
2830
}
2931

3032
type ResultTxSearch struct {
@@ -77,6 +79,8 @@ func Transactions(w http.ResponseWriter, r *http.Request) {
7779
Data: decodedTx.GetDecodedData(),
7880
Payload: decodedTx.Payload,
7981
Tags: tags,
82+
Code: tx.TxResult.Code,
83+
Log: tx.TxResult.Log,
8084
}
8185
}
8286

version/version.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ package version
44
const (
55
Maj = "0"
66
Min = "3"
7-
Fix = "4"
7+
Fix = "5"
88
)
99

1010
var (
1111
// Must be a string because scripts like dist.sh read this file.
12-
Version = "0.3.4"
12+
Version = "0.3.5"
1313

1414
// GitCommit is the current HEAD set using ldflags.
1515
GitCommit string

0 commit comments

Comments
 (0)