Skip to content

Commit

Permalink
chore: Fix some compiler warnings from #[expect] tags on msim (#4695)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaughterOfMars authored Jan 6, 2025
1 parent c620161 commit bcaf173
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/iota-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,7 @@ impl AuthorityState {
let transaction_data = &certificate.data().intent_message().value;
let (kind, signer, gas) = transaction_data.execution_parts();

#[expect(unused_mut)]
#[cfg_attr(not(any(msim, fail_points)), expect(unused_mut))]
let (inner_temp_store, _, mut effects, execution_error_opt) =
epoch_store.executor().execute_transaction_to_effects(
self.get_backing_store().as_ref(),
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-core/src/authority/authority_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl AuthorityStore {
let epoch_start_configuration = if perpetual_tables.database_is_empty()? {
info!("Creating new epoch start config from genesis");

#[expect(unused_mut)]
#[cfg_attr(not(any(msim, fail_points)), expect(unused_mut))]
let mut initial_epoch_flags = EpochFlag::default_flags_for_new_epoch(config);
fail_point_arg!("initial_epoch_flags", |flags: Vec<EpochFlag>| {
info!("Setting initial epoch flags to {:?}", flags);
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-core/src/epoch/randomness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ impl RandomnessManager {
info!("random beacon: created {msg:?} with dkg version {dkg_version}");
let transaction = ConsensusTransaction::new_randomness_dkg_message(epoch_store.name, &msg);

#[expect(unused_mut)]
#[cfg_attr(not(any(msim, fail_points)), expect(unused_mut))]
let mut fail_point_skip_sending = false;
fail_point_if!("rb-dkg", || {
// maybe skip sending in simtests
Expand Down Expand Up @@ -498,7 +498,7 @@ impl RandomnessManager {
&conf,
);

#[expect(unused_mut)]
#[cfg_attr(not(any(msim, fail_points)), expect(unused_mut))]
let mut fail_point_skip_sending = false;
fail_point_if!("rb-dkg", || {
// maybe skip sending in simtests
Expand Down
3 changes: 3 additions & 0 deletions crates/iota-network/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ use tonic_build::manual::{Builder, Method, Service};
type Result<T> = ::std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;

fn main() -> Result<()> {
println!("cargo::rustc-check-cfg=cfg(msim)");
println!("cargo::rustc-check-cfg=cfg(fail_points)");

let out_dir = if env::var("DUMP_GENERATED_GRPC").is_ok() {
PathBuf::from("")
} else {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-network/src/randomness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ impl RandomnessEventLoop {
full_sig: Arc<OnceCell<RandomnessSignature>>,
) {
// For simtests, we may test not sending partial signatures.
#[expect(unused_mut)]
#[cfg_attr(not(any(msim, fail_points)), expect(unused_mut))]
let mut fail_point_skip_sending = false;
fail_point_if!("rb-send-partial-signatures", || {
fail_point_skip_sending = true;
Expand Down
1 change: 0 additions & 1 deletion crates/iota-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,6 @@ impl IotaNode {
.store(new_value, Ordering::Relaxed);
}

#[expect(unused_variables)]
async fn fetch_jwks(
authority: AuthorityName,
provider: &OIDCProvider,
Expand Down

0 comments on commit bcaf173

Please sign in to comment.