Skip to content

Commit

Permalink
fix merge error
Browse files Browse the repository at this point in the history
  • Loading branch information
hal3e committed Oct 24, 2022
1 parent e8e4e4b commit d3189be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/fuels-core/src/code_gen/abigen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl Abigen {
use fuels::core::code_gen::function_selector::resolve_fn_selector;
use fuels::core::types::*;
use fuels::signers::WalletUnlocked;
use fuels::tx::{ContractId, Address, Receipt};
use fuels::tx::{ContractId, Address, Receipt, AssetId};
use fuels::types::bech32::Bech32ContractId;
use fuels::types::ResolvedLog;
use fuels::types::errors::Error as SDKError;
Expand Down Expand Up @@ -147,7 +147,7 @@ impl Abigen {
Ok(Self { contract_id: self.contract_id.clone(), wallet: wallet, logs_lookup: self.logs_lookup.clone() })
}

pub async fn get_balances(&self) -> Result<HashMap<String, u64>, SDKError> {
pub async fn get_balances(&self) -> Result<HashMap<AssetId, u64>, SDKError> {
self.wallet.get_provider()?.get_contract_balances(&self.contract_id).await.map_err(Into::into)
}

Expand Down
3 changes: 1 addition & 2 deletions packages/fuels/tests/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,7 @@ async fn test_contract_instance_get_balances() -> Result<(), Error> {
let contract_balances = contract_instance.get_balances().await?;
assert_eq!(contract_balances.len(), 1);

let random_asset_id_key = format!("{:#x}", random_asset_id);
let random_asset_balance = contract_balances.get(&random_asset_id_key).unwrap();
let random_asset_balance = contract_balances.get(&random_asset_id).unwrap();
assert_eq!(*random_asset_balance, amount);

Ok(())
Expand Down

0 comments on commit d3189be

Please sign in to comment.