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

Add deprecated flag to RPCs #5244

Merged
merged 2 commits into from
Sep 28, 2022
Merged

Add deprecated flag to RPCs #5244

merged 2 commits into from
Sep 28, 2022

Conversation

jacogr
Copy link
Member

@jacogr jacogr commented Sep 28, 2022

Closes #5241

Adds the @deprecated flag to both the metadata generation as well as the TS interfaces.

However with TS augmentation this is not prefect and there is (currently) no way to make it perfect, the levers that we are able to pull is correct for the specific generation, aka

      /**
       * @deprecated Use `api.rpc.state.getKeysPaged` to retrieve keys
       * Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)
       **/
      getPairs: AugmentedRpc<(prefix: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<KeyValue>>>;

As an example of non-perfectness in VSCode -

image

However when going to the specific endpoint, it does highlight as deprecated -

image

As well as -

image

The first one should mark as striked in the editor as well as having the correct bubble as per the last 2.

@jacogr jacogr added the -auto label Sep 28, 2022
@polkadot-js-bot polkadot-js-bot merged commit a92bfca into master Sep 28, 2022
@polkadot-js-bot polkadot-js-bot deleted the jg-rpc-deprecated branch September 28, 2022 05:14
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add & typegen deprecation flag for RPCs
2 participants