-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Right now, ZkStruct can blow up if the struct changes; like so:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `resources`", line: 0, column: 0)', /home/colum/.cargo/registry/src/github.com-1ecc6299db9ec823/zkstate-0.1.6/src/lib.rs:249:43
stack backtrace:
0: rust_begin_unwind
at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/core/src/panicking.rs:92:14
2: core::option::expect_none_failed
at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/core/src/option.rs:1329:5
3: core::result::Result<T,E>::unwrap
at /home/colum/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1037:23
4: zkstate::state_change
at /home/colum/.cargo/registry/src/github.com-1ecc6299db9ec823/zkstate-0.1.6/src/lib.rs:249:17
5: zkstate::ZkState<T>::initialize
at /home/colum/.cargo/registry/src/github.com-1ecc6299db9ec823/zkstate-0.1.6/src/lib.rs:90:9
6: zkstate::ZkState<T>::new
at /home/colum/.cargo/registry/src/github.com-1ecc6299db9ec823/zkstate-0.1.6/src/lib.rs:71:9
7: stardance::executor::Executor::new
at ./stardance/src/executor.rs:43:19
8: executor::main
at ./stardance/examples/executor.rs:42:20
9: core::ops::function::FnOnce::call_once
at /home/colum/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
There should be:
- better handling of this error so it doesn't panic
- documentation around best practices on changing the fields of this object
Metadata
Metadata
Assignees
Labels
No labels