Skip to content

Commit

Permalink
pallet-contracts: Fix compilation on latest nightly (paritytech#2986) (
Browse files Browse the repository at this point in the history
  • Loading branch information
pmikolajczyk41 authored and lesniak43 committed May 24, 2024
1 parent a5f04d5 commit d075391
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 @@ -1162,6 +1162,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 @@ -1177,9 +1180,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 d075391

Please sign in to comment.