0

From the contracts pallet:

        /// A new schedule must have a greater version than the current one.
        InvalidScheduleVersion,

The context of this error is sending batch transactions from polkadot-js.

api.tx.utility.batchAll(txs)

Presumably these are being scheduled using the schedule pallet?

I'm using the substrate-contracts-node 0.23.0-430873a4fbe

6
  • This error does nothing in the latest code. What's your Substrate version? Jan 30, 2023 at 9:33
  • I found this: github.com/paritytech/substrate/blame/… Jan 30, 2023 at 9:34
  • Thanks, I'm using substrate-contracts-node 0.23.0-ac615c91892
    – forgetso
    Jan 30, 2023 at 10:25
  • Sorry that was wrong. I'm on the most recent substrate-contracts-node 0.23.0-430873a4fbe
    – forgetso
    Jan 30, 2023 at 10:50
  • The raw error data is { Module: { index: '19', error: '0x02000000' } }. Do you know where I can find the corresponding error the substrate code?
    – forgetso
    Jan 31, 2023 at 12:30

1 Answer 1

0

This is an issue in the translation of the error data to the error message when using the following findMetaError from polkadot-js.

const mod = dispatchError.asModule
const error = this.api.registry.findMetaError(
    new Uint8Array([mod.index.toNumber(), new BN(mod.error).toNumber()])
)

Because the hexadecimal mod.error is 0x02000000, the decimal representation of this is 33554432, which is not one of the indices in the pallet contracts errors (search for 523 in this file).

Presumably, the hexadecimal used to index should have been 0x02, which converts to index 2 and OutOfGas.

> util.bnFromHex('0x02000000').toNumber()
33554432
> util.bnFromHex('0x02').toNumber()
2
  {
    "id": 523,
    "type": {
      "path": [
        "pallet_contracts",
        "pallet",
        "Error"
      ],
      "params": [
        {
          "name": "T",
          "type": null
        }
      ],
      "def": {
        "variant": {
          "variants": [

            ...

            {
              "name": "OutOfGas",
              "fields": [],
              "index": 2,
              "docs": [
                "The executed contract exhausted its gas limit."
              ]
            },

EDIT: it looks like the additional bytes can include error details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.