diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs index badb2f1c48a9..b065adb46756 100644 --- a/substrate/frame/revive/src/exec.rs +++ b/substrate/frame/revive/src/exec.rs @@ -295,9 +295,6 @@ pub trait Ext: sealing::Sealed { /// Returns a reference to the account id of the current contract. fn account_id(&self) -> &AccountIdOf; - /// Returns the balance of an AccountId - fn account_balance(&self, who: &AccountIdOf) -> U256; - /// Returns a reference to the [`H160`] address of the current contract. fn address(&self) -> H160 { ::AddressMapper::to_address(self.account_id()) @@ -1264,6 +1261,11 @@ where fn allows_reentry(&self, id: &T::AccountId) -> bool { !self.frames().any(|f| &f.account_id == id && !f.allows_reentry) } + + /// Returns the *free* balance of the supplied AccountId. + fn account_balance(&self, who: &T::AccountId) -> U256 { + T::Currency::reducible_balance(who, Preservation::Preserve, Fortitude::Polite).into() + } } impl<'a, T, E> Ext for Stack<'a, T, E> @@ -1471,10 +1473,6 @@ where &self.top_frame().account_id } - fn account_balance(&self, who: &AccountIdOf) -> U256 { - T::Currency::reducible_balance(who, Preservation::Preserve, Fortitude::Polite).into() - } - fn caller(&self) -> Origin { if let Some(caller) = &self.top_frame().delegate_caller { caller.clone()