Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: satisfy conditions for semver-check #323

Merged
merged 3 commits into from Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion workspaces/src/types/gas_meter.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::panic::{RefUnwindSafe, UnwindSafe};
use std::sync::{Arc, Mutex};

use super::Gas;
Expand All @@ -7,7 +8,11 @@ use crate::Worker;
/// A hook that is called on every transaction that is sent to the network.
/// This is useful for debugging purposes, or for tracking the amount of gas
/// that is being used.
pub type GasHook = Arc<dyn Fn(Gas) -> Result<()> + Send + Sync>;
///
/// The auto-traits [`Send`], [`Sync`], [`UnwindSafe`] and [`RefUnwindSafe`] are added explicitly because they
/// do not fall under the rules the compiler uses to automatically add them.
/// See here: <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
pub type GasHook = Arc<dyn Fn(Gas) -> Result<()> + Send + Sync + UnwindSafe + RefUnwindSafe>;

/// Allows you to meter the amount of gas consumed by transaction(s).
/// Note: This only works with transactions that resolve to [`crate::result::ExecutionFinalResult`]
Expand Down
Loading