Pass empty params as null (#115)

This commit is contained in:
Jaco Greeff
2018-07-22 12:12:37 +02:00
committed by GitHub
parent 6d8ab1b4b9
commit b60a3f3cc0
6 changed files with 66 additions and 64 deletions
+4 -4
View File
@@ -35,9 +35,9 @@
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.51",
"@polkadot/jsonrpc": "^0.26.21",
"@polkadot/primitives": "^0.26.21",
"@polkadot/util": "^0.26.21",
"@polkadot/util-keyring": "^0.26.21"
"@polkadot/jsonrpc": "^0.26.22",
"@polkadot/primitives": "^0.26.22",
"@polkadot/util": "^0.26.22",
"@polkadot/util-keyring": "^0.26.22"
}
}
+4 -4
View File
@@ -39,10 +39,10 @@
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.51",
"@polkadot/storage": "^0.26.21",
"@polkadot/util": "^0.26.21",
"@polkadot/util-crypto": "^0.26.21",
"@polkadot/util-keyring": "^0.26.21",
"@polkadot/storage": "^0.26.22",
"@polkadot/util": "^0.26.22",
"@polkadot/util-crypto": "^0.26.22",
"@polkadot/util-keyring": "^0.26.22",
"@types/nock": "^9.1.3",
"eventemitter3": "^2.0.3",
"isomorphic-fetch": "^2.2.1",
@@ -10,6 +10,8 @@ export default function encodeObject (self: RpcCoderState, method: string, param
id: ++self.id,
jsonrpc: '2.0',
method,
params
params: params && params.length
? params
: null
};
}
+1 -1
View File
@@ -9,7 +9,7 @@ export type JsonRpcObject = {
export type JsonRpcRequest = JsonRpcObject & {
method: string;
params: Array<any>;
params: Array<any> | null;
};
export type JsonRpcResponseBase$Error = {
+3 -3
View File
@@ -37,8 +37,8 @@
"@babel/runtime": "^7.0.0-beta.51",
"@polkadot/api-format": "^0.14.19",
"@polkadot/api-provider": "^0.14.19",
"@polkadot/jsonrpc": "^0.26.21",
"@polkadot/params": "^0.26.21",
"@polkadot/util": "^0.26.21"
"@polkadot/jsonrpc": "^0.26.22",
"@polkadot/params": "^0.26.22",
"@polkadot/util": "^0.26.22"
}
}