From ab5eff620b6cb864eda721989a075f60befc0b29 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 5 Aug 2020 18:15:29 +0300 Subject: [PATCH] rpc: use lowercase JSON field names for StateHeight Follow neo-project/neo#1808. Note that this is an incompatible change, but this feature is still considered to be experimental upstream. --- pkg/rpc/client/rpc_test.go | 2 +- pkg/rpc/response/result/mpt.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/rpc/client/rpc_test.go b/pkg/rpc/client/rpc_test.go index d7e1437f1..f23f3c64f 100644 --- a/pkg/rpc/client/rpc_test.go +++ b/pkg/rpc/client/rpc_test.go @@ -626,7 +626,7 @@ var rpcClientTestCases = map[string][]rpcClientTestCase{ invoke: func(c *Client) (interface{}, error) { return c.GetStateHeight() }, - serverResponse: `{"id":1,"jsonrpc":"2.0","result":{"blockHeight":208,"stateHeight":200}}`, + serverResponse: `{"id":1,"jsonrpc":"2.0","result":{"blockheight":208,"stateheight":200}}`, result: func(c *Client) interface{} { return &result.StateHeight{ BlockHeight: 208, diff --git a/pkg/rpc/response/result/mpt.go b/pkg/rpc/response/result/mpt.go index 10ef7e8c3..794693a8e 100644 --- a/pkg/rpc/response/result/mpt.go +++ b/pkg/rpc/response/result/mpt.go @@ -11,8 +11,8 @@ import ( // StateHeight is a result of getstateheight RPC. type StateHeight struct { - BlockHeight uint32 `json:"blockHeight"` - StateHeight uint32 `json:"stateHeight"` + BlockHeight uint32 `json:"blockheight"` + StateHeight uint32 `json:"stateheight"` } // ProofWithKey represens key-proof pair.