-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
spl-transfer-hook create-extra-metas : Result::unwrap() on an
Err` value: Downcast
#6623
Comments
Hey @Ai-Artsca you'll have to provide a little context here to describe why you think this is a bug with one of the SPL crates, and not a test panic you're hitting with the example test suite. |
I encountered a runtime panic while running the spl-transfer-hook create-extra-metas command from the Solana Program Library (SPL) token transfer-hook example. The error arises due to an unwrapped Result returning an Err value. Below is the command and error output for reference. ../../../target/debug/spl-transfer-hook create-extra-metas HookqC4zUVMzYkVVZiGz9vu13XHc9XTBcqgtMb9yUtHt TokDibMzhbqs833NcxTFq7J6pfb6mB6hhCRiydHCgcv thread 'main' panicked at token/transfer-hook/cli/src/main.rs:447:18: Attempted Resolution Backtrace Excerpt 0: rust_begin_unwind Thank you for your time and assistance! |
Gotcha! Thanks. I can re-produce your issue. Looks like a bug! |
Looks like this PR caused the breakage. If I revert back to the deprecated functions, everything works fine. @samkim-crypto have you seen this at all with the new Clap v3 stuff? |
Yeah, sorry about that! The new clap-v3-utils parsers are used when declaring the arguments, but the original incompatible parsers are used when actually parsing the arguments. I think we will need to upgrade to the latest |
Great, thanks! Saw your PR to bump to |
Thanks again for the help! Could you please specify which version of |
The fix requires both an upgrade to |
I've updated the ../../../target/debug/spl-transfer-hook create-extra-metas HookSNukpeokYkzRdKwK1d4LYMmNXGPkotw5cwqnwVyz TokkZcu8RTE46yWjF7LMTqqKa6LzTVM438qZDfz3qZH However, I encountered a new error related to transaction simulation: solana config get: Could you help me understand what might be causing this new issue? Any advice on how to troubleshoot or correct this would be greatly appreciated. Thank you! |
Hey @Ai-Artsca the original issue you've reported here has been fixed with #6625, so I'm going to close the issue. The error you're reporting now is not a bug with the CLI, it likely means you need to configure your "extra account metas" account and/or hook program. Feel free to ask for assistance with the Transfer Hook example on Stack Exchange! |
metaharm@MSI:~/extensions/solana-program-library/token/transfer-hook/example$ ../../../target/debug/spl-transfer-hook create-extra-metas HookqC4zUVMzYkVVZiGz9vu13XHc9XTBcqgtMb9yUtHt TokDibMzhbqs833NcxTFq7J6pfb6mB6hhCRiydHCgcv
thread 'main' panicked at token/transfer-hook/cli/src/main.rs:447:18:
called
Result::unwrap()
on anErr
value: Downcast { actual: solana_clap_v3_utils::keypair::SignerSource, expected: alloc::string::String }note: run with
RUST_BACKTRACE=1
environment variable to display a backtraceBacktrace:
RUST_BACKTRACE=1 ../../../target/debug/spl-transfer-hook create-extra-metas HookqC4zUVMzYkVVZiGz9vu13XHc9XTBcqgtMb9yUtHt TokDibMzhbqs833NcxTFq7J6pfb6mB6hhCRiydHCgcv
thread 'main' panicked at token/transfer-hook/cli/src/main.rs:447:18:
called
Result::unwrap()
on anErr
value: Downcast { actual: solana_clap_v3_utils::keypair::SignerSource, expected: alloc::string::String }stack backtrace:
0: rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
1: core::panicking::panic_fmt
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
2: core::result::unwrap_failed
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
3: core::result::Result<T,E>::unwrap
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
4: spl_transfer_hook::main::{{closure}}
at /home/metaharm/extensions/solana-program-library/token/transfer-hook/cli/src/main.rs:446:30
5: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
at /home/metaharm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/park.rs:281:63
6: tokio::runtime::coop::with_budget
at /home/metaharm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/coop.rs:107:5
7: tokio::runtime::coop::budget
at /home/metaharm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/coop.rs:73:5
8: tokio::runtime::park::CachedParkThread::block_on
at /home/metaharm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/park.rs:281:31
9: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
at /home/metaharm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/context/blocking.rs:66:9
10: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
at /home/metaharm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/multi_thread/mod.rs:87:13
11: tokio::runtime::context::runtime::enter_runtime
at /home/metaharm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/context/runtime.rs:65:16
12: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
at /home/metaharm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/multi_thread/mod.rs:86:9
13: tokio::runtime::runtime::Runtime::block_on
at /home/metaharm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/runtime.rs:351:45
14: spl_transfer_hook::main
at /home/metaharm/extensions/solana-program-library/token/transfer-hook/cli/src/main.rs:528:5
15: core::ops::function::FnOnce::call_once
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with
RUST_BACKTRACE=full
for a verbose backtrace.The text was updated successfully, but these errors were encountered: