This commit is contained in:
Rostyslav Tyshko 2025-05-30 15:25:21 -04:00
parent 9cd81c62eb
commit 0c9bbb5dde
2 changed files with 24 additions and 11 deletions

View File

@ -72,15 +72,21 @@ impl NodeBlockStore {
}
pub fn get_snapshot_commitment(&self) -> Result<HashStorageMerkleTree<UTXOCommitment>> {
Ok(serde_json::from_slice(&self.dbio.get_snapshot_commitment()?)?)
Ok(serde_json::from_slice(
&self.dbio.get_snapshot_commitment()?,
)?)
}
pub fn get_snapshot_nullifier(&self) -> Result<HashSet<UTXONullifier>> {
Ok(serde_json::from_slice(&self.dbio.get_snapshot_nullifier()?)?)
Ok(serde_json::from_slice(
&self.dbio.get_snapshot_nullifier()?,
)?)
}
pub fn get_snapshot_transaction(&self) -> Result<HashStorageMerkleTree<Transaction>> {
Ok(serde_json::from_slice(&self.dbio.get_snapshot_transaction()?)?)
Ok(serde_json::from_slice(
&self.dbio.get_snapshot_transaction()?,
)?)
}
}

View File

@ -7,7 +7,11 @@ use accounts::account_core::{Account, AccountAddress};
use anyhow::Result;
use block_store::NodeBlockStore;
use common::{
block::Block, commitment, merkle_tree_public::merkle_tree::{PublicTransactionMerkleTree, UTXOCommitmentsMerkleTree}, nullifier::{self, UTXONullifier}, utxo_commitment::UTXOCommitment
block::Block,
commitment,
merkle_tree_public::merkle_tree::{PublicTransactionMerkleTree, UTXOCommitmentsMerkleTree},
nullifier::{self, UTXONullifier},
utxo_commitment::UTXOCommitment,
};
use k256::{pkcs8::der::asn1::Null, AffinePoint};
use public_context::PublicSCContext;
@ -50,13 +54,16 @@ impl NodeChainStore {
block_id = temp_block_id;
}
Ok((Self {
acc_map,
block_store,
nullifier_store,
utxo_commitments_store,
pub_tx_store,
}, block_id))
Ok((
Self {
acc_map,
block_store,
nullifier_store,
utxo_commitments_store,
pub_tx_store,
},
block_id,
))
}
pub fn dissect_insert_block(&mut self, block: Block) -> Result<()> {