Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-mysten committed Dec 12, 2024
1 parent 33c411f commit baf9fdc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
5 changes: 2 additions & 3 deletions crates/sui-graphql-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2153,9 +2153,8 @@ mod tests {
.unwrap();

let digest = chckp.digest();
let total_transaction_blocks_by_digest = client
.total_transaction_blocks_by_digest(digest.into())
.await;
let total_transaction_blocks_by_digest =
client.total_transaction_blocks_by_digest(digest).await;
assert!(total_transaction_blocks_by_digest.is_ok());
assert_eq!(
total_transaction_blocks_by_digest.unwrap().unwrap(),
Expand Down
21 changes: 10 additions & 11 deletions crates/sui-transaction-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ mod tests {
use crate::Function;
use crate::Serialized;
use crate::TransactionBuilder;
use sui_types::types::Digest;
use sui_types::types::TransactionDigest;

/// Type corresponding to the output of `sui move build --dump-bytecode-as-base64`
Expand Down Expand Up @@ -581,7 +580,7 @@ mod tests {
.unwrap()
.sent;
let tx_digest = coins.first().unwrap().transfer_tx_digest;
wait_for_tx(client, tx_digest.into()).await;
wait_for_tx(client, tx_digest).await;

let gas = coins.last().unwrap().id;
// TODO when we have tx resolution, we can just pass an ObjectId
Expand Down Expand Up @@ -676,7 +675,7 @@ mod tests {
let sig = pk.sign_transaction(&tx).unwrap();

let effects = client.execute_tx(vec![sig], &tx).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest().into(), effects).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest(), effects).await;

// check that recipient has 1 coin
let recipient_coins = client
Expand Down Expand Up @@ -705,7 +704,7 @@ mod tests {
let tx = tx.finish().unwrap();
let sig = pk.sign_transaction(&tx).unwrap();
let effects = client.execute_tx(vec![sig], &tx).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest().into(), effects).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest(), effects).await;
}

#[tokio::test]
Expand All @@ -725,7 +724,7 @@ mod tests {
let sig = pk.sign_transaction(&tx).unwrap();

let effects = client.execute_tx(vec![sig], &tx).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest().into(), effects).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest(), effects).await;

// check that recipient has 1 coin
let recipient_coins = client
Expand Down Expand Up @@ -757,7 +756,7 @@ mod tests {

// wait for the transaction to be finalized
loop {
let tx_digest = client.transaction(tx.digest().into()).await.unwrap();
let tx_digest = client.transaction(tx.digest()).await.unwrap();
if tx_digest.is_some() {
break;
}
Expand Down Expand Up @@ -791,7 +790,7 @@ mod tests {
let sig = pk.sign_transaction(&tx).unwrap();

let effects = client.execute_tx(vec![sig], &tx).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest().into(), effects).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest(), effects).await;

// check that there are two coins
let coins_after = client
Expand All @@ -814,7 +813,7 @@ mod tests {
let sig = pk.sign_transaction(&tx).unwrap();

let effects = client.execute_tx(vec![sig], &tx).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest().into(), effects).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest(), effects).await;
}

#[tokio::test]
Expand All @@ -830,7 +829,7 @@ mod tests {
let tx = tx.finish().unwrap();
let sig = pk.sign_transaction(&tx).unwrap();
let effects = client.execute_tx(vec![sig], &tx).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest().into(), effects).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest(), effects).await;
}

#[tokio::test]
Expand Down Expand Up @@ -869,7 +868,7 @@ mod tests {
_ => panic!("Expected V2 effects"),
}
}
wait_for_tx_and_check_effects_status_success(&client, tx.digest().into(), effects).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest(), effects).await;

let mut tx = TransactionBuilder::new();
let mut upgrade_cap = None;
Expand Down Expand Up @@ -940,6 +939,6 @@ mod tests {
let tx = tx.finish().unwrap();
let sig = pk.sign_transaction(&tx).unwrap();
let effects = client.execute_tx(vec![sig], &tx).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest().into(), effects).await;
wait_for_tx_and_check_effects_status_success(&client, tx.digest(), effects).await;
}
}

0 comments on commit baf9fdc

Please sign in to comment.