From d0753919fef8469d958009668db364f4a03ff2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Miko=C5=82ajczyk?= Date: Wed, 21 Feb 2024 14:19:34 +0100 Subject: [PATCH] pallet-contracts: Fix compilation on latest nightly (#2986) (#3) --- substrate/frame/contracts/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/substrate/frame/contracts/src/lib.rs b/substrate/frame/contracts/src/lib.rs index a3b13b6fc09b..de326ec31e0e 100644 --- a/substrate/frame/contracts/src/lib.rs +++ b/substrate/frame/contracts/src/lib.rs @@ -1162,6 +1162,9 @@ struct InternalOutput { result: Result, } +// 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: Sized { @@ -1177,9 +1180,6 @@ trait Invokable: 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) -> InternalOutput { - // 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