rpc: fix getstateheight result compatibility

C#:
   "result" : {
      "localrootindex" : 11623,
      "validatedrootindex" : 11623
   }

Go:
   "result" : {
      "blockHeight" : 11627,
      "stateHeight" : 11627
   }
This commit is contained in:
Roman Khimov 2021-07-22 19:55:41 +03:00
parent a8a6c8c13d
commit a188d20fd1
3 changed files with 6 additions and 6 deletions

View file

@ -10,8 +10,8 @@ import (
// StateHeight is a result of getstateheight RPC. // StateHeight is a result of getstateheight RPC.
type StateHeight struct { type StateHeight struct {
BlockHeight uint32 `json:"blockHeight"` Local uint32 `json:"localrootindex"`
StateHeight uint32 `json:"stateHeight"` Validated uint32 `json:"validatedrootindex"`
} }
// ProofWithKey represens key-proof pair. // ProofWithKey represens key-proof pair.

View file

@ -969,8 +969,8 @@ func (s *Server) getStateHeight(_ request.Params) (interface{}, *response.Error)
stateHeight = height - 1 stateHeight = height - 1
} }
return &result.StateHeight{ return &result.StateHeight{
BlockHeight: height, Local: height,
StateHeight: stateHeight, Validated: stateHeight,
}, nil }, nil
} }

View file

@ -324,8 +324,8 @@ var rpcTestCases = map[string][]rpcTestCase{
sh, ok := res.(*result.StateHeight) sh, ok := res.(*result.StateHeight)
require.True(t, ok) require.True(t, ok)
require.Equal(t, e.chain.BlockHeight(), sh.BlockHeight) require.Equal(t, e.chain.BlockHeight(), sh.Local)
require.Equal(t, uint32(0), sh.StateHeight) require.Equal(t, uint32(0), sh.Validated)
}, },
}, },
}, },