Declutter types root (a bit), move *.rpc.json to json/ (#325)

* Declutter types root (a bit), move *.rpc..json to json/

* Add Metadata.001.json (BBQ)
This commit is contained in:
Jaco Greeff
2018-10-19 13:44:24 +02:00
committed by Amaury Martiny
parent 0ee7125313
commit 3e79ac57f9
14 changed files with 19 additions and 11 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
"test": "jest --coverage"
},
"devDependencies": {
"@polkadot/dev": "^0.20.25",
"@polkadot/dev": "^0.20.26",
"@polkadot/ts": "^0.1.30"
},
"dependencies": {
+1 -1
View File
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
import rpc from './ExtrinsicStatus.rpc.json';
import rpc from './json/ExtrinsicStatus.001.json';
import ExtrinsicStatus from './ExtrinsicStatus';
describe('ExtrinsicStatus', () => {
-1
View File
@@ -1 +0,0 @@
{"digest":{"logs":[]},"extrinsicsRoot":"0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0","number":0,"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x294c3470ae3be7555240b9d034ec19c3715ba2c3f20b92441f8cea0cab66ab56"}
+2 -2
View File
@@ -3,11 +3,11 @@
// of the ISC license. See the LICENSE file for details.
import Header from './Header';
import json from './Header.only.json';
import json from './json/Header.001.json';
describe('Header', () => {
it('decodes an actual JSON response', () => {
const header = new Header(json);
const header = new Header(json.result);
expect(
header.blockNumber.toNumber()
+7
View File
@@ -6,6 +6,7 @@ import { hexToU8a } from '@polkadot/util';
import Metadata from './Metadata';
import rpcdata from './Metadata.rpc';
import bbqBirch from './json/Metadata.001.json';
describe('Metadata', () => {
it('decodes properly', () => {
@@ -24,4 +25,10 @@ describe('Metadata', () => {
expect(decoded.events.length).not.toBe(0);
});
it('decodes BBQ properly', () => {
const decoded = new Metadata(bbqBirch.result);
expect(decoded.events.length).not.toBe(0);
});
});
+1 -1
View File
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
import rpc from './RuntimeVersion.rpc.json';
import rpc from './json/RuntimeVersion.001.json';
import RuntimeVersion from './RuntimeVersion';
describe('RuntimeVersion', () => {
+2 -2
View File
@@ -5,8 +5,8 @@
import extrinsics from '@polkadot/extrinsics/static';
import Method from './Method';
import events from './SignedBlock.events.json';
import rpc from './SignedBlock.rpc.json';
import rpc from './json/SignedBlock.001.json';
import events from './json/SignedBlock.002.json';
import SignedBlock from './SignedBlock';
describe('SignedBlock', () => {
+1
View File
@@ -0,0 +1 @@
{"jsonrpc":"2.0","result":{"digest":{"logs":[]},"extrinsicsRoot":"0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0","number":0,"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x294c3470ae3be7555240b9d034ec19c3715ba2c3f20b92441f8cea0cab66ab56"},"id":1}
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -1170,9 +1170,9 @@
version "1.1.0"
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.0.tgz#50c1e2260ac0ed9439a181de3725a0168d59c48a"
"@polkadot/dev@^0.20.25":
version "0.20.25"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.20.25.tgz#864cacb25c6063c7209800b83a9731bc35d4c5ea"
"@polkadot/dev@^0.20.26":
version "0.20.26"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.20.26.tgz#875dadb8ed839c56eb2ec6e3447292ecc094916c"
dependencies:
"@babel/cli" "^7.0.0"
"@babel/core" "^7.0.0"