Skip to content

Commit

Permalink
Marshall int64 MaxFee and FeeCharged fields as JSON strings
Browse files Browse the repository at this point in the history
Javascript does not support 64 bit integers so to represent 64 bit values we need to represent them as strings.
  • Loading branch information
tamirms committed May 5, 2020
1 parent 7c4596d commit 65c8fc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
28 changes: 11 additions & 17 deletions protocols/horizon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,23 +436,17 @@ type Transaction struct {
// When TransactionSuccess is removed from the SDKs we can remove this HAL link
Transaction hal.Link `json:"transaction"`
} `json:"_links"`
ID string `json:"id"`
PT string `json:"paging_token"`
Successful bool `json:"successful"`
Hash string `json:"hash"`
Ledger int32 `json:"ledger"`
LedgerCloseTime time.Time `json:"created_at"`
Account string `json:"source_account"`
AccountSequence string `json:"source_account_sequence"`
FeeAccount string `json:"fee_account"`
// Action needed in release: horizon-v1.3.0
// set json tag to `json:"fee_charged,string"` so max_fee can be marshalled
// as a string in the JSON response
FeeCharged int64 `json:"fee_charged"`
// Action needed in release: horizon-v1.3.0
// set json tag to `json:"max_fee,string"` so max_fee can be marshalled
// as a string in the JSON response
MaxFee int64 `json:"max_fee"`
ID string `json:"id"`
PT string `json:"paging_token"`
Successful bool `json:"successful"`
Hash string `json:"hash"`
Ledger int32 `json:"ledger"`
LedgerCloseTime time.Time `json:"created_at"`
Account string `json:"source_account"`
AccountSequence string `json:"source_account_sequence"`
FeeAccount string `json:"fee_account"`
FeeCharged int64 `json:"fee_charged,string"`
MaxFee int64 `json:"max_fee,string"`
OperationCount int32 `json:"operation_count"`
EnvelopeXdr string `json:"envelope_xdr"`
ResultXdr string `json:"result_xdr"`
Expand Down
3 changes: 2 additions & 1 deletion services/horizon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
All notable changes to this project will be documented in this
file. This project adheres to [Semantic Versioning](http://semver.org/).

## unreleased
## v1.3.0

* Add `last_modified_time` to account responses. `last_modified_time` is the
closing time of the most recent ledger in which the account was modified.
* Fix a memory leak in the code responsible for streaming [#2548](https://github.com/stellar/go/pull/2548).
* Horizon encodes `fee_charged` and `max_fee` as strings when serializing transaction responses to JSON [#2555](https://github.com/stellar/go/pull/2555).

## v1.2.1

Expand Down

0 comments on commit 65c8fc2

Please sign in to comment.