rpc/server: implement getstateheight RPC
This commit is contained in:
parent
53dc7f27b6
commit
fe8038e8b7
3 changed files with 31 additions and 0 deletions
|
@ -214,6 +214,21 @@ var rpcTestCases = map[string][]rpcTestCase{
|
|||
},
|
||||
},
|
||||
},
|
||||
"getstateheight": {
|
||||
{
|
||||
name: "positive",
|
||||
params: `[]`,
|
||||
result: func(_ *executor) interface{} { return new(result.StateHeight) },
|
||||
check: func(t *testing.T, e *executor, res interface{}) {
|
||||
sh, ok := res.(*result.StateHeight)
|
||||
require.True(t, ok)
|
||||
|
||||
h := e.chain.BlockHeight()
|
||||
require.Equal(t, h, sh.BlockHeight)
|
||||
require.Equal(t, h, sh.StateHeight)
|
||||
},
|
||||
},
|
||||
},
|
||||
"getstateroot": {
|
||||
{
|
||||
name: "no params",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue