From 03102258de7ea2ece009d7bf25c080d6893d602a Mon Sep 17 00:00:00 2001 From: Ahmad Kaouk Date: Tue, 2 Apr 2024 12:20:26 +0300 Subject: [PATCH] Fix std feature --- frame/evm/precompile/storage-cleaner/Cargo.toml | 3 ++- frame/evm/precompile/storage-cleaner/src/lib.rs | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frame/evm/precompile/storage-cleaner/Cargo.toml b/frame/evm/precompile/storage-cleaner/Cargo.toml index b6ba419eef..7c7af2cbcd 100644 --- a/frame/evm/precompile/storage-cleaner/Cargo.toml +++ b/frame/evm/precompile/storage-cleaner/Cargo.toml @@ -45,8 +45,9 @@ std = [ "frame-system/std", "sp-runtime/std", "sp-core/std", - "sp-io/std", + "sp-std/std", # Frontier "fp-evm/std", "pallet-evm/std", + "precompile-utils/std", ] diff --git a/frame/evm/precompile/storage-cleaner/src/lib.rs b/frame/evm/precompile/storage-cleaner/src/lib.rs index 99a539b41a..5fcf5ed8ac 100644 --- a/frame/evm/precompile/storage-cleaner/src/lib.rs +++ b/frame/evm/precompile/storage-cleaner/src/lib.rs @@ -18,12 +18,16 @@ //! Storage cleaner precompile. This precompile is used to clean the storage entries of smart contract that //! has been marked as suicided (self-destructed). +#![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; + use core::marker::PhantomData; use fp_evm::{PrecompileFailure, ACCOUNT_BASIC_PROOF_SIZE, ACCOUNT_STORAGE_PROOF_SIZE}; use pallet_evm::AddressMapping; use precompile_utils::{prelude::*, EvmResult}; use sp_core::H160; use sp_runtime::traits::ConstU32; +use sp_std::vec::Vec; #[cfg(test)] mod mock; @@ -77,7 +81,7 @@ where for Address(address) in addresses { if !pallet_evm::Pallet::::is_account_suicided(&address) { - return Err(revert(format!("NotSuicided: {}", address))); + return Err(revert(alloc::format!("NotSuicided: {}", address))); } let deleted = pallet_evm::AccountStorages::::drain_prefix(address)