Open sander2 opened 2 years ago
Which snippet?
This custom snippet:
const tx = api.tx.xcmPallet.reserveTransferAssets;
const ALICE = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
const dst = { X1: { ParaChain: '2000' }, parents: 0 };
const acc = { X1: {
AccountId32: { id: ALICE, network: 'Any' }
} };
const ass = [{ ConcreteFungible: { amount: '1000000000000' } }]
const call = tx(
{ V0: dst },
{ V0: acc },
{ V0: ass },
0
);
await call.signAndSend(ALICE, ({ events = [], status }) => {
if (status.isInBlock) {
console.log('Successful transfer of ' + randomAmount + ' with hash ' + status.asInBlock.toHex());
} else {
console.log('Status of transfer: ' + status.type);
}
events.forEach(({ phase, event: { data, method, section } }) => {
console.log(phase.toString() + ' : ' + section + '.' + method + ' ' + data.toString());
});
});
That is weird. None of those are extended types. Probably something in the api.clone() method used in the JS console.
Something similar is happening when I try to distpatch a sudo call (xcmPallet::forceDefaultXcmVersion
), I get the error below, until I go to Settings->Metadata.
2021-11-17 12:44:47 RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1002: Verification Error: Runtime error: Execution failed: ApiError(FailedToConvertParameter { function: "validate_transaction", parameter: "tx", error: Error { cause: None, desc: "Could not decode `MultiAddress`, variant doesn't exist" } }): RuntimeApi, Execution failed: ApiError, FailedToConvertParameter { function: \"validate_transaction\", parameter: \"tx\", error: Error { cause: None, desc: \"Could not decode `MultiAddress`, variant doesn't exist\" } }
This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.
When I try to run a javascript snippet, I get the error shown below. After visiting the the settings -> metadata page and going back to the javascript snipper, it suddenly works. I haven't looked at the code, but it's as if the types are not fetched until the metadata page is visited.