Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
"test": "jest --coverage"
},
"devDependencies": {
"@polkadot/dev": "^0.20.25",
"@polkadot/dev": "^0.20.26",
"@polkadot/ts": "^0.1.30"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/ExtrinsicStatus.spec.js
Expand Up @@ -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', () => {
Expand Down
1 change: 0 additions & 1 deletion packages/types/src/Header.only.json

This file was deleted.

4 changes: 2 additions & 2 deletions packages/types/src/Header.spec.js
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/RuntimeVersion.spec.js
Expand Up @@ -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', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/SignedBlock.spec.js
Expand Up @@ -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', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/json/Header.001.json
@@ -0,0 +1 @@
{"jsonrpc":"2.0","result":{"digest":{"logs":[]},"extrinsicsRoot":"0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0","number":0,"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x294c3470ae3be7555240b9d034ec19c3715ba2c3f20b92441f8cea0cab66ab56"},"id":1}
Copy link
Member Author

@jacogr jacogr Oct 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was edited a bit for structure, i.e. it was turned it into a valid rpc json response (header wrapped in "result", "jsonrpc" & "id" added), hence not being a straight rename like the others. The actual data we are interested though is exactly the same.

6 changes: 3 additions & 3 deletions yarn.lock
Expand Up @@ -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"
Expand Down