Move ChainWithBalances::NativeBalance -> Chain::Balance (#990)

* move ChainWithBalances::NativeBalance -> Chain::Balance

* dummy commit

* Revert "dummy commit"

This reverts commit c00642153d260685a91d4fffbc424d225741fceb.
This commit is contained in:
Svyatoslav Nikolsky
2021-06-09 16:16:57 +03:00
committed by Bastian Köcher
parent b4939e2c9f
commit 4a47452c20
12 changed files with 27 additions and 28 deletions
@@ -208,7 +208,7 @@ impl<C: Chain> Client<C> {
}
/// Return native tokens balance of the account.
pub async fn free_native_balance(&self, account: C::AccountId) -> Result<C::NativeBalance>
pub async fn free_native_balance(&self, account: C::AccountId) -> Result<C::Balance>
where
C: ChainWithBalances,
{
@@ -217,7 +217,7 @@ impl<C: Chain> Client<C> {
.await?
.ok_or(Error::AccountDoesNotExist)?;
let decoded_account_data =
AccountInfo::<C::Index, AccountData<C::NativeBalance>>::decode(&mut &encoded_account_data.0[..])
AccountInfo::<C::Index, AccountData<C::Balance>>::decode(&mut &encoded_account_data.0[..])
.map_err(Error::ResponseParseFailed)?;
Ok(decoded_account_data.data.free)
}