Skip to content

Commit

Permalink
kairos-circuit-logic: update to support recent kairos-trie
Browse files Browse the repository at this point in the history
  • Loading branch information
marijanp committed Sep 16, 2024
1 parent d8f5678 commit 6e4f7ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kairos-prover/kairos-circuit-logic/src/account_trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use kairos_trie::{
};

/// The state of the batch transaction against the trie.
pub struct AccountTrie<S: Store<Account>> {
pub struct AccountTrie<S: Store<Value = Account>> {
pub txn: AccountTrieTxn<S>,
}
pub type AccountTrieTxn<S> = kairos_trie::Transaction<S, Account>;
pub type AccountTrieTxn<S> = kairos_trie::Transaction<S>;

/// TODO panic on error should be behind a feature flag
type TxnErr = String;
Expand All @@ -25,7 +25,7 @@ impl<'s> TryFrom<&'s Snapshot<Account>> for AccountTrie<&'s Snapshot<Account>> {

fn try_from(snapshot: &'s Snapshot<Account>) -> Result<Self, Self::Error> {
Ok(Self {
txn: kairos_trie::Transaction::from_snapshot(snapshot)?,
txn: kairos_trie::Transaction::from_unverified_snapshot_ref(snapshot)?,
})
}
}
Expand All @@ -44,7 +44,7 @@ impl<Db: 'static + DatabaseGet<Account>> TryFrom<SnapshotBuilder<Db, Account>>
impl<'s> AccountTrie<&'s Snapshot<Account>> {
pub fn new_try_from_snapshot(snapshot: &'s Snapshot<Account>) -> Result<Self, TxnErr> {
Ok(Self {
txn: kairos_trie::Transaction::from_snapshot(snapshot)?,
txn: kairos_trie::Transaction::from_unverified_snapshot_ref(snapshot)?,
})
}
}
Expand All @@ -59,7 +59,7 @@ impl<Db: 'static + DatabaseGet<Account>> AccountTrie<SnapshotBuilder<Db, Account
}
}

impl<S: Store<Account>> AccountTrie<S> {
impl<S: Store<Value = Account>> AccountTrie<S> {
#[allow(clippy::type_complexity)]
pub fn apply_batch(
&mut self,
Expand Down

0 comments on commit 6e4f7ab

Please sign in to comment.