Skip to content

Commit

Permalink
Fix std feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadkaouk committed Apr 2, 2024
1 parent 8e5fe4d commit 0310225
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frame/evm/precompile/storage-cleaner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
6 changes: 5 additions & 1 deletion frame/evm/precompile/storage-cleaner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -77,7 +81,7 @@ where

for Address(address) in addresses {
if !pallet_evm::Pallet::<Runtime>::is_account_suicided(&address) {
return Err(revert(format!("NotSuicided: {}", address)));
return Err(revert(alloc::format!("NotSuicided: {}", address)));
}

let deleted = pallet_evm::AccountStorages::<Runtime>::drain_prefix(address)
Expand Down

0 comments on commit 0310225

Please sign in to comment.