From 76e50fc2f4d8b94651fd74e6f22de46476b0f90a Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Tue, 14 May 2024 12:34:20 +0200 Subject: [PATCH] Update chain extension description --- substrate/frame/contracts/src/chain_extension.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/substrate/frame/contracts/src/chain_extension.rs b/substrate/frame/contracts/src/chain_extension.rs index 8a7243d6bb37..10dd5b0e9c83 100644 --- a/substrate/frame/contracts/src/chain_extension.rs +++ b/substrate/frame/contracts/src/chain_extension.rs @@ -104,6 +104,11 @@ pub trait ChainExtension { /// chain extensions. It is called whenever a contract calls the `seal_call_chain_extension` /// imported wasm function. /// + /// Note that `seal_call_chain_extension` can be invoked within a read-only context, + /// where any state-changing calls are disallowed. This information can be obtained + /// using the call `env.ext().is_read_only()`. + /// It's crucial for the implementer to handle this scenario appropriately. + /// /// # Parameters /// - `env`: Access to the remaining arguments and the execution environment. ///