Cleanup jsonrpc, refer to api-codec (#174)

* Cleanup jsonrpc, refer to api-codec

* Move storagekey legacy into type-params (legacy)

* Remove misplaced debug log

* Remove header encoding, use api-codec/Header

* Remove legacy types

* Add metadat array (hack around json import)

* Move json metadata to ts
This commit is contained in:
Jaco Greeff
2018-09-28 18:35:39 +02:00
committed by GitHub
parent 62ed0a7b3f
commit b3a95b58ed
29 changed files with 282 additions and 263 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -4
View File
@@ -3,13 +3,11 @@
// of the ISC license. See the LICENSE file for details.
import Metadata from './Metadata';
import rpcdata from './Metadata.rpc.json';
import rpcdata from './Metadata.rpc';
describe('Metadata', () => {
it('decodes properly', () => {
const decoded = new Metadata().fromJSON(
rpcdata.result
);
const decoded = new Metadata().fromJSON(rpcdata);
const str = JSON.stringify(decoded.toJSON());
+3
View File
@@ -3,6 +3,7 @@
// of the ISC license. See the LICENSE file for details.
import BN from 'bn.js';
import * as Classes from './index';
import U8a from './codec/U8a';
import UInt from './codec/UInt';
@@ -10,3 +11,5 @@ import UInt from './codec/UInt';
export type AnyNumber = UInt | BN | Uint8Array | number | string;
export type AnyU8a = U8a | Uint8Array | Array<number> | string;
export type CodecTypes = keyof typeof Classes;