https://github.com/paritytech/subxt/blob/master/subxt/examples/tx_basic.rs
I want to call a function in my substrate pallet. I am using the
- substrate-node-template
- subxt
- subxt_signer
use subxt::{OnlineClient, PolkadotConfig};
use subxt_signer::sr25519::dev;
#[subxt::subxt(runtime_metadata_path = "./src/artifacts/metadata.scale")]
pub mod polkadot {}
{
// ...
let account = dev::alice();
let call = polkadot::tx().template_module().do_something(32);
api.tx()
.sign_and_submit_then_watch_default(&call, &account)
.await
.unwrap();
// ...
}
but sign_and_submit_then_watch_default is giving error for &account. This is the error that I get
the trait bound `subxt_signer::sr25519::Keypair: subxt::tx::Signer<PolkadotConfig>` is not satisfied
the trait `subxt::tx::Signer<PolkadotConfig>` is not implemented for `subxt_signer::sr25519::Keypair`
I have tried using sp_core and changing versions but nothing seems to work.
My current versions are:
subxt = "0.31.0"
subxt-signer = "0.31.0"
cargo tree -i subxt
and acargo tree -i subxt-signer
in your example and report back the result? The likely explanation for this sort of mismatch is that the versions ofsubxt
andsubxt-signer
are not in fact both 0.31.