-
Notifications
You must be signed in to change notification settings - Fork 126
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
Fix reported extrinsic hash #629
Conversation
@@ -100,7 +100,6 @@ async fn main() { | |||
println!("[+] Extrinsic with hash {extrinsic_hash:?} was successfully executed.",); | |||
println!("[+] Extrinsic got included in block with hash {block_hash:?}"); | |||
println!("[+] Watched extrinsic until it reached the status {extrinsic_status:?}"); | |||
println!("[+] The following events were thrown when the extrinsic was executed: {extrinsic_events:?}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this line because the printing was way too verbose.
Manual test:
Polkadot.js: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the manual test results.
let report = api.submit_and_watch_extrinsic_until(xt2, XtStatus::Ready).unwrap(); | ||
assert_eq!(extrinsic_hash, report.extrinsic_hash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
* fix xt_hash * fix clippy * fix unit test * fix author tests * remove too verbose println (cherry picked from commit 8e92465)
The problem was that we encoded the extrinsic twice:
T::Hasher::hash_of(..)
encodes the input automatically. We therefore need to useT::Hasher::hash(..)
for the already encoded extrinsic.The extrinsic hash can be manually checked by:
docker run -p 9944:9944 -p 9933:9933 -p 30333:30333 parity/substrate:latest --dev --rpc-external
cargo run -p ac-examples --example check_extrinsic_events
closes #621