rpc: add invokescript tests

This commit is contained in:
Roman Khimov 2019-11-26 13:24:49 +03:00
parent cf39171485
commit 1c883cc819

View file

@ -280,6 +280,35 @@ var rpcTestCases = map[string][]rpcTestCase{
fail: true,
},
},
"invokescript": {
{
name: "positive",
params: `["51c56b0d48656c6c6f2c20776f726c6421680f4e656f2e52756e74696d652e4c6f67616c7566"]`,
result: func(e *executor) interface{} { return &InvokeFunctionResponse{} },
check: func(t *testing.T, e *executor, result interface{}) {
res, ok := result.(*InvokeFunctionResponse)
require.True(t, ok)
assert.NotEqual(t, "", res.Result.Script)
assert.NotEqual(t, "", res.Result.State)
assert.NotEqual(t, 0, res.Result.GasConsumed)
},
},
{
name: "no params",
params: `[]`,
fail: true,
},
{
name: "not a string",
params: `[42]`,
fail: true,
},
{
name: "bas string",
params: `["qwerty"]`,
fail: true,
},
},
"sendrawtransaction": {
{
name: "positive",