Skip to content

Commit

Permalink
Add empty method for the Note
Browse files Browse the repository at this point in the history
Resolves #156
  • Loading branch information
moCello committed Apr 30, 2024
1 parent 03446b7 commit 3b2efb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `empty` method for the `Note` [#165]

## [0.27.0] - 2024-04-24

### Added
Expand Down Expand Up @@ -284,6 +288,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Canonical implementation shielded by feature.

<!-- ISSUES -->
[#165]: https://github.com/dusk-network/phoenix-core/issues/165
[#156]: https://github.com/dusk-network/phoenix-core/issues/156
[#155]: https://github.com/dusk-network/phoenix-core/issues/155
[#152]: https://github.com/dusk-network/phoenix-core/issues/152
Expand Down
11 changes: 11 additions & 0 deletions src/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ impl Note {
Self::new(rng, NoteType::Obfuscated, pk, value, blinding_factor)
}

/// Creates a new empty [`Note`]
pub fn empty() -> Self {
Self {
note_type: NoteType::Transparent,
value_commitment: JubJubExtended::default(),
stealth_address: StealthAddress::default(),
pos: 0,
encryption: [0; ENCRYPTION_SIZE],
}
}

fn decrypt_data(
&self,
vk: &ViewKey,
Expand Down

0 comments on commit 3b2efb6

Please sign in to comment.