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

feat(autonomi): expose inner MerkleReg type #2426

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions autonomi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extension-module = ["pyo3/extension-module"]
bip39 = "2.0.0"
bls = { package = "blsttc", version = "8.0.1" }
bytes = { version = "1.0.1", features = ["serde"] }
crdts = { version = "7.3", default-features = false, features = ["merkle"] }
curv = { version = "0.10.1", package = "sn_curv", default-features = false, features = [
"num-bigint",
] }
Expand Down
7 changes: 7 additions & 0 deletions autonomi/src/client/registers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/// Register Secret Key
pub use bls::SecretKey as RegisterSecretKey;
use crdts::merkle_reg::MerkleReg;
use sn_evm::Amount;
use sn_evm::AttoTokens;
use sn_evm::EvmWalletError;
Expand Down Expand Up @@ -78,6 +79,12 @@ impl Register {
.collect()
}

/// Get the low-level CRDT of the register
pub fn inner_merkle_reg(&self) -> &MerkleReg<Vec<u8>> {
// Unstable method according to documentation.
self.crdt_reg.merkle_reg()
}

fn new(
initial_value: Option<Bytes>,
name: XorName,
Expand Down
2 changes: 2 additions & 0 deletions autonomi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ pub use utils::receipt_from_quotes_and_payments;
#[doc(no_inline)] // Place this under 'Re-exports' in the docs.
pub use bytes::Bytes;
#[doc(no_inline)] // Place this under 'Re-exports' in the docs.
pub use crdts::merkle_reg::MerkleReg;
#[doc(no_inline)] // Place this under 'Re-exports' in the docs.
pub use libp2p::Multiaddr;

pub use client::Client;
Expand Down
Loading