Closed forgetso closed 2 years ago
redspot does have this problem when using explorer. Custom accounts are not supported now, you can generate accounts via suri in the redspot account config. Or use polkadot extension to sign. Or just close the redspot explorer.
But,this is indeed a problem, and we will improve the account import later.
Thanks for the tip. It seems that that I can get it to work using the redspot signer object instead of my own one.
// this.env.network = redspot network
const pair = this.env.network.keyring.addFromJson(json_file);
if (pair.isLocked) {
pair.unlock(secrets_file[json_file.address])
}
const signer = this.env.network.createSigner(pair);
Redspot Version 0.13.1-0 I create a signer from my JSON file and unlock the signer if it is unlocked.
I then try to create an instance of a contract.
const signedContract = contract.connect(signer)
But it fails with:
contract
is previously declared byHow can I change the signer of the contract the account loaded from the JSON file?