Problem
- The following program does not work with pallet-contract "polkadot-v0.9.29".
- "polkadot-v0.9.27" in pallet-contract works as expected.
- Anyone know how to get around this issue?
Source Code
const gasLimit = 100000 * 1000000;
const storageDepositLimit = null;
const deployContract = async () => {
const { web3FromSource } = await import("@polkadot/extension-dapp");
const wsProvider = new WsProvider(blockchainUrl);
const api = await ApiPromise.create({ provider: wsProvider });
const contractWasm = contract_file.source.wasm;
const code = new CodePromise(api, abi, contractWasm);
const initValue = false;
const performingAccount = accounts[0];
const injector = await web3FromSource(performingAccount.meta.source);
const tx = code.tx.new({ value:0, gasLimit:gasLimit,storageDepositLimit }, initValue);
- I get the following error:
Unhandled Runtime Error
Error: createType(Call):: Call: failed decoding contracts.instantiateWithCode:: Struct: failed on args: {"value":"Compact<u128>","gas_limit":"Compact<FrameSupportWeightsWeightV2Weight>","storage_deposit_limit":"Option<Compact<u128>>","code":"Bytes","data":"Bytes","salt":"Bytes"}:: Struct: failed on gas_limit: Compact<FrameSupportWeightsWeightV2Weight>:: Struct: Cannot decode value 100000000000 (typeof number), expected an input object, map or array
Somebody please help me. Thank you.