diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8c25caaa..d05a3018c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Use Nightly uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2024-04-25 + toolchain: nightly-2024-07-21 override: true - name: Cache uses: actions/cache@v4 @@ -38,9 +38,9 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --verbose --no-default-features --features=full,feat-ibc,testnet + args: --verbose --no-default-features --features=full - test-all-features: + test-testnet: runs-on: ubuntu-latest steps: - name: Checkout @@ -48,7 +48,7 @@ jobs: - name: Use Nightly uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2024-04-25 + toolchain: nightly-2024-07-21 override: true - name: Cache uses: actions/cache@v4 @@ -56,14 +56,14 @@ jobs: path: | ~/.cargo ./target - key: ${{ runner.os }}-test-all-features-${{ hashFiles('Cargo.lock') }} + key: ${{ runner.os }}-test-testnet-${{ hashFiles('Cargo.lock') }} restore-keys: | - ${{ runner.os }}-test-all-features- + ${{ runner.os }}-test-testnet- - name: Test uses: actions-rs/cargo@v1 with: command: test - args: --verbose --all-features + args: --verbose --no-default-features --features=full,testnet test-bitcoin: runs-on: ubuntu-latest @@ -73,7 +73,7 @@ jobs: - name: Use Nightly uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2024-04-25 + toolchain: nightly-2024-07-21 override: true - name: Cache uses: actions/cache@v4 @@ -81,16 +81,16 @@ jobs: path: | ~/.cargo ./target - key: ${{ runner.os }}-test-all-features-${{ hashFiles('Cargo.lock') }} + key: ${{ runner.os }}-test-testnet-${{ hashFiles('Cargo.lock') }} restore-keys: | - ${{ runner.os }}-test-all-features- + ${{ runner.os }}-test-testnet- - name: Test env: RUST_LOG: info uses: actions-rs/cargo@v1 with: command: test - args: --verbose --all-features bitcoin -- --ignored + args: --verbose --features=devnet bitcoin -- --ignored check-rest: runs-on: ubuntu-latest @@ -100,7 +100,7 @@ jobs: - name: Use Nightly uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2024-04-25 + toolchain: nightly-2024-07-21 override: true - name: Check Rest uses: actions-rs/cargo@v1 @@ -116,7 +116,7 @@ jobs: - name: Use Nightly uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2024-04-25 + toolchain: nightly-2024-07-21 override: true - name: Install run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh @@ -132,7 +132,7 @@ jobs: - name: Use Nightly uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2024-04-25 + toolchain: nightly-2024-07-21 components: llvm-tools-preview override: true - name: Cache @@ -155,7 +155,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: llvm-cov - args: --no-cfg-coverage-nightly --no-default-features --features=full,feat-ibc,testnet --workspace --lcov --output-path lcov.info + args: --no-cfg-coverage-nightly --workspace --lcov --output-path lcov.info - name: Upload to codecov.io uses: codecov/codecov-action@v1 with: @@ -171,7 +171,7 @@ jobs: - name: Use Nightly uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2024-04-25 + toolchain: nightly-2024-07-21 components: rustfmt override: true - name: Check @@ -188,7 +188,7 @@ jobs: - name: Use Nightly uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2024-04-25 + toolchain: nightly-2024-07-21 components: clippy override: true - name: Cache @@ -204,4 +204,4 @@ jobs: uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --no-default-features --features=full,feat-ibc,testnet -- -D warnings + args: -- -D warnings diff --git a/Cargo.lock b/Cargo.lock index b0ef3b94a..01db8e20e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2893,7 +2893,7 @@ dependencies = [ [[package]] name = "frost-core" version = "1.0.0" -source = "git+https://github.com/ZcashFoundation/frost?rev=20c2c98a931c564655e2a03719e19ba916e11545#20c2c98a931c564655e2a03719e19ba916e11545" +source = "git+https://github.com/ZcashFoundation/frost?rev=51fa7d09f3742563a35d065afcff6ad486430dac#51fa7d09f3742563a35d065afcff6ad486430dac" dependencies = [ "byteorder", "const-crc32", @@ -2914,7 +2914,7 @@ dependencies = [ [[package]] name = "frost-rerandomized" version = "1.0.0" -source = "git+https://github.com/ZcashFoundation/frost?rev=20c2c98a931c564655e2a03719e19ba916e11545#20c2c98a931c564655e2a03719e19ba916e11545" +source = "git+https://github.com/ZcashFoundation/frost?rev=51fa7d09f3742563a35d065afcff6ad486430dac#51fa7d09f3742563a35d065afcff6ad486430dac" dependencies = [ "derive-getters", "document-features", @@ -2925,7 +2925,7 @@ dependencies = [ [[package]] name = "frost-secp256k1-tr" version = "1.0.0" -source = "git+https://github.com/ZcashFoundation/frost?rev=20c2c98a931c564655e2a03719e19ba916e11545#20c2c98a931c564655e2a03719e19ba916e11545" +source = "git+https://github.com/ZcashFoundation/frost?rev=51fa7d09f3742563a35d065afcff6ad486430dac#51fa7d09f3742563a35d065afcff6ad486430dac" dependencies = [ "document-features", "frost-core", diff --git a/Cargo.toml b/Cargo.toml index dbb22ef64..824388482 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ lazy_static = "1.4.0" prost = "0.13.3" cosmrs = "0.14.0" ripemd = "0.1.3" -frost-secp256k1-tr = { git = "https://github.com/ZcashFoundation/frost", rev = "20c2c98a931c564655e2a03719e19ba916e11545", features = [ +frost-secp256k1-tr = { git = "https://github.com/ZcashFoundation/frost", rev = "51fa7d09f3742563a35d065afcff6ad486430dac", features = [ "nightly", ], optional = true } bitcoin = { version = "0.29.2", features = ["serde", "rand"] } @@ -154,6 +154,9 @@ babylon = ["frost"] [profile.release] overflow-checks = true +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } + [[bin]] name = "nomic" diff --git a/README.md b/README.md index 07a7e1aa8..638ebe341 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ![CI](https://github.com/nomic-io/nomic/actions/workflows/ci.yml/badge.svg) -Nomic is a blockchain which offers a decentralized custody solution for Bitcoin. Built on Turbofish’s [Orga](https://github.com/turbofish-org/orga), a custom high-performance blockchain application framework. Nomic mints nBTC, a token backed 1:1 with BTC, using [IBC](https://www.ibcprotocol.dev/) for secure and efficient bridging. +Nomic is a blockchain that offers a decentralized custody solution for Bitcoin. Built on Turbofish’s [Orga](https://github.com/turbofish-org/orga), a custom high-performance blockchain application framework. Nomic mints nBTC, a token backed 1:1 with BTC, using [IBC](https://www.ibcprotocol.dev/) for secure and efficient bridging. ## Running a Node @@ -36,7 +36,7 @@ Nomic is an open-source project spearheaded by contributors. Anyone is able to c Nomic is currently undergoing security audits. -Vulnerabilities should not be reported through public channels, including GitHub Issues. You can report a vunerability via GitHub's Private Vunerability Reporting or via the Nomic DAO Foundation at `foundation@nomic.io`. +Vulnerabilities should not be reported through public channels, including GitHub Issues. You can report a vulnerability via GitHub's Private Vulnerability Reporting or via the Nomic DAO Foundation at `foundation@nomic.io`. [Report a Vulnerability](https://github.com/nomic-io/nomic/security/advisories/new) diff --git a/src/app.rs b/src/app.rs index ab604654f..f9833eb83 100644 --- a/src/app.rs +++ b/src/app.rs @@ -97,8 +97,10 @@ const IBC_FEE_USATS: u64 = 1_000_000; /// The fixed amount of nBTC fee required to make any application call, in /// micro-satoshis. const CALL_FEE_USATS: u64 = 100_000_000; + /// The fixed amount of nBTC fee required to create a new Ethereum connection, /// in micro-satoshis. +#[cfg(feature = "ethereum")] const ETH_CREATE_CONNECTION_FEE_USATS: u64 = 10_000_000_000; const OSMOSIS_CHANNEL_ID: &str = "channel-1"; @@ -2023,9 +2025,10 @@ impl Default for Dest { } } -#[derive(Encode, Decode, Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] +#[derive(Encode, Decode, Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)] #[serde(tag = "type", rename_all = "camelCase")] pub enum Identity { + #[default] None, NativeAccount { address: Address, @@ -2103,12 +2106,6 @@ impl Describe for Identity { } } -impl Default for Identity { - fn default() -> Self { - Identity::None - } -} - pub fn ibc_fee(amount: Amount) -> Result { let fee_rate: orga::coins::Decimal = "0.005".parse().unwrap(); (amount * fee_rate)?.amount() diff --git a/src/bin/nomic.rs b/src/bin/nomic.rs index 42f3d863e..31a0ca015 100644 --- a/src/bin/nomic.rs +++ b/src/bin/nomic.rs @@ -15,16 +15,16 @@ use alloy_signer_local::LocalSigner; use bitcoin::consensus::{Decodable, Encodable}; #[cfg(feature = "ethereum")] use bitcoin::secp256k1::Message; -use bitcoin::secp256k1::{self, SecretKey}; +use bitcoin::secp256k1::{self}; use bitcoin::util::bip32::ExtendedPubKey; use bitcoincore_rpc_async::RpcApi; use bitcoincore_rpc_async::{Auth, Client as BtcClient}; use clap::Parser; +use nomic::app::Dest; use nomic::app::IbcDest; use nomic::app::InnerApp; use nomic::app::Nom; -use nomic::app::{Dest, Identity}; #[cfg(feature = "babylon")] use nomic::babylon; use nomic::bitcoin::adapter::Adapter; @@ -325,7 +325,7 @@ pub struct StartCmd { /// home directory when initializing. #[clap(long)] pub validator_key: Option, - /// Copies the P2P privaete key at the specified path to the node's home + /// Copies the P2P private key at the specified path to the node's home /// directory when initializing. #[clap(long)] pub node_key: Option, @@ -2265,7 +2265,7 @@ impl SigningStatusCmd { } /// Attempts to recover a deposit which has not yet been processed by the -/// Nomic network by relaying a proof of its confirmation on the Bitcoin +/// Nomic network by relaying proof of its confirmation on the Bitcoin /// network. /// /// This command is useful when a deposit has been made to the network and @@ -2306,7 +2306,7 @@ pub struct RecoverDepositCmd { /// The Nomic bech32 wallet address associated with the deposit. #[clap(long)] nomic_addr: Address, - /// The Bitcoin address the deposit was made to. + /// The Bitcoin address to the deposit was made to. #[clap(long)] deposit_addr: bitcoin::Address, /// The Bitcoin block hash the deposit transaction was confirmed in. @@ -2320,7 +2320,7 @@ pub struct RecoverDepositCmd { #[clap(long)] vout: u32, - /// The path to a file containig the indexes and reserve scripts of + /// The path to a file containing the indexes and reserve scripts of /// signatories to search. This can be generated with the /// `get-reserve-scripts` binary. #[clap(long)] diff --git a/src/bitcoin/checkpoint.rs b/src/bitcoin/checkpoint.rs index a15d687e0..ee9669d22 100644 --- a/src/bitcoin/checkpoint.rs +++ b/src/bitcoin/checkpoint.rs @@ -2449,19 +2449,13 @@ mod test { #[cfg(feature = "full")] use bitcoin::{ secp256k1::Secp256k1, - util::bip32::{ChildNumber, ExtendedPrivKey, ExtendedPubKey}, - OutPoint, PubkeyHash, Script, Txid, + util::bip32::{ExtendedPrivKey, ExtendedPubKey}, + OutPoint, Script, Txid, }; - use orga::{ - collections::EntryMap, - context::Context, - secp256k1::{PublicKey, SecretKey}, - }; - #[cfg(feature = "full")] - use rand::Rng; + use orga::{collections::EntryMap, context::Context}; #[cfg(feature = "full")] - use crate::bitcoin::{signatory::Signatory, threshold_sig::Share}; + use crate::bitcoin::signatory::Signatory; use super::*; @@ -2674,7 +2668,7 @@ mod test { let xpub = ExtendedPubKey::from_priv(&secp, &xpriv); let mut sig_keys = Map::new(); - sig_keys.insert([0; 32], Xpub::new(xpub)); + sig_keys.insert([0; 32], Xpub::new(xpub)).unwrap(); let queue = Rc::new(RefCell::new(CheckpointQueue::default())); queue.borrow_mut().config = Config { @@ -2707,7 +2701,7 @@ mod test { .unwrap(); }; let push_deposit = || { - let mut input = Input::new( + let input = Input::new( OutPoint { txid: Txid::from_slice(&[0; 32]).unwrap(), vout: 0, @@ -2733,7 +2727,7 @@ mod test { let mut queue = queue.borrow_mut(); let cp = queue.signing().unwrap().unwrap(); let sigset_index = cp.sigset.index; - let to_sign = cp.to_sign(Xpub::new(xpub.clone())).unwrap(); + let to_sign = cp.to_sign(Xpub::new(xpub)).unwrap(); let secp2 = Secp256k1::signing_only(); let sigs = crate::bitcoin::signer::sign(&secp2, &xpriv, &to_sign).unwrap(); drop(cp); @@ -2748,7 +2742,7 @@ mod test { sign_batch(btc_height); } }; - let confirm_cp = |index, btc_height| { + let confirm_cp = |index, _btc_height| { let mut queue = queue.borrow_mut(); queue.confirmed_index = Some(index); }; @@ -2884,7 +2878,7 @@ mod test { let xpub = ExtendedPubKey::from_priv(&secp, &xpriv); let mut sig_keys = Map::new(); - sig_keys.insert([0; 32], Xpub::new(xpub)); + sig_keys.insert([0; 32], Xpub::new(xpub)).unwrap(); let queue = Rc::new(RefCell::new(CheckpointQueue::default())); queue.borrow_mut().config = Config { @@ -2922,7 +2916,7 @@ mod test { .unwrap(); }; let push_deposit = || { - let mut input = Input::new( + let input = Input::new( OutPoint { txid: Txid::from_slice(&[0; 32]).unwrap(), vout: 0, @@ -2948,7 +2942,7 @@ mod test { let mut queue = queue.borrow_mut(); let cp = queue.signing().unwrap().unwrap(); let sigset_index = cp.sigset.index; - let to_sign = cp.to_sign(Xpub::new(xpub.clone())).unwrap(); + let to_sign = cp.to_sign(Xpub::new(xpub)).unwrap(); let secp2 = Secp256k1::signing_only(); let sigs = crate::bitcoin::signer::sign(&secp2, &xpriv, &to_sign).unwrap(); drop(cp); @@ -2963,7 +2957,7 @@ mod test { sign_batch(btc_height); } }; - let confirm_cp = |index, btc_height| { + let confirm_cp = |index, _btc_height| { let mut queue = queue.borrow_mut(); queue.confirmed_index = Some(index); }; @@ -3012,9 +3006,11 @@ mod test { } fn sigset(n: u32) -> SignatorySet { - let mut sigset = SignatorySet::default(); - sigset.index = n; - sigset.create_time = n as u64; + let mut sigset = SignatorySet { + index: n, + create_time: n as u64, + ..Default::default() + }; let secret = bitcoin::secp256k1::SecretKey::from_slice(&[(n + 1) as u8; 32]).unwrap(); let pubkey: Pubkey = bitcoin::secp256k1::PublicKey::from_secret_key( @@ -3024,7 +3020,7 @@ mod test { .into(); sigset.signatories.push(Signatory { - pubkey: pubkey.into(), + pubkey, voting_power: 100, }); @@ -3036,8 +3032,10 @@ mod test { #[test] fn backfill_basic() { - let mut queue = CheckpointQueue::default(); - queue.index = 10; + let mut queue = CheckpointQueue { + index: 10, + ..Default::default() + }; queue .queue .push_back(Checkpoint::new(sigset(7)).unwrap()) @@ -3091,8 +3089,10 @@ mod test { #[test] fn backfill_with_zeroth() { - let mut queue = CheckpointQueue::default(); - queue.index = 1; + let mut queue = CheckpointQueue { + index: 1, + ..Default::default() + }; queue .queue .push_back(Checkpoint::new(sigset(1)).unwrap()) diff --git a/src/bitcoin/mod.rs b/src/bitcoin/mod.rs index 9b83d3344..d06ce45b2 100644 --- a/src/bitcoin/mod.rs +++ b/src/bitcoin/mod.rs @@ -1279,7 +1279,7 @@ where #[cfg(test)] mod tests { - use std::{cell::RefCell, fs, rc::Rc}; + use std::{cell::RefCell, rc::Rc}; use bitcoin::{ secp256k1::Secp256k1, util::bip32::ExtendedPrivKey, BlockHash, BlockHeader, OutPoint, @@ -1287,8 +1287,6 @@ mod tests { }; use orga::collections::EntryMap; - use crate::app::InnerApp; - use super::{ header_queue::{WorkHeader, WrappedHeader}, *, @@ -1366,7 +1364,7 @@ mod tests { Rc::new(RefCell::new(Some(EntryMap::new()))), Rc::new(RefCell::new(Some(Map::new()))), ); - let addr = vec![Address::from_pubkey([0; 33]), Address::from_pubkey([1; 33])]; + let addr = [Address::from_pubkey([0; 33]), Address::from_pubkey([1; 33])]; vals.set_voting_power([0; 32], 100); vals.set_operator([0; 32], addr[0])?; vals.set_voting_power([1; 32], 10); @@ -1382,7 +1380,7 @@ mod tests { }; let secp = Secp256k1::new(); - let xpriv = vec![ + let xpriv = [ ExtendedPrivKey::new_master(super::NETWORK, &[0]).unwrap(), ExtendedPrivKey::new_master(super::NETWORK, &[1]).unwrap(), ]; diff --git a/src/bitcoin/signatory.rs b/src/bitcoin/signatory.rs index ee5f253c6..46d599da5 100644 --- a/src/bitcoin/signatory.rs +++ b/src/bitcoin/signatory.rs @@ -631,7 +631,7 @@ mod tests { let (sigset, commitment) = SignatorySet::from_script(&script, (2, 3)).unwrap(); - let pk = |bytes| Pubkey::new(bytes).unwrap().into(); + let pk = |bytes| Pubkey::new(bytes).unwrap(); assert_eq!( sigset, SignatorySet { diff --git a/src/bitcoin/signer.rs b/src/bitcoin/signer.rs index a52e5ef6e..cda64c827 100644 --- a/src/bitcoin/signer.rs +++ b/src/bitcoin/signer.rs @@ -95,16 +95,16 @@ where /// - `key_path`: The path to the file containing the extended private key, /// or where it should be written if it does not yet exist. /// - `max_withdrawal_rate`: The maximum rate at which Bitcoin can be - /// withdrawn from the reserve in a 24-hour period, temporarily halting - /// signing if the limit is reached. + /// withdrawn from the reserve in a 24-hour period, temporarily halting + /// signing if the limit is reached. /// - `max_sigset_change_rate`: The maximum rate at which the signatory set - /// can change in a 24-hour period, temporarily halting signing if the limit - /// is reached. + /// can change in a 24-hour period, temporarily halting signing if the + /// limit is reached. /// - `min_checkpoint_seconds`: The minimum amount of time that must pass - /// before this signer will contribute its signature. + /// before this signer will contribute its signature. /// - `reset_index`: A checkpoint index at which the rate limits should be - /// reset, used to manually override the limits if the signer has checked on - /// the pending withdrawals and decided they are legitimate. + /// reset, used to manually override the limits if the signer has checked + /// on the pending withdrawals and decided they are legitimate. /// - `app_client`: A function that returns a new app client to be used in /// querying and submitting calls. #[allow(clippy::too_many_arguments)] @@ -150,21 +150,21 @@ where /// /// **Parameters:** /// - `op_addr`: The operator address of the submitter. Used to check if the - /// operator has already submitted a signatory key. - /// - `xpriv`: The extended private key to use for signing. + /// operator has already submitted a signatory key. + /// - `xprivs`: The extended private keys to use for signing. /// - `max_withdrawal_rate`: The maximum rate at which Bitcoin can be - /// withdrawn from the reserve in a 24-hour period, temporarily halting - /// signing if the limit is reached. + /// withdrawn from the reserve in a 24-hour period, temporarily halting + /// signing if the limit is reached. /// - `max_sigset_change_rate`: The maximum rate at which the signatory set - /// can change in a 24-hour period, temporarily halting signing if the limit - /// is reached. + /// can change in a 24-hour period, temporarily halting signing if the + /// limit is reached. /// - `min_blocks_per_checkpoint`: The minimum number of new Bitcoin blocks - /// that must be mined before this signer will contribute its signature. + /// that must be mined before this signer will contribute its signature. /// - `reset_index`: A checkpoint index at which the rate limits should be - /// reset, used to manually override the limits if the signer has checked on - /// the pending withdrawals and decided they are legitimate. + /// reset, used to manually override the limits if the signer has checked + /// on the pending withdrawals and decided they are legitimate. /// - `app_client`: A function that returns a new app client to be used in - /// querying and submitting calls. + /// querying and submitting calls. pub fn new( op_addr: Address, xprivs: Vec, @@ -542,7 +542,7 @@ mod test { ) .unwrap(); - assert!(signer.xprivs.get(0).unwrap() == &xpriv); + assert!(signer.xprivs.first().unwrap() == &xpriv); } #[test] @@ -568,7 +568,7 @@ mod test { ) .unwrap(); assert!(signer.xprivs.len() == 1); - assert!(signer.xprivs.get(0).unwrap() == &xpriv); + assert!(signer.xprivs.first().unwrap() == &xpriv); } #[test] diff --git a/tests/bitcoin.rs b/tests/bitcoin.rs index b8af5495d..cd231775b 100644 --- a/tests/bitcoin.rs +++ b/tests/bitcoin.rs @@ -551,7 +551,7 @@ async fn bitcoin_test() { } } } - assert_eq!(signatory_balance, 49992973); + assert_eq!(signatory_balance, 49992985); let funded_account_balances: Vec<_> = funded_accounts .iter() diff --git a/tests/ibc.rs b/tests/ibc.rs index ab0f33130..6029f35eb 100644 --- a/tests/ibc.rs +++ b/tests/ibc.rs @@ -30,7 +30,6 @@ use orga::client::{ AppClient, }; use orga::coins::{Address, Amount}; -use orga::encoding::Adapter as EdAdapter; use orga::encoding::Encode; use orga::ibc::GrpcOpts; use orga::ibc::IbcTimestamp as Timestamp; @@ -106,7 +105,7 @@ pub async fn broadcast_deposit_addr( match res.status() { StatusCode::OK => Ok(()), - _ => Err(Error::Relayer(format!("{}", res.text().await.unwrap()))), + _ => Err(Error::Relayer(res.text().await.unwrap().to_string())), } } @@ -143,7 +142,7 @@ async fn direct_deposit_bitcoin( let script = sigset.output_script(dest.commitment_bytes()?.as_slice(), threshold)?; let btc_addr = bitcoin::Address::from_script(&script, nomic::bitcoin::NETWORK).unwrap(); - let url = format!("{}/address", "http://localhost:8999".to_string(),); + let url = format!("{}/address", "http://localhost:8999",); let client = reqwest::Client::new(); let res = client .post(url) @@ -171,7 +170,7 @@ async fn direct_deposit_bitcoin( match res.status() { StatusCode::OK => Ok(()), - _ => Err(Error::Relayer(format!("{}", res.text().await.unwrap()))), + _ => Err(Error::Relayer(res.text().await.unwrap().to_string())), } } @@ -313,7 +312,7 @@ async fn ibc_test() { ); let checkpoints = relayer.start_checkpoint_relay(); - let mut relayer = Relayer::new( + let relayer = Relayer::new( test_bitcoin_client(rpc_url.clone(), cookie_file.clone()).await, rpc_addr.clone(), ); @@ -697,10 +696,7 @@ async fn ibc_test() { "--timeout-seconds", "300", "--memo", - &format!( - "withdraw:{}", - funded_accounts[1].bitcoin_address().to_string() - ), + &format!("withdraw:{}", funded_accounts[1].bitcoin_address()), ]) .spawn() .unwrap() diff --git a/tests/node.rs b/tests/node.rs index fd7183aa3..0db4f9b9c 100644 --- a/tests/node.rs +++ b/tests/node.rs @@ -5,7 +5,6 @@ use orga::abci::Node; use orga::plugins::Time; use serial_test::serial; use std::sync::Once; -use std::time::Duration; use tempfile::tempdir; static INIT: Once = Once::new();