rpc: allow to invoke getapplicationlog with block hash

Support retrieving native contract persist results by block hash.
All necessary support is already here, just add test.
This commit is contained in:
Evgenii Stratonikov 2020-06-18 23:09:24 +03:00
parent a980cac0b3
commit 3a0be5ce28

View file

@ -823,6 +823,16 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) []
}) })
} }
t.Run("getapplicationlog for block", func(t *testing.T) {
rpc := `{"jsonrpc": "2.0", "id": 1, "method": "getapplicationlog", "params": ["%s"]}`
body := doRPCCall(fmt.Sprintf(rpc, e.chain.GetHeaderHash(1).StringLE()), httpSrv.URL, t)
data := checkErrGetResult(t, body, false)
var res result.ApplicationLog
require.NoError(t, json.Unmarshal(data, &res))
require.Equal(t, "System", res.Trigger)
require.Equal(t, "HALT", res.VMState)
})
t.Run("submit", func(t *testing.T) { t.Run("submit", func(t *testing.T) {
rpc := `{"jsonrpc": "2.0", "id": 1, "method": "submitblock", "params": ["%s"]}` rpc := `{"jsonrpc": "2.0", "id": 1, "method": "submitblock", "params": ["%s"]}`
t.Run("invalid signature", func(t *testing.T) { t.Run("invalid signature", func(t *testing.T) {