(&self, address: &Address, amount: Amount)
| 94 | } |
| 95 | |
| 96 | fn fund_input_by_cli(&self, address: &Address, amount: Amount) -> Txid { |
| 97 | let funding_command = format!("/srv/explorer/bitcoin/bin/bitcoin-cli -conf=/data/.bitcoin.conf -datadir=/data/bitcoin sendtoaddress {} {}", address, amount.to_btc()); |
| 98 | let command = format!( |
| 99 | r#"docker exec $(docker ps | grep blockstream/esplora | awk '{}') /bin/bash -c "{}""#, |
| 100 | "{print $1}", funding_command |
| 101 | ); |
| 102 | let output = Command::new("/bin/bash") |
| 103 | .args(["-c", command.as_str()]) |
| 104 | .output() |
| 105 | .unwrap_or_else(|_| panic!("failed to execute command: {}", command)); |
| 106 | |
| 107 | let txid = String::from_utf8_lossy(&output.stdout); |
| 108 | txid.trim() |
| 109 | .parse() |
| 110 | .unwrap_or_else(|_| panic!("error: {:?}", output)) |
| 111 | } |
| 112 | |
| 113 | async fn fund_input_with_retry(&self, address: &Address, amount: Amount) -> Txid { |
| 114 | let client_err_handler = |e: Error| { |
no outgoing calls
no test coverage detected