Skip to content

Commit

Permalink
Merge pull request #920 from fluidvanadium/add_note_record_identifier
Browse files Browse the repository at this point in the history
added NoteRecordIdentifier
  • Loading branch information
zancas authored Apr 10, 2024
2 parents 91d5244 + 2ab55f2 commit d9685f4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions zingolib/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- LightClient pub fn get_wallet_dir_location
- `wallet::keys`:
- `is_transparent_address`
- pub struct crate::wallet::notes::NoteRecordIdentifier

### Changed

Expand Down
21 changes: 21 additions & 0 deletions zingolib/src/wallet/notes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,24 @@ pub mod sapling;
pub use sapling::SaplingNote;
pub mod orchard;
pub use orchard::OrchardNote;

use zcash_client_backend::PoolType;
use zcash_primitives::transaction::TxId;

/// This triple of values uniquely identifies an entry on a zcash blockchain.
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub struct NoteRecordIdentifier {
pub txid: TxId,
pub pool: PoolType,
pub index: u32,
}

impl std::fmt::Display for NoteRecordIdentifier {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"txid {}, {:?}, index {}",
self.txid, self.pool, self.index,
)
}
}

0 comments on commit d9685f4

Please sign in to comment.