interlay / interbtc-api

interBTC TypeScript SDK
https://app.interlay.io/
Apache License 2.0
26 stars 20 forks source link

Runtime call is not available in your environment #673

Closed gregdhill closed 1 year ago

gregdhill commented 1 year ago

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.

bvotteler commented 1 year ago

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: https://github.com/interlay/interbtc-api/issues/675