Skip to content

Commit

Permalink
feat: add era to blocks/{blockId} response for extrinsics (#685)
Browse files Browse the repository at this point in the history
* fix: add eraInfo as a field in extrinsics response

* docs: update docs with GenericExtrinsicEra

* fix: switch eraInfo to era

* docs: update docs

* fix: refactor

* fix: lint

* fix: update mock data, and adjust unit tests

* docs: update GenericExtrinsicEra description

* Update docs/src/openapi-v1.yaml

Co-authored-by: David <dvdplm@gmail.com>

* docs: adjust docs

* tests(e2e): update kusama e2e test responses for /blocks

* tests(e2e): update the polkadot e2e tests for /blocks

* tests(e2e): update westend e2e responses for /blocks

* fix: space at end of file

Co-authored-by: David <dvdplm@gmail.com>
  • Loading branch information
TarikGul and dvdplm committed Oct 2, 2021
1 parent 701ecef commit 4362347
Show file tree
Hide file tree
Showing 50 changed files with 966 additions and 163 deletions.
2 changes: 1 addition & 1 deletion docs/dist/app.bundle.js

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions docs/src/openapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,8 @@ components:
format: hex
info:
$ref: '#/components/schemas/RuntimeDispatchInfo'
era:
$ref: '#/components/schemas/GenericExtrinsicEra'
events:
type: array
description: An array of `SanitizedEvent`s that occurred during extrinsic
Expand Down Expand Up @@ -1793,6 +1795,23 @@ components:
trieIndex:
type: string
format: unsignedInteger
GenericExtrinsicEra:
type: object
description: |
The return value for era can either be `mortalEra`, or `immortalEra` and is represented as an enum in substrate. `immortalEra` meaning
the transaction is valid forever. `mortalEra` consists of a tuple containing a period and phase.
ex: `"{"mortalEra": ["64", "11"]}"`. The Period is the period of validity from the block hash found in the signing material.
The Phase is the period that this transaction's lifetime begins (and, importantly,
implies which block hash is included in the signature material).
properties:
mortalEra:
type: array
description: Tuple of a Phase, and Period. Each item in the array will be a string formatted as an integer.
immortalEra:
type: string
description: Hardcoded constant '0x00'.
format: hex
example: "{\"mortalEra\":[\"64\", \"11\"]}"
NodeNetwork:
type: object
properties:
Expand Down
15 changes: 15 additions & 0 deletions e2e-tests/endpoints/kusama/blocks/2350438.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"tip": null,
"hash": "0x71db73f038bd790ada81a40728825857a49d543ab40c5b63de69b8588737712f",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -71,6 +74,9 @@
"tip": null,
"hash": "0x47db276250fd90bd16a5e62592531bb7f41fd0c350b3bff388d4e8accf8116c3",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -102,6 +108,9 @@
"tip": null,
"hash": "0xcf52705d1ade64fc0b05859ac28358c0770a217dd76b75e586ae848c56ae810d",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -141,6 +150,12 @@
"class": "Normal",
"partialFee": "3333333"
},
"era": {
"mortalEra": [
"64",
"33"
]
},
"events": [
{
"method": {
Expand Down
15 changes: 15 additions & 0 deletions e2e-tests/endpoints/kusama/blocks/2684767.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"tip": null,
"hash": "0xee18a23c257ad38716e6703def717f8c8c8e21449928c11b275208f49769cd7d",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -71,6 +74,9 @@
"tip": null,
"hash": "0xfc5d4843a0ac2d4b6f5ef6b7ef1644d6a3450a2dbf982a94407c6e3160daecf1",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -102,6 +108,9 @@
"tip": null,
"hash": "0xcf52705d1ade64fc0b05859ac28358c0770a217dd76b75e586ae848c56ae810d",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -141,6 +150,12 @@
"class": "Normal",
"partialFee": "3333333"
},
"era": {
"mortalEra": [
"64",
"27"
]
},
"events": [
{
"method": {
Expand Down
15 changes: 15 additions & 0 deletions e2e-tests/endpoints/kusama/blocks/2713513.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"tip": null,
"hash": "0x1d0fcc4903fe3d2c584f9f2e975c5c21fd32b56908d10931019955b2b56d224b",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -71,6 +74,9 @@
"tip": null,
"hash": "0xc03fb0c057e5fe28c50aab6fa59c86b7711eabfa20a4cd15be06a026e3ecc47f",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -102,6 +108,9 @@
"tip": null,
"hash": "0xcf52705d1ade64fc0b05859ac28358c0770a217dd76b75e586ae848c56ae810d",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -141,6 +150,12 @@
"class": "Normal",
"partialFee": "3333333"
},
"era": {
"mortalEra": [
"64",
"36"
]
},
"events": [
{
"method": {
Expand Down
15 changes: 15 additions & 0 deletions e2e-tests/endpoints/kusama/blocks/2786879.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"tip": null,
"hash": "0x468c15458fb2f543a5e5ffaabe3d91d79f17a18791d463a451990a5946cc570c",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -71,6 +74,9 @@
"tip": null,
"hash": "0x18a690c18532e3fa6992ca85c08172d6a9fad82f436e285cf247bcacbc2d409c",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -102,6 +108,9 @@
"tip": null,
"hash": "0xcf52705d1ade64fc0b05859ac28358c0770a217dd76b75e586ae848c56ae810d",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -141,6 +150,12 @@
"class": "Normal",
"partialFee": "3333333"
},
"era": {
"mortalEra": [
"64",
"59"
]
},
"events": [
{
"method": {
Expand Down
15 changes: 15 additions & 0 deletions e2e-tests/endpoints/kusama/blocks/2863649.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"tip": null,
"hash": "0x3c5c7511244a9b1f8d582b5fb9f863ebc49d177291739a840bc66b9b159bf6c7",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -71,6 +74,9 @@
"tip": null,
"hash": "0x84b6529813a13bdf98b98027be48c73c482d7f06f4d532100f2a13b719d31134",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -102,6 +108,9 @@
"tip": null,
"hash": "0xcf52705d1ade64fc0b05859ac28358c0770a217dd76b75e586ae848c56ae810d",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -141,6 +150,12 @@
"class": "Normal",
"partialFee": "51666183"
},
"era": {
"mortalEra": [
"64",
"29"
]
},
"events": [
{
"method": {
Expand Down
21 changes: 21 additions & 0 deletions e2e-tests/endpoints/kusama/blocks/3102680.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"tip": null,
"hash": "0x6cba5b154027aeb167576dc8de02f55ca380819ba105dd38ce12fb267a78a7e6",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -71,6 +74,9 @@
"tip": null,
"hash": "0xdd0205d98ee768171baea4f67233b8582ff4f82345cf768cab01cf0efb4d2253",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -102,6 +108,9 @@
"tip": null,
"hash": "0xcf52705d1ade64fc0b05859ac28358c0770a217dd76b75e586ae848c56ae810d",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -149,6 +158,12 @@
"class": "Normal",
"partialFee": "60666093"
},
"era": {
"mortalEra": [
"64",
"20"
]
},
"events": [
{
"method": {
Expand Down Expand Up @@ -229,6 +244,12 @@
"class": "Normal",
"partialFee": "51666183"
},
"era": {
"mortalEra": [
"64",
"20"
]
},
"events": [
{
"method": {
Expand Down
15 changes: 15 additions & 0 deletions e2e-tests/endpoints/kusama/blocks/3305067.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"tip": null,
"hash": "0x9044bb3d18d8da0a6a737e5cd9b6e21d5e41c3e2bfd3fb5ec0612086cb1cbf40",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -71,6 +74,9 @@
"tip": null,
"hash": "0x2c344abbc7c2db393948f1bf4781907490ff476effaec39e8f6b57a6e7bda598",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -102,6 +108,9 @@
"tip": null,
"hash": "0xcf52705d1ade64fc0b05859ac28358c0770a217dd76b75e586ae848c56ae810d",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -141,6 +150,12 @@
"class": "Normal",
"partialFee": "51999513"
},
"era": {
"mortalEra": [
"1024",
"614"
]
},
"events": [
{
"method": {
Expand Down
18 changes: 18 additions & 0 deletions e2e-tests/endpoints/kusama/blocks/3492347.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"tip": null,
"hash": "0x40067c189363edeb8628a3e6a4613dc03af856ec4c091211fbc7e79e20e93463",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -71,6 +74,9 @@
"tip": null,
"hash": "0xcf52705d1ade64fc0b05859ac28358c0770a217dd76b75e586ae848c56ae810d",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -116,6 +122,9 @@
"tip": null,
"hash": "0x4789d795f14192c690092b9ca486eb871e614970fe139b469ebeedbf9f562790",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -171,6 +180,9 @@
"tip": null,
"hash": "0x93fb128a6768df21be47b4d9b190b18f0f8607f0f21a19e486eb074ca640f008",
"info": {},
"era": {
"immortalEra": "0x00"
},
"events": [
{
"method": {
Expand Down Expand Up @@ -219,6 +231,12 @@
"class": "Normal",
"partialFee": "51666183"
},
"era": {
"mortalEra": [
"64",
"54"
]
},
"events": [
{
"method": {
Expand Down
Loading

0 comments on commit 4362347

Please sign in to comment.