Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/zaino-fetch/src/jsonrpsee/response/address_deltas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,30 @@ pub struct AddressDelta {
}

impl AddressDelta {
/// Creates a transparent address delta from already-indexed address-history data.
///
/// This is used by backing stores and test sources that already know the
/// address, value, transaction location, and input/output index. It avoids
/// forcing those implementations to build partial `TransactionObject`
/// values solely to immediately decompose them again.
pub fn new(
satoshis: i64,
txid: String,
index: u32,
height: u32,
address: String,
block_index: Option<u32>,
) -> Self {
Self {
satoshis,
txid,
index,
height,
address,
block_index,
}
}

/// Create a delta from a transaction input (spend - negative value)
pub fn from_input(
input: &Input,
Expand Down
1,215 changes: 134 additions & 1,081 deletions packages/zaino-state/src/chain_index/source.rs

Large diffs are not rendered by default.

Loading
Loading