Skip to content

Commit 54d4127

Browse files
abuilesbartekn
authored andcommitted
Use snake_case for claim predicate JSON fields. (#3086)
1 parent 8535626 commit 54d4127

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: services/horizon/internal/resourceadapter/operations_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ func TestPopulateOperation_CreateClaimableBalance(t *testing.T) {
143143
"and": [
144144
{
145145
"or": [
146-
{"relBefore":"12"},
147-
{"absBefore": "2020-08-26T11:15:39Z"}
146+
{"rel_before":"12"},
147+
{"abs_before": "2020-08-26T11:15:39Z"}
148148
]
149149
},
150150
{

Diff for: xdr/json.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ type claimPredicateJSON struct {
1111
Or *[]claimPredicateJSON `json:"or,omitempty"`
1212
Not *claimPredicateJSON `json:"not,omitempty"`
1313
Unconditional bool `json:"unconditional,omitempty"`
14-
AbsBefore *time.Time `json:"absBefore,omitempty"`
15-
RelBefore *int64 `json:"relBefore,string,omitempty"`
14+
AbsBefore *time.Time `json:"abs_before,omitempty"`
15+
RelBefore *int64 `json:"rel_before,string,omitempty"`
1616
}
1717

1818
func convertPredicatesToXDR(input []claimPredicateJSON) ([]ClaimPredicate, error) {

Diff for: xdr/json_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestClaimPredicateJSON(t *testing.T) {
4141
assert.NoError(t, err)
4242
assert.JSONEq(
4343
t,
44-
`{"and":[{"or":[{"relBefore":"12"},{"absBefore":"2020-08-26T11:15:39Z"}]},{"not":{"unconditional":true}}]}`,
44+
`{"and":[{"or":[{"rel_before":"12"},{"abs_before":"2020-08-26T11:15:39Z"}]},{"not":{"unconditional":true}}]}`,
4545
string(serialized),
4646
)
4747

0 commit comments

Comments
 (0)