1

An error occurred: 'Expected 2 arguments for the contract message 'vote', but only 1 was provided.First argument was number type, and the second one was Enum . This error arises when attempting to pass two values, one being a number and the other a string, which are not accepted by the Astar chain.

I have used it.

  const { gasRequired, result } = await contract?.query?.vote(
    {
      gasLimit: gasLimit,
    },
    12892,
    "noDiscrepancies"
  );
  console.log("gasRequired", gasRequired, result);

Here is the ABI :

"label": "vote",
        "mutates": true,
        "payable": false,
        "returnType": {
          "displayName": [
            "ink",
            "MessageResult"
          ],
          "type": 17
        },
        "selector": "0x083be260"
      },
      {
        "args": [
          {
            "label": "_vote_id",
            "type": {
              "displayName": [
                "u32"
              ],
              "type": 0
            }
          }
        ],
        "default": false, 

1 Answer 1

2

I doesn't seem that the error is a chain related. It will behave the same on any other parachain.

You need to provide origin (caller address) to the call.

const { gasRequired, result } = await contract?.query?.vote(
    callerAddress,
    {
      gasLimit: gasLimit,
    },
    12892,
    "noDiscrepancies"
  );

Your Answer

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

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