diff --git a/Cargo.lock b/Cargo.lock index 0fd48b06..8442efac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1639,6 +1639,8 @@ dependencies = [ "miden-node-proto", "miden-node-utils", "miden-objects", + "num-derive", + "num-traits", "rusqlite", "rusqlite_migration", "serde", diff --git a/crates/store/src/db/sql/mod.rs b/crates/store/src/db/sql/mod.rs index d3559947..37b9afa9 100644 --- a/crates/store/src/db/sql/mod.rs +++ b/crates/store/src/db/sql/mod.rs @@ -344,7 +344,7 @@ pub fn upsert_accounts( }); } - let insert_delta = AccountDelta::from(account); + let insert_delta = AccountDelta::from(account.clone()); (Some(Cow::Borrowed(account)), Some(Cow::Owned(insert_delta))) }, diff --git a/crates/store/src/db/tests.rs b/crates/store/src/db/tests.rs index 1e8fb06f..965aa0f3 100644 --- a/crates/store/src/db/tests.rs +++ b/crates/store/src/db/tests.rs @@ -1,4 +1,3 @@ -use assert_matches::assert_matches; use miden_lib::transaction::TransactionKernel; use miden_node_proto::domain::accounts::AccountSummary; use miden_objects::{ @@ -374,7 +373,7 @@ fn test_sql_public_account_details() { create_block(&mut conn, 2); - let read_delta = sql::select_account_delta(&mut conn, account_id.into(), 1, 2).unwrap(); + let read_delta = sql::select_account_delta(&mut conn, account.id().into(), 1, 2).unwrap(); assert_eq!(read_delta, None); @@ -422,7 +421,7 @@ fn test_sql_public_account_details() { assert_eq!(account_read.nonce(), account.nonce()); assert_eq!(account_read.storage(), account.storage()); - let read_delta = sql::select_account_delta(&mut conn, account_id.into(), 1, 2).unwrap(); + let read_delta = sql::select_account_delta(&mut conn, account.id().into(), 1, 2).unwrap(); assert_eq!(read_delta.as_ref(), Some(&delta2)); create_block(&mut conn, 3);