Skip to content

Commit

Permalink
fix: compilation errors, update test
Browse files Browse the repository at this point in the history
  • Loading branch information
polydez committed Apr 6, 2024
1 parent 22c89bb commit 328042b
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 8 deletions.
144 changes: 144 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion store/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use miden_objects::{
block::BlockNoteTree,
crypto::{hash::rpo::RpoDigest, merkle::MerklePath, utils::Deserializable},
notes::Nullifier,
transaction::AccountDetails,
BlockHeader, GENESIS_BLOCK,
};
use rusqlite::vtab::array;
Expand Down
11 changes: 6 additions & 5 deletions store/src/db/tests.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use miden_lib::transaction::TransactionKernel;
use miden_mock::mock::account::{generate_account_seed, mock_account_code, AccountSeedType};
use miden_mock::mock::account::mock_account_code;
use miden_node_proto::domain::accounts::{AccountDetailsUpdate, AccountHashUpdate};
use miden_objects::{
accounts::{
Account, AccountDelta, AccountId, AccountStorage, AccountStorageDelta, AccountVaultDelta,
ACCOUNT_ID_FUNGIBLE_FAUCET_ON_CHAIN, ACCOUNT_ID_NON_FUNGIBLE_FAUCET_ON_CHAIN,
ACCOUNT_ID_OFF_CHAIN_SENDER, ACCOUNT_ID_REGULAR_ACCOUNT_UPDATABLE_CODE_OFF_CHAIN,
ACCOUNT_ID_OFF_CHAIN_SENDER, ACCOUNT_ID_REGULAR_ACCOUNT_IMMUTABLE_CODE_ON_CHAIN,
ACCOUNT_ID_REGULAR_ACCOUNT_UPDATABLE_CODE_OFF_CHAIN,
},
assets::{Asset, AssetVault, FungibleAsset, NonFungibleAsset, NonFungibleAssetDetails},
block::BlockNoteTree,
Expand Down Expand Up @@ -205,8 +206,8 @@ fn test_sql_public_account_details() {
let block_num = 1;
create_block(&mut conn, block_num);

let (account_id, _seed) =
generate_account_seed(AccountSeedType::RegularAccountUpdatableCodeOnChain);
let account_id =
AccountId::try_from(ACCOUNT_ID_REGULAR_ACCOUNT_IMMUTABLE_CODE_ON_CHAIN).unwrap();
let fungible_faucet_id = AccountId::try_from(ACCOUNT_ID_FUNGIBLE_FAUCET_ON_CHAIN).unwrap();
let non_fungible_faucet_id =
AccountId::try_from(ACCOUNT_ID_NON_FUNGIBLE_FAUCET_ON_CHAIN).unwrap();
Expand Down Expand Up @@ -261,7 +262,7 @@ fn test_sql_public_account_details() {

let account_read = accounts_in_db.pop().unwrap().details.unwrap();
// TODO: substitute by a single check, once code imports deserialization is fixed
// (possibly after merging: https://github.com/0xPolygonMiden/miden-vm/pull/1277):
// (possibly after merging of https://github.com/0xPolygonMiden/miden-vm/pull/1277):
// assert_eq!(account_read, account);
assert_eq!(account_read.id(), account.id());
assert_eq!(account_read.vault(), account.vault());
Expand Down
4 changes: 2 additions & 2 deletions store/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
use std::{mem, sync::Arc};

use miden_node_proto::{
domain::accounts::{AccountDetailsUpdate, AccountInfo}, AccountInputRecord, NullifierWitness,
domain::accounts::{AccountDetailsUpdate, AccountInfo},
AccountInputRecord, NullifierWitness,
};
use miden_node_utils::formatting::{format_account_id, format_array};
use miden_objects::{
Expand All @@ -15,7 +16,6 @@ use miden_objects::{
merkle::{LeafIndex, Mmr, MmrDelta, MmrPeaks, SimpleSmt, SmtProof, ValuePath},
},
notes::{NoteMetadata, NoteType, Nullifier},
transaction::AccountDetails,
AccountError, BlockHeader, NoteError, ACCOUNT_TREE_DEPTH, ZERO,
};
use tokio::{
Expand Down

0 comments on commit 328042b

Please sign in to comment.