interlay / interbtc-api

interBTC TypeScript SDK

Home Page:https://app.interlay.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Runtime call is not available in your environment

gregdhill opened this issue · comments

Describe the bug
A recent parachain update changed the supported runtime-api version for transactionPaymentApi.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://kintnet.interlay.io/btc
  2. Type a number in the input box
  3. See error

https://github.com/polkadot-js/api/blob/319535a1e938e89522ff18ef2d1cef66a5af597c/packages/api/src/submittable/createClass.ts#L134

Expected behavior
The root error should be resolved by this upgrade or we can hard-code the definition here:

return ApiPromise.create({
    provider, types, rpc, noInitWarn: noInitWarn || true, runtime: {
        TransactionPaymentApi: [
            {
                methods: {
                    queryInfo: {
                        description: 'Retrieves the fee information for an encoded extrinsic',
                        params: [
                            {
                                name: 'uxt',
                                type: 'Extrinsic'
                            },
                            {
                                name: 'len',
                                type: 'u32'
                            }
                        ],
                        type: 'RuntimeDispatchInfo'
                    }
                },
                version: 4
            }
        ]
    }
});

Additional context
We should also test our usage of transactionPaymentApi.queryInfo to catch failures in CI early when we upgrade the node.

Additional context
We should also test our usage of transactionPaymentApi.queryInfo to catch failures in CI early when we upgrade the node.

Added separate critical issue to add tests here: #675