We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
None
soroban 0.3.3 (dc87a2947e8bfbbea56cd3762795b527812d2d01) soroban-env 0.0.10 (c14805161b54ba272108ba0503057683f2a688a2) soroban-env interface version 26 stellar-xdr 0.0.9 (1309e3de46fcb01743f818831de3a9ac4a5b1ab6) xdr next (026c9cd074bdb28ddde8ee52f2a4502d9e518a09)
Tried to call a None argument via the CLI in several different ways
--arg '{"static":"void"}' --arg 'null' --arg null
Success
error: parsing argument {"static":"void"}: parse error: value is not parseable to Option(ScSpecTypeOption { value_type: AccountId })
error: HostError Value: Status(HostValueError(UnknownError)) Debug events (newest first): 0: "Status(HostValueError(UnknownError))" Backtrace (newest first): 0: backtrace::capture::Backtrace::new_unresolved 1: soroban_env_host::host::err_helper::<impl soroban_env_host::host::Host>::err 2: soroban_env_host::host::Host::to_host_val 3: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold 4: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter 5: core::iter::adapters::try_process 6: soroban_env_host::host::Host::invoke_function 7: soroban::invoke::Cmd::run_in_sandbox 8: soroban::run::{{closure}} 9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll 10: tokio::runtime::park::CachedParkThread::block_on 11: tokio::runtime::scheduler::multi_thread::MultiThread::block_on 12: soroban::main
Contract code:
#![no_std] use soroban_sdk::{contractimpl, Env, AccountId, Address}; pub struct TestContract; #[contractimpl] impl TestContract { pub fn set_wo(env: Env) { let to: Option<AccountId> = None; let source_account: Address; if to.is_none() { source_account = env.invoker(); } else { source_account = Address::Account(to.unwrap()); } env.storage().set(env.invoker(), source_account); } pub fn set_w(env: Env, to: Option<AccountId>) { let source_account: Address; if to.is_none() { source_account = env.invoker(); } else { source_account = Address::Account(to.unwrap()); } env.storage().set(env.invoker(), source_account); } }
The text was updated successfully, but these errors were encountered:
I'd expect we need a strval converter for null -> Option::None to parse it in a way the host will accept.
null -> Option::None
Sorry, something went wrong.
Also see: https://discord.com/channels/897514728459468821/1037066367326752818/threads/1037133766726000760
And: https://discord.com/channels/897514728459468821/1058220441535271013
paulbellamy
Shaptic
Successfully merging a pull request may close this issue.
What version are you using?
What did you do?
Tried to call a
None
argument via the CLI in several different waysWhat did you expect to see?
Success
What did you see instead?
Contract code:
The text was updated successfully, but these errors were encountered: