Skip to content

Commit

Permalink
fix!: metadata updates, change documentation to docs (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul committed Jul 20, 2021
1 parent 5f98eb4 commit 7942cd3
Show file tree
Hide file tree
Showing 11 changed files with 1,751 additions and 1,754 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ All the commits in this repo follow the [Conventional Commits spec](https://www.
- @polkadot/util-crypto [release notes](https://github.com/polkadot-js/common/releases)
- @substrate/calc [npm release page](https://www.npmjs.com/package/@substrate/calc)

1. Next make sure to update the resolutions inside of the `package.json` to match polkadot-js [here](https://github.com/polkadot-js/apps/blob/master/package.json). This is a manual process, and the packages we want to update are only the ones with `@polkadot` appended to it.
1. Next make sure the resolutions are up to date inside of the `package.json` to match polkadot-js [here](https://github.com/polkadot-js/apps/blob/master/package.json). This is a manual process, and the packages we want to update are only the ones with `@polkadot` appended to it. If any issues may surface, contact the maintainers.

1. After updating the dependencies and resolutions, the next step is making sure the release will work against all relevant runtimes for Polkadot, Kusama, and Westend. This can be handled by running `yarn test:init-e2e-tests`. You must have `python3`, and the dependencies inside of `./scripts/requirements.txt` installed to run the script (Read the [README](./scripts/README.md) for more instructions). Before moving forward ensure all tests pass, and if it warns of any missing types feel free to make an issue [here](https://github.com/paritytech/substrate-api-sidecar/issues).
1. After updating the dependencies and resolutions (if applicable), the next step is making sure the release will work against all relevant runtimes for Polkadot, Kusama, and Westend. This can be handled by running `yarn test:init-e2e-tests`. You must have `python3`, and the dependencies inside of `./scripts/requirements.txt` installed to run the script (Read the [README](./scripts/README.md) for more instructions). Before moving forward ensure all tests pass, and if it warns of any missing types feel free to make an issue [here](https://github.com/paritytech/substrate-api-sidecar/issues).

Note that the e2e tests will connect to running nodes in order to test sidecar against real data, and they may fail owing to those connections taking too long to establish. If you run into any failures, try running tests just for the chain that failed with something like `yarn test:init-e2e-tests:polkadot`.

Expand Down
2 changes: 1 addition & 1 deletion docs/dist/app.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/openapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2175,7 +2175,7 @@ components:
fallback:
type: string
example: "0x00"
documentation:
docs:
type: string
example: " Information concerning any given referendum.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
description: Metadata of a storage item from a FRAME pallet.
Expand Down
1,580 changes: 790 additions & 790 deletions docs/yarn.lock

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
"test:init-e2e-tests:westend": "python3 ./scripts/run_chain_tests.py --chain westend"
},
"dependencies": {
"@polkadot/api": "^5.0.1",
"@polkadot/apps-config": "0.94.2-72",
"@polkadot/util-crypto": "^7.0.1",
"@polkadot/api": "^5.1.1",
"@polkadot/apps-config": "0.94.2-79",
"@polkadot/util-crypto": "^7.0.2",
"@polkadot/x-rxjs": "^6.11.1",
"@substrate/calc": "^0.2.1",
"@substrate/calc": "^0.2.2",
"confmgr": "^1.0.6",
"express": "^4.17.1",
"express-winston": "^4.1.0",
Expand All @@ -71,15 +71,15 @@
"tsc-watch": "^4.4.0"
},
"resolutions": {
"@polkadot/api": "^5.0.1",
"@polkadot/api-contract": "^5.0.1",
"@polkadot/hw-ledger": "^7.0.1",
"@polkadot/keyring": "^7.0.1",
"@polkadot/networks": "^7.0.1",
"@polkadot/phishing": "^0.6.222",
"@polkadot/types": "^5.0.1",
"@polkadot/util": "^7.0.1",
"@polkadot/util-crypto": "^7.0.1",
"@polkadot/api": "^5.1.1",
"@polkadot/api-contract": "^5.1.1",
"@polkadot/hw-ledger": "^7.0.2",
"@polkadot/keyring": "^7.0.2",
"@polkadot/networks": "^7.0.2",
"@polkadot/phishing": "^0.6.231",
"@polkadot/types": "^5.1.1",
"@polkadot/util": "^7.0.2",
"@polkadot/util-crypto": "^7.0.2",
"@polkadot/wasm-crypto": "^4.1.2",
"node-forge": ">=0.10.0",
"node-fetch": ">=2.6.1",
Expand Down
6 changes: 2 additions & 4 deletions src/services/blocks/BlocksService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class BlocksService extends AbstractService {
// we set to false if !isSigned because unsigned never pays a fee
paysFee: isSigned ? null : false,
docs: extrinsicDocs
? this.sanitizeDocs(extrinsic.meta.documentation)
? this.sanitizeDocs(extrinsic.meta.docs)
: undefined,
};
});
Expand Down Expand Up @@ -384,9 +384,7 @@ export class BlocksService extends AbstractService {
method: event.method,
},
data: event.data,
docs: eventDocs
? this.sanitizeDocs(event.data.meta.documentation)
: undefined,
docs: eventDocs ? this.sanitizeDocs(event.data.meta.docs) : undefined,
};

if (phase.isApplyExtrinsic) {
Expand Down
4 changes: 1 addition & 3 deletions src/services/pallets/PalletsStorageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ export class PalletsStorageService extends AbstractService {
storageItemMeta
) as unknown as ISanitizedStorageItemMetadata;

normalizedStorageItemMeta.documentation = this.sanitizeDocs(
storageItemMeta.documentation
);
normalizedStorageItemMeta.docs = this.sanitizeDocs(storageItemMeta.docs);

return normalizedStorageItemMeta;
}
Expand Down
28 changes: 14 additions & 14 deletions src/services/test-helpers/responses/pallets/fetchStorage789629.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"plain": "PropIndex"
},
"fallback": "0x00000000",
"documentation": " The number of (public) proposals that have been made so far."
"docs": " The number of (public) proposals that have been made so far."
},
{
"name": "PublicProps",
Expand All @@ -22,7 +22,7 @@
"plain": "Vec<(PropIndex,Hash,AccountId)>"
},
"fallback": "0x00",
"documentation": " The public proposals. Unsorted. The second item is the proposal's hash."
"docs": " The public proposals. Unsorted. The second item is the proposal's hash."
},
{
"name": "DepositOf",
Expand All @@ -36,7 +36,7 @@
}
},
"fallback": "0x00",
"documentation": " Those who have locked a deposit.\n\n TWOX-NOTE: Safe, as increasing integer keys are safe."
"docs": " Those who have locked a deposit.\n\n TWOX-NOTE: Safe, as increasing integer keys are safe."
},
{
"name": "Preimages",
Expand All @@ -50,7 +50,7 @@
}
},
"fallback": "0x00",
"documentation": " Map of hashes to the proposal preimage, along with who registered it and their deposit.\n The block number is the block at which it was deposited."
"docs": " Map of hashes to the proposal preimage, along with who registered it and their deposit.\n The block number is the block at which it was deposited."
},
{
"name": "ReferendumCount",
Expand All @@ -59,7 +59,7 @@
"plain": "ReferendumIndex"
},
"fallback": "0x00000000",
"documentation": " The next free referendum index, aka the number of referenda started so far."
"docs": " The next free referendum index, aka the number of referenda started so far."
},
{
"name": "LowestUnbaked",
Expand All @@ -68,7 +68,7 @@
"plain": "ReferendumIndex"
},
"fallback": "0x00000000",
"documentation": " The lowest referendum index representing an unbaked referendum. Equal to\n `ReferendumCount` if there isn't a unbaked referendum."
"docs": " The lowest referendum index representing an unbaked referendum. Equal to\n `ReferendumCount` if there isn't a unbaked referendum."
},
{
"name": "ReferendumInfoOf",
Expand All @@ -82,7 +82,7 @@
}
},
"fallback": "0x00",
"documentation": " Information concerning any given referendum.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
"docs": " Information concerning any given referendum.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
},
{
"name": "VotingOf",
Expand All @@ -96,7 +96,7 @@
}
},
"fallback": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"documentation": " All votes for a particular voter. We store the balance for the number of votes that we\n have recorded. The second item is the total amount of delegations, that will be added.\n\n TWOX-NOTE: SAFE as `AccountId`s are crypto hashes anyway."
"docs": " All votes for a particular voter. We store the balance for the number of votes that we\n have recorded. The second item is the total amount of delegations, that will be added.\n\n TWOX-NOTE: SAFE as `AccountId`s are crypto hashes anyway."
},
{
"name": "Locks",
Expand All @@ -110,7 +110,7 @@
}
},
"fallback": "0x00",
"documentation": " Accounts for which there are locks in action which may be removed at some point in the\n future. The value is the block number at which the lock expires and may be removed.\n\n TWOX-NOTE: OK ― `AccountId` is a secure hash."
"docs": " Accounts for which there are locks in action which may be removed at some point in the\n future. The value is the block number at which the lock expires and may be removed.\n\n TWOX-NOTE: OK ― `AccountId` is a secure hash."
},
{
"name": "LastTabledWasExternal",
Expand All @@ -119,7 +119,7 @@
"plain": "bool"
},
"fallback": "0x00",
"documentation": " True if the last referendum tabled was submitted externally. False if it was a public\n proposal."
"docs": " True if the last referendum tabled was submitted externally. False if it was a public\n proposal."
},
{
"name": "NextExternal",
Expand All @@ -128,7 +128,7 @@
"plain": "(Hash,VoteThreshold)"
},
"fallback": "0x00",
"documentation": " The referendum to be tabled whenever it would be valid to table an external proposal.\n This happens when a referendum needs to be tabled and one of two conditions are met:\n - `LastTabledWasExternal` is `false`; or\n - `PublicProps` is empty."
"docs": " The referendum to be tabled whenever it would be valid to table an external proposal.\n This happens when a referendum needs to be tabled and one of two conditions are met:\n - `LastTabledWasExternal` is `false`; or\n - `PublicProps` is empty."
},
{
"name": "Blacklist",
Expand All @@ -142,7 +142,7 @@
}
},
"fallback": "0x00",
"documentation": " A record of who vetoed what. Maps proposal hash to a possible existent block number\n (until when it may not be resubmitted) and who vetoed it."
"docs": " A record of who vetoed what. Maps proposal hash to a possible existent block number\n (until when it may not be resubmitted) and who vetoed it."
},
{
"name": "Cancellations",
Expand All @@ -156,7 +156,7 @@
}
},
"fallback": "0x00",
"documentation": " Record of all proposals that have been subject to emergency cancellation."
"docs": " Record of all proposals that have been subject to emergency cancellation."
},
{
"name": "StorageVersion",
Expand All @@ -165,7 +165,7 @@
"plain": "Releases"
},
"fallback": "0x00",
"documentation": " Storage version of the pallet.\n\n New networks start with last version."
"docs": " Storage version of the pallet.\n\n New networks start with last version."
}
]
}
Loading

0 comments on commit 7942cd3

Please sign in to comment.