Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There seems to be an error when sending the transaction #343

Closed
CoderfishGzh opened this issue Nov 25, 2022 · 7 comments
Closed

There seems to be an error when sending the transaction #343

CoderfishGzh opened this issue Nov 25, 2022 · 7 comments

Comments

@CoderfishGzh
Copy link

When I execute the example of the trade function, an error occurs. What do I need to do to solve this problem

    Finished dev [unoptimized + debuginfo] target(s) in 3.63s
     Running `target/debug/rust-substrate`
[+] Composed Extrinsic:
 UncheckedExtrinsic(Some((MultiAddress::Id(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), SubstrateDefaultSignedExtra { era: Era::Immortal, nonce: 0, tip: AssetTip { tip: 0, asset: None } })), ([8, 0], 10))

[+] Transaction got included. Hash: Err(RpcClient(Extrinsic("extrinsic error code 1002: Verification Error: Runtime error: 
Execution failed: Runtime panicked: Bad input data provided to validate_transaction: Invalid length prefix: 
RuntimeApi(\"Execution failed: Runtime panicked: Bad input data provided to validate_transaction: Invalid length prefix\")")))
@CoderfishGzh
Copy link
Author

Is it a problem with my substrate version?

@haerdib
Copy link
Contributor

haerdib commented Nov 28, 2022

Hm.. No, I don't think that's the substrate version. More like a mismatch between types. I'm not sure which example exactly you're using, but currently all examples are matched to the kitchensink_runtime. Which means they are using AssetTipExtrinsicParams, e.g. they depend upon the asset pallet. Is your runtime perhaps using the balances pallet? If so, try using PlainTipExtrinsicParams instead of AssetTipExtrinsicParams here:

let api = Api::<_, _, AssetTipExtrinsicParams>::new(client)
.map(|api| api.set_signer(alice.clone()))
.unwrap();

@clangenb
Copy link
Collaborator

If possible, I would like our examples to use the PlainTip, which is the standard case. Is there no substrate docker image that comes with PlainTips?

@haerdib
Copy link
Contributor

haerdib commented Nov 28, 2022

I'm currently thinking of a totally different solution: #344 (comment)

Maybe you know the answer to that: Is it possible to detect which tips to use, if the Runtime is known?

@haerdib
Copy link
Contributor

haerdib commented Nov 28, 2022

And no, not as far as I know, but I haven't investigated much. I will, if #344 is not possible.

@haerdib
Copy link
Contributor

haerdib commented Nov 28, 2022

#344 seems certainly possible, but it will take some time. I looked into the docker problem, but it seems parity does not upload the substrate node-template anymore (checked https://hub.docker.com/u/parity/),

@haerdib haerdib assigned haerdib and unassigned haerdib Dec 9, 2022
@haerdib
Copy link
Contributor

haerdib commented Dec 19, 2022

Closing this in favour of #383

@haerdib haerdib closed this as completed Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants