rpc: add invokescript tests
This commit is contained in:
parent
cf39171485
commit
1c883cc819
1 changed files with 29 additions and 0 deletions
|
@ -280,6 +280,35 @@ var rpcTestCases = map[string][]rpcTestCase{
|
||||||
fail: true,
|
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": {
|
"sendrawtransaction": {
|
||||||
{
|
{
|
||||||
name: "positive",
|
name: "positive",
|
||||||
|
|
Loading…
Reference in a new issue