Skip to content

Commit

Permalink
WIP: Create an in-memory wallet backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Mar 15, 2024
1 parent 1775f65 commit 64c7514
Show file tree
Hide file tree
Showing 13 changed files with 480 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ members = [

[workspace.package]
edition = "2021"
rust-version = "1.65"
rust-version = "1.69"
repository = "https://github.com/zcash/librustzcash"
license = "MIT OR Apache-2.0"
categories = ["cryptography::cryptocurrencies"]
Expand Down
4 changes: 2 additions & 2 deletions components/zcash_protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub mod memo;
pub mod value;

/// A Zcash shielded transfer protocol.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum ShieldedProtocol {
/// The Sapling protocol
Sapling,
Expand All @@ -34,7 +34,7 @@ pub enum ShieldedProtocol {
}

/// A value pool in the Zcash protocol.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum PoolType {
/// The transparent value pool
Transparent,
Expand Down
9 changes: 2 additions & 7 deletions components/zcash_protocol/src/memo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ impl Deref for TextMemo {
}

/// An unencrypted memo received alongside a shielded note in a Zcash transaction.
#[derive(Clone)]
#[derive(Clone, Default)]
pub enum Memo {
/// An empty memo field.
#[default]
Empty,
/// A memo field containing a UTF-8 string.
Text(TextMemo),
Expand All @@ -171,12 +172,6 @@ impl fmt::Debug for Memo {
}
}

impl Default for Memo {
fn default() -> Self {
Memo::Empty
}
}

impl PartialEq for Memo {
fn eq(&self, rhs: &Memo) -> bool {
match (self, rhs) {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.65.0"
channel = "1.69.0"
components = [ "clippy", "rustfmt" ]
3 changes: 3 additions & 0 deletions zcash_client_backend/src/data_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ pub mod error;
pub mod scanning;
pub mod wallet;

#[cfg(any(test, feature = "test-dependencies"))]
pub mod mem_wallet;

/// The height of subtree roots in the Sapling note commitment tree.
///
/// This conforms to the structure of subtree data returned by
Expand Down
Loading

0 comments on commit 64c7514

Please sign in to comment.