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

Allow for runtime methods interleave #5005

Merged
merged 1 commit into from
Jul 1, 2022
Merged

Conversation

jacogr
Copy link
Member

@jacogr jacogr commented Jul 1, 2022

Last missing part of #4930, allowing for runtime to be specified in the typesBundle.

Tested with -

const api = await ApiPromise.create({
  provider: new WsProvider('wss://kusama-rpc.polkadot.io'),
  runtime: {
    GrandpaApi: [
      {
        methods: {
          test: {
            description: 'Get current GRANDPA authority set id.',
            params: [],
            type: 'SetId'
          }
        },
        version: 3
      }
    ]
  },
  typesBundle: {
    spec: {
      kusama: {
        runtime: {
          GrandpaApi: [
            {
              methods: {
                current_set_id: {
                  description: 'Get current GRANDPA authority set id.',
                  params: [
                    {
                      name: 'foo',
                      type: 'bool'
                    },
                    {
                      name: 'bar',
                      type: 'bool'
                    }
                  ],
                  type: 'SetId'
                }
              },
              version: 3
            }
          ]
        }
      }
    }
  }
});

The above allows for an additional GranpaApi_test and changes GrandpaApi_current_set_id to take 2 arguments.

@jacogr jacogr added the -auto label Jul 1, 2022
@polkadot-js-bot polkadot-js-bot merged commit 5a1598a into master Jul 1, 2022
@polkadot-js-bot polkadot-js-bot deleted the jg-runtime-interleave branch July 1, 2022 06:58
@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 Jul 3, 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.

2 participants