mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 11:41:48 +00:00
rpc: implement getnativecontracts
RPC
This commit is contained in:
parent
e1d2a5b5b7
commit
f0d8652bcd
6 changed files with 46 additions and 0 deletions
|
@ -552,6 +552,22 @@ var rpcTestCases = map[string][]rpcTestCase{
|
|||
},
|
||||
},
|
||||
},
|
||||
"getnativecontracts": {
|
||||
{
|
||||
params: "[]",
|
||||
result: func(e *executor) interface{} {
|
||||
return new([]state.NativeContract)
|
||||
},
|
||||
check: func(t *testing.T, e *executor, res interface{}) {
|
||||
lst := res.(*[]state.NativeContract)
|
||||
for i := range *lst {
|
||||
cs := e.chain.GetContractState((*lst)[i].Hash)
|
||||
require.NotNil(t, cs)
|
||||
require.True(t, cs.ID <= 0)
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
"getpeers": {
|
||||
{
|
||||
params: "[]",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue