Skip to content

Commit

Permalink
Add returned transaction id to Deposit struct (#42)
Browse files Browse the repository at this point in the history
* Add returned transaction id to Deposit struct

* rename TxId to TxID

* Use binance example transaction id instead of text

* use actual tx id in assertion

* Replace transaction id with field name
  • Loading branch information
jeremyhahn authored and adshao committed Apr 3, 2018
1 parent 573065e commit 9db9d99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions deposit_service.go
Expand Up @@ -84,4 +84,5 @@ type Deposit struct {
Amount float64 `json:"amount"`
Asset string `json:"asset"`
Status int `json:"status"`
TxID string `json:"txId"`
}
5 changes: 4 additions & 1 deletion deposit_service_test.go
Expand Up @@ -22,7 +22,8 @@ func (s *depositServiceTestSuite) TestListDeposits() {
"insertTime": 1508198532000,
"amount": 0.04670582,
"asset": "ETH",
"status": 1
"status": 1,
"TxID": "b3c6219639c8ae3f9cf010cdc24fw7f7yt8j1e063f9b4bd1a05cb44c4b6e2509"
}
],
"success": true
Expand All @@ -49,6 +50,7 @@ func (s *depositServiceTestSuite) TestListDeposits() {
Amount: 0.04670582,
Asset: "ETH",
Status: 1,
TxID: "b3c6219639c8ae3f9cf010cdc24fw7f7yt8j1e063f9b4bd1a05cb44c4b6e2509",
}
s.assertDepositEqual(e, deposits[0])
}
Expand All @@ -59,4 +61,5 @@ func (s *depositServiceTestSuite) assertDepositEqual(e, a *Deposit) {
r.Equal(e.Asset, a.Asset, "Asset")
r.InDelta(e.Amount, a.Amount, 0.0000000001, "Amount")
r.Equal(e.Status, a.Status, "Status")
r.Equal(e.TxID, a.TxID, "TxID")
}

0 comments on commit 9db9d99

Please sign in to comment.