Skip to content

Commit

Permalink
tests(e2e): add /runtime/* endpoints (#674)
Browse files Browse the repository at this point in the history
* fix: add e2e for kusama

* fix: add runtime for polkadot endpoints

* fix: grumbles

* fix: add runtime response types

* fix: add RuntimeResponse type (typecast)

* boilerplate for westend

* add runtime endpoints for westend

* lint
  • Loading branch information
TarikGul committed Sep 21, 2021
1 parent 770ba1d commit ddb8e45
Show file tree
Hide file tree
Showing 42 changed files with 60,071 additions and 3 deletions.
2 changes: 2 additions & 0 deletions e2e-tests/endpoints/kusama/index.ts
@@ -1,7 +1,9 @@
import { kusamaAccountsEndpoints } from './accounts';
import { kusamaBlockEndpoints } from './blocks';
import { kusamaRuntimeEndpoints } from './runtime';

export const kusamaEndpoints = {
blocks: kusamaBlockEndpoints,
accounts: kusamaAccountsEndpoints,
runtime: kusamaRuntimeEndpoints,
};
7 changes: 7 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/code/10000.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/code/8000000.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/code/index.ts
@@ -0,0 +1,7 @@
import runtimeCode10000 from './10000.json';
import runtimeCode8000000 from './8000000.json';

export const kusamaRuntimeCodeEndpoints = [
['/runtime/code?at=10000', JSON.stringify(runtimeCode10000)], // v1020
['/runtime/code?at=8000000', JSON.stringify(runtimeCode8000000)], // v9040
];
9 changes: 9 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/index.ts
@@ -0,0 +1,9 @@
import { kusamaRuntimeCodeEndpoints } from './code';
import { kusamaRuntimeMetadataEndpoints } from './metadata';
import { kusamaRuntimeSpecEndpoints } from './spec';

export const kusamaRuntimeEndpoints = [
...kusamaRuntimeCodeEndpoints,
...kusamaRuntimeSpecEndpoints,
...kusamaRuntimeMetadataEndpoints,
];
5,287 changes: 5,287 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/metadata/10000.json

Large diffs are not rendered by default.

16,158 changes: 16,158 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/metadata/8000000.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/metadata/index.ts
@@ -0,0 +1,7 @@
import runtimeMetadata10000 from './10000.json';
import runtimeMetadata8000000 from './8000000.json';

export const kusamaRuntimeMetadataEndpoints = [
['/runtime/metadata?at=10000', JSON.stringify(runtimeMetadata10000)], // v1020
['/runtime/metadata?at=8000000', JSON.stringify(runtimeMetadata8000000)], // v9040
];
23 changes: 23 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/spec/10000.json
@@ -0,0 +1,23 @@
{
"at": {
"height": "10000",
"hash": "0xae327b35880aa9d028370f063e4c4d666f6bad89800dd979ca8b9dbf064393d0"
},
"authoringVersion": "2",
"transactionVersion": "1",
"implVersion": "0",
"specName": "kusama",
"specVersion": "1020",
"chainType": {
"live": null
},
"properties": {
"ss58Format": "2",
"tokenDecimals": [
"12"
],
"tokenSymbol": [
"KSM"
]
}
}
23 changes: 23 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/spec/100000.json
@@ -0,0 +1,23 @@
{
"at": {
"height": "100000",
"hash": "0x1075af4efd73cbd97097c98f3cc2428007e5887692fc127830f4c31158ec5568"
},
"authoringVersion": "2",
"transactionVersion": "1",
"implVersion": "0",
"specName": "kusama",
"specVersion": "1028",
"chainType": {
"live": null
},
"properties": {
"ss58Format": "2",
"tokenDecimals": [
"12"
],
"tokenSymbol": [
"KSM"
]
}
}
23 changes: 23 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/spec/2000000.json
@@ -0,0 +1,23 @@
{
"at": {
"height": "2000000",
"hash": "0xef974e0539043e34b2a953f6ac8b1cc0c5d38ba420fa9dff4116d5ce4a2238a8"
},
"authoringVersion": "2",
"transactionVersion": "1",
"implVersion": "1",
"specName": "kusama",
"specVersion": "1055",
"chainType": {
"live": null
},
"properties": {
"ss58Format": "2",
"tokenDecimals": [
"12"
],
"tokenSymbol": [
"KSM"
]
}
}
23 changes: 23 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/spec/4000000.json
@@ -0,0 +1,23 @@
{
"at": {
"height": "4000000",
"hash": "0xd712539168bc16205d429eaccd2c0c24b879624c0727e0a6a8d326dde80af87b"
},
"authoringVersion": "2",
"transactionVersion": "3",
"implVersion": "0",
"specName": "kusama",
"specVersion": "2023",
"chainType": {
"live": null
},
"properties": {
"ss58Format": "2",
"tokenDecimals": [
"12"
],
"tokenSymbol": [
"KSM"
]
}
}
23 changes: 23 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/spec/8000000.json
@@ -0,0 +1,23 @@
{
"at": {
"height": "8000000",
"hash": "0xe3a79b3c656f0d7d6b6b6c3105575b937f8324e6c1f36a27ab97b8f897cb2b8e"
},
"authoringVersion": "2",
"transactionVersion": "5",
"implVersion": "0",
"specName": "kusama",
"specVersion": "9040",
"chainType": {
"live": null
},
"properties": {
"ss58Format": "2",
"tokenDecimals": [
"12"
],
"tokenSymbol": [
"KSM"
]
}
}
13 changes: 13 additions & 0 deletions e2e-tests/endpoints/kusama/runtime/spec/index.ts
@@ -0,0 +1,13 @@
import runtimeSpec10000 from './10000.json';
import runtimeSpec100000 from './100000.json';
import runtimeSpec2000000 from './2000000.json';
import runtimeSpec4000000 from './4000000.json';
import runtimeSpec8000000 from './8000000.json';

export const kusamaRuntimeSpecEndpoints = [
['/runtime/spec?at=10000', JSON.stringify(runtimeSpec10000)], // v1020
['/runtime/spec?at=100000', JSON.stringify(runtimeSpec100000)], // v1028
['/runtime/spec?at=2000000', JSON.stringify(runtimeSpec2000000)], // v1055
['/runtime/spec?at=4000000', JSON.stringify(runtimeSpec4000000)], // v2023
['/runtime/spec?at=8000000', JSON.stringify(runtimeSpec8000000)], // v9040
];
2 changes: 2 additions & 0 deletions e2e-tests/endpoints/polkadot/index.ts
@@ -1,7 +1,9 @@
import { polkadotAccountsEndpoints } from './accounts';
import { polkadotBlockEndpoints } from './blocks';
import { polkadotRuntimeEndpoints } from './runtime';

export const polkadotEndpoints = {
blocks: polkadotBlockEndpoints,
accounts: polkadotAccountsEndpoints,
runtime: polkadotRuntimeEndpoints,
};
7 changes: 7 additions & 0 deletions e2e-tests/endpoints/polkadot/runtime/code/100000.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions e2e-tests/endpoints/polkadot/runtime/code/6877002.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions e2e-tests/endpoints/polkadot/runtime/code/index.ts
@@ -0,0 +1,7 @@
import runtimeCode10000 from './100000.json';
import runtimeCode6877002 from './6877002.json';

export const polkadotRuntimeCodeEndpoints = [
['/runtime/code?at=100000', JSON.stringify(runtimeCode10000)], // v1
['/runtime/code?at=6877002', JSON.stringify(runtimeCode6877002)], // v9090
];
9 changes: 9 additions & 0 deletions e2e-tests/endpoints/polkadot/runtime/index.ts
@@ -0,0 +1,9 @@
import { polkadotRuntimeCodeEndpoints } from './code';
import { polkadotRuntimeMetadataEndpoints } from './metadata';
import { polkadotRuntimeSpecEndpoints } from './spec';

export const polkadotRuntimeEndpoints = [
...polkadotRuntimeCodeEndpoints,
...polkadotRuntimeSpecEndpoints,
...polkadotRuntimeMetadataEndpoints,
];

0 comments on commit ddb8e45

Please sign in to comment.