Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
RCasatta committed Aug 14, 2024
1 parent 4269728 commit 315f1bd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ json-contract = ["serde_json"]
base64 = ["bitcoin/base64"]

[dependencies]
bitcoin = "0.31.0"
secp256k1-zkp = { version = "0.10.0", features = ["global-context", "hashes"] }
bech32 = "0.11.0"
bitcoin = "0.32.2"
secp256k1-zkp = { version = "0.11.0", features = ["global-context", "hashes"] }

# Used for ContractHash::from_json_contract.
serde_json = { version = "1.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion src/blech32/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl<'s> UncheckedHrpstring<'s> {
}

let mut checksum_eng = checksum::Engine::<Ck>::new();
checksum_eng.input_hrp(&self.hrp());
checksum_eng.input_hrp(self.hrp());

// Unwrap ok since we checked all characters in our constructor.
for fe in self.data.iter().map(|&b| Fe32::from_char(b.into()).unwrap()) {
Expand Down
5 changes: 4 additions & 1 deletion src/blech32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ impl crate::bech32::Checksum for Blech32 {
0x7093e5a608865b,
];
const TARGET_RESIDUE: u64 = 1;

const CODE_LENGTH: usize = 9999; // TODO
}

/// The blech32m checksum algorithm.
Expand All @@ -54,5 +56,6 @@ impl crate::bech32::Checksum for Blech32m {
0x7093e5a608865b,
];
const TARGET_RESIDUE: u64 = 0x455972a3350f7a1;
}

const CODE_LENGTH: usize = 9999; // TODO
}
4 changes: 2 additions & 2 deletions src/blind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ mod tests {
SECP256K1,
&PrivateKey {
compressed: true,
network: Network::Regtest,
network: bitcoin::NetworkKind::Test,
inner: sk,
},
);
Expand All @@ -1475,7 +1475,7 @@ mod tests {
SECP256K1,
&PrivateKey {
compressed: true,
network: Network::Regtest,
network: bitcoin::NetworkKind::Test,
inner: blinding_sk,
},
);
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mod serde_utils;
// consider making upstream public
mod endian;
// re-export bitcoin deps which we re-use
pub use bitcoin::bech32;
pub(crate) use bech32;
pub use bitcoin::hashes;
// export everything at the top level so it can be used as `elements::Transaction` etc.
pub use crate::address::{Address, AddressParams, AddressError};
Expand Down

0 comments on commit 315f1bd

Please sign in to comment.