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

refactor: rename inner field names #393

Merged
merged 1 commit into from
Aug 18, 2023
Merged
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
8 changes: 4 additions & 4 deletions bdk-ffi/src/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::path::PathBuf;
use std::sync::{Arc, Mutex, MutexGuard};

pub(crate) struct Blockchain {
blockchain_mutex: Mutex<AnyBlockchain>,
inner_mutex: Mutex<AnyBlockchain>,
}

impl Blockchain {
Expand Down Expand Up @@ -52,16 +52,16 @@ impl Blockchain {
};
let blockchain = AnyBlockchain::from_config(&any_blockchain_config)?;
Ok(Self {
blockchain_mutex: Mutex::new(blockchain),
inner_mutex: Mutex::new(blockchain),
})
}

pub(crate) fn get_blockchain(&self) -> MutexGuard<AnyBlockchain> {
self.blockchain_mutex.lock().expect("blockchain")
self.inner_mutex.lock().expect("blockchain")
}

pub(crate) fn broadcast(&self, transaction: &Transaction) -> Result<(), BdkError> {
let tx = &transaction.internal;
let tx = &transaction.inner;
self.get_blockchain().broadcast(tx)
}

Expand Down
16 changes: 8 additions & 8 deletions bdk-ffi/src/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Descriptor {
keychain_kind: KeychainKind,
network: Network,
) -> Self {
let derivable_key = secret_key.descriptor_secret_key_mutex.lock().unwrap();
let derivable_key = secret_key.inner_mutex.lock().unwrap();

match derivable_key.deref() {
BdkDescriptorSecretKey::XPrv(descriptor_x_key) => {
Expand All @@ -61,7 +61,7 @@ impl Descriptor {
network: Network,
) -> Self {
let fingerprint = Fingerprint::from_str(fingerprint.as_str()).unwrap();
let derivable_key = public_key.descriptor_public_key_mutex.lock().unwrap();
let derivable_key = public_key.inner_mutex.lock().unwrap();

match derivable_key.deref() {
BdkDescriptorPublicKey::XPub(descriptor_x_key) => {
Expand All @@ -87,7 +87,7 @@ impl Descriptor {
keychain_kind: KeychainKind,
network: Network,
) -> Self {
let derivable_key = secret_key.descriptor_secret_key_mutex.lock().unwrap();
let derivable_key = secret_key.inner_mutex.lock().unwrap();

match derivable_key.deref() {
BdkDescriptorSecretKey::XPrv(descriptor_x_key) => {
Expand All @@ -112,7 +112,7 @@ impl Descriptor {
network: Network,
) -> Self {
let fingerprint = Fingerprint::from_str(fingerprint.as_str()).unwrap();
let derivable_key = public_key.descriptor_public_key_mutex.lock().unwrap();
let derivable_key = public_key.inner_mutex.lock().unwrap();

match derivable_key.deref() {
BdkDescriptorPublicKey::XPub(descriptor_x_key) => {
Expand All @@ -138,7 +138,7 @@ impl Descriptor {
keychain_kind: KeychainKind,
network: Network,
) -> Self {
let derivable_key = secret_key.descriptor_secret_key_mutex.lock().unwrap();
let derivable_key = secret_key.inner_mutex.lock().unwrap();

match derivable_key.deref() {
BdkDescriptorSecretKey::XPrv(descriptor_x_key) => {
Expand All @@ -163,7 +163,7 @@ impl Descriptor {
network: Network,
) -> Self {
let fingerprint = Fingerprint::from_str(fingerprint.as_str()).unwrap();
let derivable_key = public_key.descriptor_public_key_mutex.lock().unwrap();
let derivable_key = public_key.inner_mutex.lock().unwrap();

match derivable_key.deref() {
BdkDescriptorPublicKey::XPub(descriptor_x_key) => {
Expand All @@ -189,7 +189,7 @@ impl Descriptor {
keychain_kind: KeychainKind,
network: Network,
) -> Self {
let derivable_key = secret_key.descriptor_secret_key_mutex.lock().unwrap();
let derivable_key = secret_key.inner_mutex.lock().unwrap();

match derivable_key.deref() {
BdkDescriptorSecretKey::XPrv(descriptor_x_key) => {
Expand All @@ -214,7 +214,7 @@ impl Descriptor {
network: Network,
) -> Self {
let fingerprint = Fingerprint::from_str(fingerprint.as_str()).unwrap();
let derivable_key = public_key.descriptor_public_key_mutex.lock().unwrap();
let derivable_key = public_key.inner_mutex.lock().unwrap();

match derivable_key.deref() {
BdkDescriptorPublicKey::XPub(descriptor_x_key) => {
Expand Down
Loading