Skip to content

Commit

Permalink
build(deps): update rust-toolchain to 1.67 and bump uuid to 1.4
Browse files Browse the repository at this point in the history
some of the dependency updates are requiring a higher version of the
rust toolchain. bump to 1.67 and fix new clippy lints.

also fix dprint to 0.39.1 because 0.40 has breaking changes.
  • Loading branch information
delta1 committed Jul 31, 2023
1 parent 0dbdf51 commit acdba84
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 29 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.63
toolchain: 1.67
components: clippy,rustfmt

- uses: Swatinem/[email protected]

- name: Check formatting
uses: dprint/[email protected]
with:
dprint-version: 0.39.1

- name: Run clippy with default features
run: cargo clippy --workspace --all-targets -- -D warnings
Expand Down Expand Up @@ -82,7 +84,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.63
toolchain: 1.67
targets: armv7-unknown-linux-gnueabihf

- name: Build binary
Expand Down
37 changes: 22 additions & 15 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Please have a look at the [contribution guidelines](./CONTRIBUTING.md).
## Rust Version Support

Please note that only the latest stable Rust toolchain is supported.
All stable toolchains since 1.63 _should_ work.
All stable toolchains since 1.67 _should_ work.

## Contact

Expand Down
2 changes: 1 addition & 1 deletion monero-harness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl<'c> Monerod {
/// address
pub async fn start_miner(&self, miner_wallet_address: &str) -> Result<()> {
let monerod = self.client().clone();
let _ = tokio::spawn(mine(monerod, miner_wallet_address.to_string()));
tokio::spawn(mine(monerod, miner_wallet_address.to_string()));
Ok(())
}
}
Expand Down
2 changes: 1 addition & 1 deletion monero-rpc/src/monerod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ mod monero_serde_hex_block {
{
let hex = String::deserialize(deserializer)?;

let bytes = hex::decode(&hex).map_err(D::Error::custom)?;
let bytes = hex::decode(hex).map_err(D::Error::custom)?;
let mut cursor = Cursor::new(bytes);

let block = monero::Block::consensus_decode(&mut cursor).map_err(D::Error::custom)?;
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.63" # also update this in the readme, changelog, and github actions
channel = "1.67" # also update this in the readme, changelog, and github actions
components = ["clippy"]
targets = ["armv7-unknown-linux-gnueabihf"]
2 changes: 1 addition & 1 deletion swap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ tracing-appender = "0.2"
tracing-futures = { version = "0.2", features = [ "std-future", "futures-03" ] }
tracing-subscriber = { version = "0.3", default-features = false, features = [ "fmt", "ansi", "env-filter", "time", "tracing-log", "json" ] }
url = { version = "2", features = [ "serde" ] }
uuid = { version = "1.3", features = [ "serde", "v4" ] }
uuid = { version = "1.4", features = [ "serde", "v4" ] }
void = "1"

[target.'cfg(not(windows))'.dependencies]
Expand Down
9 changes: 6 additions & 3 deletions swap/src/bitcoin/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Wallet {
) -> Result<Self> {
let data_dir = data_dir.as_ref();
let wallet_dir = data_dir.join(WALLET);
let database = bdk::sled::open(&wallet_dir)?.open_tree(SLED_TREE_NAME)?;
let database = bdk::sled::open(wallet_dir)?.open_tree(SLED_TREE_NAME)?;
let network = env_config.bitcoin_network;

let wallet = match bdk::Wallet::new(
Expand Down Expand Up @@ -97,7 +97,7 @@ impl Wallet {
std::fs::rename(from, to)?;

let wallet_dir = data_dir.join(WALLET);
let database = bdk::sled::open(&wallet_dir)?.open_tree(SLED_TREE_NAME)?;
let database = bdk::sled::open(wallet_dir)?.open_tree(SLED_TREE_NAME)?;

let wallet = bdk::Wallet::new(
bdk::template::Bip84(xprivkey, KeychainKind::External),
Expand Down Expand Up @@ -738,12 +738,15 @@ impl Client {
let client = bdk::electrum_client::Client::new(electrum_rpc_url.as_str())
.context("Failed to initialize Electrum RPC client")?;
let blockchain = ElectrumBlockchain::from(client);
let last_sync = Instant::now()
.checked_sub(interval)
.expect("no underflow since block time is only 600 secs");

Ok(Self {
electrum,
blockchain,
latest_block_height: BlockHeight::try_from(latest_block)?,
last_sync: Instant::now() - interval,
last_sync,
sync_interval: interval,
script_history: Default::default(),
subscriptions: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion swap/src/network/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct GlobalSpawnTokioExecutor;

impl Executor for GlobalSpawnTokioExecutor {
fn exec(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) {
let _ = tokio::spawn(future);
tokio::spawn(future);
}
}

Expand Down
2 changes: 1 addition & 1 deletion swap/src/seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Seed {
let file_path = Path::new(&file_path_buf);

if file_path.exists() {
return Self::from_file(&file_path);
return Self::from_file(file_path);
}

tracing::debug!("No seed file found, creating at {}", file_path.display());
Expand Down
2 changes: 1 addition & 1 deletion swap/tests/ensure_same_swap_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async fn ensure_same_swap_id_for_alice_and_bob() {
harness::setup_test(SlowCancelConfig, |mut ctx| async move {
let (bob_swap, _) = ctx.bob_swap().await;
let bob_swap_id = bob_swap.id;
let _ = tokio::spawn(bob::run(bob_swap));
tokio::spawn(bob::run(bob_swap));

// once Bob's swap is spawned we can retrieve Alice's swap and assert on the
// swap ID
Expand Down
2 changes: 1 addition & 1 deletion swap/tests/harness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ async fn init_bitcoind(node_url: Url, spendable_quantity: u32) -> Result<Client>
bitcoind_client
.generatetoaddress(101 + spendable_quantity, reward_address.clone())
.await?;
let _ = tokio::spawn(mine(bitcoind_client.clone(), reward_address));
tokio::spawn(mine(bitcoind_client.clone(), reward_address));
Ok(bitcoind_client)
}

Expand Down

0 comments on commit acdba84

Please sign in to comment.