Skip to content

Commit

Permalink
Create wallet for every bitcoin node
Browse files Browse the repository at this point in the history
  • Loading branch information
jfldde committed Oct 30, 2024
1 parent a3bd67c commit 6727286
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
4 changes: 4 additions & 0 deletions src/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ impl BitcoinNodeCluster {
pub fn get_mut(&mut self, index: usize) -> Option<&mut BitcoinNode> {
self.inner.get_mut(index)
}

pub fn iter(&self) -> std::slice::Iter<'_, BitcoinNode> {
self.inner.iter()
}
}

async fn wait_for_rpc_ready(client: &Client, timeout: Option<Duration>) -> Result<()> {
Expand Down
32 changes: 17 additions & 15 deletions src/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,24 @@ impl TestFramework {
}

pub async fn fund_da_wallets(&mut self) -> Result<()> {
let da = self.bitcoin_nodes.get(0).unwrap();

da.create_wallet(&NodeKind::Sequencer.to_string(), None, None, None, None)
.await?;
da.create_wallet(&NodeKind::BatchProver.to_string(), None, None, None, None)
.await?;
da.create_wallet(
&NodeKind::LightClientProver.to_string(),
None,
None,
None,
None,
)
.await?;
da.create_wallet(&NodeKind::Bitcoin.to_string(), None, None, None, None)
for da in self.bitcoin_nodes.iter() {
da.create_wallet(&NodeKind::Sequencer.to_string(), None, None, None, None)
.await?;
da.create_wallet(&NodeKind::BatchProver.to_string(), None, None, None, None)
.await?;
da.create_wallet(
&NodeKind::LightClientProver.to_string(),
None,
None,
None,
None,
)
.await?;
da.create_wallet(&NodeKind::Bitcoin.to_string(), None, None, None, None)
.await?;
}

let da = self.bitcoin_nodes.get(0).unwrap();

let blocks_to_mature = 100;
let blocks_to_fund = 25;
Expand Down

0 comments on commit 6727286

Please sign in to comment.