Skip to content

Commit

Permalink
Fix environmental! macro, which breaks new nightly release (#3316)
Browse files Browse the repository at this point in the history
Replicates
0e124a0
  • Loading branch information
kapilsinha authored Feb 14, 2024
1 parent af5beb7 commit 8a98fec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions substrate/frame/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,9 @@ struct InternalOutput<T: Config, O> {
result: Result<O, ExecError>,
}

// Set up a global reference to the boolean flag used for the re-entrancy guard.
environmental!(executing_contract: bool);

/// Helper trait to wrap contract execution entry points into a single function
/// [`Invokable::run_guarded`].
trait Invokable<T: Config>: Sized {
Expand All @@ -1243,9 +1246,6 @@ trait Invokable<T: Config>: Sized {
/// We enforce a re-entrancy guard here by initializing and checking a boolean flag through a
/// global reference.
fn run_guarded(self, common: CommonInput<T>) -> InternalOutput<T, Self::Output> {
// Set up a global reference to the boolean flag used for the re-entrancy guard.
environmental!(executing_contract: bool);

let gas_limit = common.gas_limit;

// Check whether the origin is allowed here. The logic of the access rules
Expand Down

0 comments on commit 8a98fec

Please sign in to comment.