Skip to content

Commit

Permalink
[no ci] Custom codec fix
Browse files Browse the repository at this point in the history
  • Loading branch information
citizen-stig committed Dec 6, 2023
1 parent 7b7a426 commit 546765a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use std::panic::catch_unwind;

use sov_modules_api::default_context::DefaultContext;
use sov_modules_api::{prelude::*, Context, ModuleInfo, StateValue, WorkingSet};
use sov_modules_api::default_context::ZkDefaultContext;
use sov_modules_api::prelude::*;
use sov_modules_api::{Context, ModuleInfo, StateValue, WorkingSet};
use sov_modules_core::{StateCodec, StateKeyCodec, StateValueCodec};
use sov_state::{DefaultStorageSpec, ProverStorage};
use sov_state::{DefaultStorageSpec, ZkStorage};

#[derive(ModuleInfo)]
struct TestModule<C>
Expand Down Expand Up @@ -56,12 +57,11 @@ impl<V> StateValueCodec<V> for CustomCodec {
}

fn main() {
let tempdir = tempfile::tempdir().unwrap();
let storage: ProverStorage<DefaultStorageSpec> = ProverStorage::with_path(&tempdir).unwrap();
let module: TestModule<DefaultContext> = TestModule::default();
let storage: ZkStorage<DefaultStorageSpec> = ZkStorage::new();
let module: TestModule<ZkDefaultContext> = TestModule::default();

catch_unwind(|| {
let mut working_set: WorkingSet<DefaultContext> = WorkingSet::new(storage);
let mut working_set: WorkingSet<ZkDefaultContext> = WorkingSet::new(storage);
module.state_value.set(&0u32, &mut working_set);
})
.unwrap_err();
Expand Down
1 change: 0 additions & 1 deletion module-system/sov-state/src/prover_storage.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::marker::PhantomData;
use std::path::Path;
use std::sync::Arc;

use jmt::storage::{NodeBatch, TreeWriter};
Expand Down

0 comments on commit 546765a

Please sign in to comment.