0

Can somebody explain what this means?

 Rpc(ClientError(Call(Custom(ErrorObject { code: ServerError(1002), message: "Verification Error: Runtime error: Execution failed: Runtime panicked: Bad input data provided to validate_transaction: Could not decode `RuntimeCall::System.0`:\n\tCould not decode `Call`, variant doesn't exist\n", data: Some(RawValue("RuntimeApi(\"Execution failed: Runtime panicked: Bad input data provided to validate_transaction: Could not decode `RuntimeCall::System.0`:\\n\\tCould not decode `Call`, variant doesn't exist\\n\")")) }))))', 

I have pallet-balance in my runtime, and I'm using subxt to perform a transfer:


#[subxt::subxt(runtime_metadata_path = "../artifacts/my_metadata.scale")]
pub mod metadata{}

#[derive(Encode, Decode, Debug, Clone, Eq, PartialEq)]
pub struct ChargeAssetTxPayment {
    pub tip: u128,
    pub asset_id:Option<u8>
}


#[tokio::main]
async fn main() {
    let api = subxt::OnlineClient::<MyConfig>::new().await.expect("should work");

    let dest = subxt::ext::sp_runtime::MultiAddress::Id(sp_keyring::AccountKeyring::Bob.into());

  
    let balance_transfer_tx = metadata::tx().balances().transfer(
        dest,
        10_000,
    );

    let alice_pair = SR25519Pair::from_string("//Alice", None).unwrap();
    
    let charge = ChargeAssetTxPayment { tip: 10, asset_id: Some(0) };
    let extra_params = (
        api.genesis_hash(),
        Era::Immortal,
        charge
        );

   let events = api.tx()
        .sign_and_submit_then_watch(&balance_transfer_tx, &alice_pair, extra_params)
        .await.expect("should work!")
        .wait_for_finalized_success()
        .await.expect("should work!!!");
}

The error happens at sign_and_submit_then_watch() I do not quite understand the issue of RuntimeCall::System.0. I printed the validation_details() of balance_transfer_tx and it returned fine. Where am I doing wrong?

Also, see this comment, because it's the same error.

1 Answer 1

0

The likely culprit is that your MyConfig type is configured incorrectly (most likely that the ExtrinsicParams you are using do not line up with the chain in question). The docs were recently extended to provide much more info on how to construct the config, so perhaps this is helpful:

https://docs.rs/subxt/0.30.1/subxt/book/setup/config/index.html

Otherwise, note that we are going to improve this config (most notably the ExtrinsicParams) to make the much more robust and simpler to set up (follow this issue to keep up with this: https://github.com/paritytech/subxt/issues/1062)

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.