# Why can't we print b256 or AssetID in RustSDK test cases

**URL:** <https://forum.fuel.network/t/why-cant-we-print-b256-or-assetid-in-rustsdk-test-cases/5964>\
**Category:** General\
**Created:** [June 21, 2024, 6:52am UTC](https://forum.fuel.network/t/why-cant-we-print-b256-or-assetid-in-rustsdk-test-cases/5964 "2024-06-21T06:52:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eesheng](https://avatars.discourse-cdn.com/v4/letter/e/2bfe46/32.png) [@eesheng](https://forum.fuel.network/u/eesheng)\
**Post date:** [June 21, 2024, 6:52am UTC](https://forum.fuel.network/t/why-cant-we-print-b256-or-assetid-in-rustsdk-test-cases/5964/1 "2024-06-21T06:52:11Z")

</div>

How do you print b256 in test cases? Tried logging in Sway too, doesn’t show anything.

```auto
use fuels::{prelude::*, types::ContractId};

abigen!(Contract(name="MyContract", abi="out/debug/test_asset-abi.json"));

#[tokio::test]
async fn test_harness() {
    // Test code here
    let (instance, _id) = get_contract_instance().await;

    let result = instance.methods().deposit().call().await.unwrap();
    let result2 = instance.methods().test_deposit_asset_id_same_generated().call().await.unwrap();
    println!("{result}",result);
    println!("{result2}",result);

}
 

async fn get_contract_instance() -> (MyContract<WalletUnlocked>, ContractId) {
    // Launch a local network and deploy the contract
    let wallets = launch_custom_provider_and_get_wallets(
        WalletsConfig::new(
            Some(3), /* Three wallets */
            Some(1), /* Single coin (UTXO) */
            Some(1_000_000_000), /* Amount per coin */
        ),
        None,
        None,
    )
    .await
    .unwrap();
 
    let wallet = wallets.get(0).unwrap().clone();
    
    let id = Contract::load_from(
        "./out/debug/test_asset.bin",
        LoadConfiguration::default(),
    )
    .unwrap()
    .deploy(&wallet, TxPolicies::default())
    .await
    .unwrap();
 
    let instance = MyContract::new(id.clone(), wallet);
 
    (instance, id.into())
}

```

Error:

```auto
error[E0277]: `FuelCallResponse<Bits256>` doesn't implement `std::fmt::Display`
  --> tests/harness.rs:13:15
   |
13 | println!("{result}",result);
   | ^^^^^^^^ `FuelCallResponse<Bits256>` cannot be formatted with the default formatter
   |
   = help: the trait `std::fmt::Display` is not implemented for `FuelCallResponse<Bits256>`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `FuelCallResponse<Bits256>` doesn't implement `std::fmt::Display`
  --> tests/harness.rs:14:15
   |
14 | println!("{result2}",result);
   | ^^^^^^^^^ `FuelCallResponse<Bits256>` cannot be formatted with the default formatted

```

---

<div class="post-metadata">

**Author:** ![eesheng](https://avatars.discourse-cdn.com/v4/letter/e/2bfe46/32.png) [@eesheng](https://forum.fuel.network/u/eesheng)\
**Post date:** [June 21, 2024, 7:21am UTC](https://forum.fuel.network/t/why-cant-we-print-b256-or-assetid-in-rustsdk-test-cases/5964/2 "2024-06-21T07:21:25Z")

</div>

> [@eesheng](#):
>
> `FuelCallResponse<Bits256>`

Because of the call response, you need to add .value at the end to retrieve the value. The [documentation](https://docs.fuel.network/docs/fuels-rs/calling-contracts/call-response/#call-response) is slightly ambiguous in returning values.

```auto
    let result= instance.methods().deposit().call().await.unwrap().value;
    let result2 = instance.methods().test_deposit_asset_id_same_generated().call().await.unwrap().value;

```

The above snippet will fix the problem

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/5/57d5a345cc15a64b636e0d56e042857f8a0e80b1.png) [@system](https://forum.fuel.network/u/system)\
**Post date:** [July 12, 2024, 3:21am UTC](https://forum.fuel.network/t/why-cant-we-print-b256-or-assetid-in-rustsdk-test-cases/5964/3 "2024-07-12T03:21:41Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
