Skip to content

Commit

Permalink
fixed merge conflict in header
Browse files Browse the repository at this point in the history
  • Loading branch information
fluidvanadium committed Apr 4, 2024
2 parents 2046f40 + ab260ca commit 22fb45f
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 65 deletions.
44 changes: 22 additions & 22 deletions Cargo.lock

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

14 changes: 7 additions & 7 deletions zingolib/src/blaze/block_management_reorg_detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::wallet::{
data::{BlockData, PoolNullifier},
notes::ShieldedNoteInterface,
traits::DomainWalletExt,
transactions::TransactionMetadataSet,
transactions::TxMapAndMaybeTrees,
};
use incrementalmerkletree::frontier::CommitmentTree;
use incrementalmerkletree::{frontier, witness::IncrementalWitness, Hashable};
Expand Down Expand Up @@ -317,7 +317,7 @@ impl BlockManagementData {
pub async fn invalidate_block(
reorg_height: u64,
existing_blocks: Arc<RwLock<Vec<BlockData>>>,
transaction_metadata_set: Arc<RwLock<TransactionMetadataSet>>,
transaction_metadata_set: Arc<RwLock<TxMapAndMaybeTrees>>,
) {
let mut existing_blocks_writelock = existing_blocks.write().await;
if existing_blocks_writelock.len() != 0 {
Expand All @@ -343,7 +343,7 @@ impl BlockManagementData {
&self,
start_block: u64,
end_block: u64,
transaction_metadata_set: Arc<RwLock<TransactionMetadataSet>>,
transaction_metadata_set: Arc<RwLock<TxMapAndMaybeTrees>>,
reorg_transmitter: UnboundedSender<Option<u64>>,
) -> (
JoinHandle<Result<Option<u64>, String>>,
Expand Down Expand Up @@ -589,7 +589,7 @@ struct BlockManagementThreadData {
impl BlockManagementThreadData {
async fn handle_reorgs_populate_data_inner(
mut self,
transaction_metadata_set: Arc<RwLock<TransactionMetadataSet>>,
transaction_metadata_set: Arc<RwLock<TxMapAndMaybeTrees>>,
reorg_transmitter: UnboundedSender<Option<u64>>,
) -> Result<Option<u64>, String> {
// Temporary holding place for blocks while we process them.
Expand Down Expand Up @@ -835,7 +835,7 @@ mod test {
.handle_reorgs_and_populate_block_mangement_data(
start_block,
end_block,
Arc::new(RwLock::new(TransactionMetadataSet::new_with_witness_trees())),
Arc::new(RwLock::new(TxMapAndMaybeTrees::new_with_witness_trees())),
reorg_transmitter,
)
.await;
Expand Down Expand Up @@ -884,7 +884,7 @@ mod test {
.handle_reorgs_and_populate_block_mangement_data(
start_block,
end_block,
Arc::new(RwLock::new(TransactionMetadataSet::new_with_witness_trees())),
Arc::new(RwLock::new(TxMapAndMaybeTrees::new_with_witness_trees())),
reorg_transmitter,
)
.await;
Expand Down Expand Up @@ -980,7 +980,7 @@ mod test {
.handle_reorgs_and_populate_block_mangement_data(
start_block,
end_block,
Arc::new(RwLock::new(TransactionMetadataSet::new_with_witness_trees())),
Arc::new(RwLock::new(TxMapAndMaybeTrees::new_with_witness_trees())),
reorg_transmitter,
)
.await;
Expand Down
12 changes: 6 additions & 6 deletions zingolib/src/blaze/trial_decryptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::wallet::{
data::PoolNullifier,
keys::unified::WalletCapability,
traits::{CompactOutput as _, DomainWalletExt, FromCommitment, Recipient},
transactions::TransactionMetadataSet,
transactions::TxMapAndMaybeTrees,
utils::txid_from_slice,
MemoDownloadOption,
};
Expand Down Expand Up @@ -41,15 +41,15 @@ use super::syncdata::BlazeSyncData;

pub struct TrialDecryptions {
wc: Arc<WalletCapability>,
transaction_metadata_set: Arc<RwLock<TransactionMetadataSet>>,
transaction_metadata_set: Arc<RwLock<TxMapAndMaybeTrees>>,
config: Arc<ZingoConfig>,
}

impl TrialDecryptions {
pub fn new(
config: Arc<ZingoConfig>,
wc: Arc<WalletCapability>,
transaction_metadata_set: Arc<RwLock<TransactionMetadataSet>>,
transaction_metadata_set: Arc<RwLock<TxMapAndMaybeTrees>>,
) -> Self {
Self {
config,
Expand Down Expand Up @@ -130,7 +130,7 @@ impl TrialDecryptions {
bsync_data: Arc<RwLock<BlazeSyncData>>,
sapling_ivk: Option<SaplingIvk>,
orchard_ivk: Option<OrchardIvk>,
transaction_metadata_set: Arc<RwLock<TransactionMetadataSet>>,
transaction_metadata_set: Arc<RwLock<TxMapAndMaybeTrees>>,
transaction_size_filter: Option<u32>,
detected_transaction_id_sender: UnboundedSender<(
TxId,
Expand Down Expand Up @@ -263,7 +263,7 @@ impl TrialDecryptions {
config: &zingoconfig::ZingoConfig,
wc: &Arc<WalletCapability>,
bsync_data: &Arc<RwLock<BlazeSyncData>>,
transaction_metadata_set: &Arc<RwLock<TransactionMetadataSet>>,
transaction_metadata_set: &Arc<RwLock<TxMapAndMaybeTrees>>,
detected_transaction_id_sender: &UnboundedSender<(
TxId,
PoolNullifier,
Expand Down Expand Up @@ -418,7 +418,7 @@ fn update_witnesses<D>(
)>,
BlockHeight,
)>,
txmds_writelock: &mut TransactionMetadataSet,
txmds_writelock: &mut TxMapAndMaybeTrees,
wc: &Arc<WalletCapability>,
) -> ZingoLibResult<()>
where
Expand Down
6 changes: 3 additions & 3 deletions zingolib/src/blaze/update_notes.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::wallet::MemoDownloadOption;
use crate::wallet::{
data::PoolNullifier, transactions::TransactionMetadataSet, utils::txid_from_slice,
data::PoolNullifier, transactions::TxMapAndMaybeTrees, utils::txid_from_slice,
};
use std::sync::Arc;

Expand All @@ -27,11 +27,11 @@ use super::syncdata::BlazeSyncData;
/// If No, then:
/// - Update the witness for this note
pub struct UpdateNotes {
transaction_metadata_set: Arc<RwLock<TransactionMetadataSet>>,
transaction_metadata_set: Arc<RwLock<TxMapAndMaybeTrees>>,
}

impl UpdateNotes {
pub fn new(wallet_txns: Arc<RwLock<TransactionMetadataSet>>) -> Self {
pub fn new(wallet_txns: Arc<RwLock<TxMapAndMaybeTrees>>) -> Self {
Self {
transaction_metadata_set: wallet_txns,
}
Expand Down
12 changes: 6 additions & 6 deletions zingolib/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use self::{
data::{BlockData, WalletZecPriceInfo},
message::Message,
transaction_context::TransactionContext,
transactions::TransactionMetadataSet,
transactions::TxMapAndMaybeTrees,
};
use zingoconfig::ZingoConfig;

Expand Down Expand Up @@ -594,9 +594,9 @@ impl LightWallet {
));
};
let transaction_metadata_set = if wc.can_spend_from_all_pools() {
Arc::new(RwLock::new(TransactionMetadataSet::new_with_witness_trees()))
Arc::new(RwLock::new(TxMapAndMaybeTrees::new_with_witness_trees()))
} else {
Arc::new(RwLock::new(TransactionMetadataSet::new_treeless()))
Arc::new(RwLock::new(TxMapAndMaybeTrees::new_treeless()))
};
let transaction_context =
TransactionContext::new(&config, Arc::new(wc), transaction_metadata_set);
Expand Down Expand Up @@ -677,9 +677,9 @@ impl LightWallet {
}

let mut transactions = if external_version <= 14 {
TransactionMetadataSet::read_old(&mut reader, &wallet_capability)
TxMapAndMaybeTrees::read_old(&mut reader, &wallet_capability)
} else {
TransactionMetadataSet::read(&mut reader, &wallet_capability)
TxMapAndMaybeTrees::read(&mut reader, &wallet_capability)
}?;
let txids = transactions
.current
Expand Down Expand Up @@ -930,7 +930,7 @@ impl LightWallet {
}
}

pub fn transactions(&self) -> Arc<RwLock<TransactionMetadataSet>> {
pub fn transactions(&self) -> Arc<RwLock<TxMapAndMaybeTrees>> {
self.transaction_context.transaction_metadata_set.clone()
}

Expand Down
6 changes: 3 additions & 3 deletions zingolib/src/wallet/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{
},
keys::unified::WalletCapability,
notes::{OrchardNote, SaplingNote},
transactions::TransactionMetadataSet,
transactions::TxMapAndMaybeTrees,
};
use crate::wallet::notes::NoteInterface;
use crate::wallet::notes::ShieldedNoteInterface;
Expand Down Expand Up @@ -450,15 +450,15 @@ where
.sum()
}
fn transaction_metadata_set_to_shardtree(
txmds: &TransactionMetadataSet,
txmds: &TxMapAndMaybeTrees,
) -> Option<&MemoryStoreShardTree<<Self::WalletNote as ShieldedNoteInterface>::Node>> {
txmds
.witness_trees
.as_ref()
.map(|trees| Self::get_shardtree(trees))
}
fn transaction_metadata_set_to_shardtree_mut(
txmds: &mut TransactionMetadataSet,
txmds: &mut TxMapAndMaybeTrees,
) -> Option<&mut MemoryStoreShardTree<<Self::WalletNote as ShieldedNoteInterface>::Node>> {
txmds
.witness_trees
Expand Down
Loading

0 comments on commit 22fb45f

Please sign in to comment.