Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add an in-memory wallet backend framework #1293

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
64c7514
WIP: Create an in-memory wallet backend.
nuttycom Jan 19, 2021
d013322
Merge remote-tracking branch 'upstream/main' into memory_wallet_db
nuttycom Mar 20, 2024
9926057
zcash_client_backend: Use `BTreeMap` instead of `HashMap` for mem_wal…
nuttycom Mar 20, 2024
5ef5f04
zcash_client_backend: Add `MemoryWalletDb::new()`
nuttycom Mar 20, 2024
b39765c
fix build bu hiding orchard fields in `new()` behind a flag
oxarbitrage Mar 20, 2024
fc757b1
Merge pull request #1295 from oxarbitrage/memory_wallet_fix_build
nuttycom Mar 21, 2024
69c1e68
create a very basic `put_blocks` function for the memory wallet
oxarbitrage Mar 21, 2024
09e8bc9
Merge remote-tracking branch 'origin/memory_wallet_db' into memory_wa…
oxarbitrage Mar 21, 2024
9c0c6b0
append sapling noie commitments to database
oxarbitrage Mar 22, 2024
4d3c441
remove non needed pubs
oxarbitrage Apr 2, 2024
7f74621
remove chain_height code
oxarbitrage Apr 2, 2024
0393a69
add orchard spends
oxarbitrage Apr 2, 2024
a4323c2
add sapling and orchard trees
oxarbitrage Apr 2, 2024
a3b4de0
use sapling-crypto v0.1.3
oxarbitrage Apr 2, 2024
370a4aa
populate orchard note commitment trees
oxarbitrage Apr 2, 2024
b1a0fcc
use batch_insert
oxarbitrage Apr 2, 2024
23a2ae8
add the memos
oxarbitrage Apr 3, 2024
2f28306
mark spent notes
oxarbitrage Apr 3, 2024
588156f
fix note commitment tree starting position
oxarbitrage Apr 3, 2024
f77dfc1
use all accounts in the wallet
oxarbitrage Apr 9, 2024
147c033
remove todo comment
oxarbitrage Apr 9, 2024
cbb49b4
fix incorrect start note commitment position
oxarbitrage Apr 11, 2024
c9a236e
clippy
oxarbitrage Apr 16, 2024
21313a2
Merge remote-tracking branch 'upstream/main' into memory_wallet_db
nuttycom Apr 18, 2024
5d2cd6f
Merge pull request #1298 from oxarbitrage/basic-put-block
nuttycom Apr 18, 2024
29e2043
Merge remote-tracking branch 'upstream/main' into memory_wallet_db
nuttycom Apr 23, 2024
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
70 changes: 35 additions & 35 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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 @@ -107,6 +107,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
Loading