From 6c68da7a527eaefe77ffbf097243b5441a11e6ef Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 19 Sep 2022 22:54:09 +0300 Subject: [PATCH] rpcsrv: add block 20 hash comparison test Makes updating it somewhat easier. --- pkg/services/rpcsrv/server_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/services/rpcsrv/server_test.go b/pkg/services/rpcsrv/server_test.go index bae68f8d0..2d854c221 100644 --- a/pkg/services/rpcsrv/server_test.go +++ b/pkg/services/rpcsrv/server_test.go @@ -2069,6 +2069,15 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) [] } t.Run("ByHeight", func(t *testing.T) { testRoot(t, strconv.FormatInt(5, 10)) }) t.Run("ByHash", func(t *testing.T) { testRoot(t, `"`+chain.GetHeaderHash(5).StringLE()+`"`) }) + t.Run("20", func(t *testing.T) { + rpc := `{"jsonrpc": "2.0", "id": 1, "method": "getstateroot", "params": [20]}` + body := doRPCCall(rpc, httpSrv.URL, t) + rawRes := checkErrGetResult(t, body, false) + + res := &state.MPTRoot{} + require.NoError(t, json.Unmarshal(rawRes, res)) + require.Equal(t, block20StateRootLE, res.Root.StringLE()) + }) }) t.Run("getstate", func(t *testing.T) { testGetState := func(t *testing.T, p string, expected string) {