Skip to content

Commit

Permalink
update bip300301 dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash-L2L committed May 8, 2024
1 parent a0d8967 commit 96b43bd
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 19 deletions.
83 changes: 77 additions & 6 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ authors = [
"Nikita Chashchinskii <[email protected]>"
]
edition = "2021"
version = "0.8.2"
version = "0.8.3"

[workspace.dependencies.bip300301]
git = "https://github.com/Ash-L2L/bip300301.git"
rev = "e47a263c8cbf9c520aa80f71788ee28e9f11bb62"
rev = "64568dee7b89fe8c021226f10b17a18fe3386871"

[workspace.dependencies.rustreexo]
git = "https://github.com/Ash-L2L/rustreexo.git"
Expand Down
6 changes: 3 additions & 3 deletions lib/archive.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::cmp::Ordering;

use bip300301::{
bitcoin::{self, block::Header as BitcoinHeader, hashes::Hash},
DepositInfo,
bitcoin::{self, hashes::Hash},
DepositInfo, Header as BitcoinHeader,
};
use fallible_iterator::FallibleIterator;
use heed::{types::SerdeBincode, Database, RoTxn, RwTxn};
Expand Down Expand Up @@ -328,7 +328,7 @@ impl Archive {
{
return Err(Error::NoMainHeader(header.prev_blockhash));
}
let block_hash = header.block_hash();
let block_hash = header.hash;
let total_work =
if header.prev_blockhash != bitcoin::BlockHash::all_zeros() {
let prev_work =
Expand Down
12 changes: 4 additions & 8 deletions lib/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ use std::{
};

use bip300301::{
bitcoin::{
self,
block::{self, Header as BitcoinHeader},
hashes::Hash,
},
DepositInfo,
bitcoin::{self, hashes::Hash},
DepositInfo, Header as BitcoinHeader,
};
use fallible_iterator::{FallibleIterator, IteratorExt};
use futures::{stream, StreamExt, TryFutureExt};
Expand Down Expand Up @@ -168,7 +164,7 @@ async fn request_two_way_peg_data(
.await?;
let mut rwtxn = env.write_txn()?;
// Deposits by block, first-to-last within each block
let deposits_by_block: HashMap<block::BlockHash, Vec<DepositInfo>> = {
let deposits_by_block: HashMap<bitcoin::BlockHash, Vec<DepositInfo>> = {
let mut deposits = HashMap::<_, Vec<_>>::new();
two_way_peg_data.deposits.into_iter().for_each(|deposit| {
deposits
Expand Down Expand Up @@ -289,10 +285,10 @@ async fn submit_block(
header: &Header,
body: &Body,
) -> Result<(), Error> {
let mut rwtxn = env.write_txn()?;
// Request mainchain headers if they do not exist
request_ancestor_headers(env, archive, drivechain, header.prev_main_hash)
.await?;
let mut rwtxn = env.write_txn()?;
let () = connect_tip_(
&mut rwtxn, archive, drivechain, mempool, state, header, body,
)
Expand Down

0 comments on commit 96b43bd

Please sign in to comment.