# When using rust-sdk v0.48 and sway v0.46 there is no error when passing arguments of type AssetId to contract methods

**URL:** <https://forum.fuel.network/t/when-using-rust-sdk-v0-48-and-sway-v0-46-there-is-no-error-when-passing-arguments-of-type-assetid-to-contract-methods/3113>\
**Category:** Rust SDK\
**Created:** [September 23, 2023, 6:53pm UTC](https://forum.fuel.network/t/when-using-rust-sdk-v0-48-and-sway-v0-46-there-is-no-error-when-passing-arguments-of-type-assetid-to-contract-methods/3113 "2023-09-23T18:53:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [September 23, 2023, 6:53pm UTC](https://forum.fuel.network/t/when-using-rust-sdk-v0-48-and-sway-v0-46-there-is-no-error-when-passing-arguments-of-type-assetid-to-contract-methods/3113/1 "2023-09-23T18:53:38Z")

</div>

# When using rust-sdk v0.48 and sway v0.46 there is no error when passing arguments of type AssetId to contract methods

Hi guys, after the update to `sway v0.46.0`, I have faced the next problem:

For example, we have a `get_user_collateral` func that wants `AssetId` an argument:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/b/bf1039aca19d03fb3a45ce7460a40b14e3867b7c.jpeg)

Оn my previous version of sway worked well with `Bits256`, but rn that doesn’t work

 ![image](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/6/63f9dd366d6bde9a36b6c6bae9fa00138539d284.png)

If I try to provide AssetId as an argument I get next error

 ![image](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/b/b84673a9b62c165111b93a4635ef44f7fa2b1816.png)

That works well if I do like that, but the code became [a bit dirty](https://github.com/compolabs/sway-lend/pull/28/commits/00c733ba7b403a3721ebf01d96fbfd94ec5084ae)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/4/404b86c21a0a2cc52293e338e5435adfebdbdede.png)

Can you please make please possible to provide `fuels::types::AssetId` or `uels::types::Bits256` as in the previous version?

# Toolchain

```auto
Default host: aarch64-apple-darwin
fuelup home: /Users/alexey/.fuelup

installed toolchains
--------------------
beta-3-aarch64-apple-darwin
beta-4-rc.2-aarch64-apple-darwin
latest-aarch64-apple-darwin (default)
hotfix
my-custom-toolchain

active toolchain
-----------------
latest-aarch64-apple-darwin (default)
  forc : 0.46.0
    - forc-client
      - forc-deploy : 0.46.0
      - forc-run : 0.46.0
    - forc-doc : 0.46.0
    - forc-explore : 0.28.1
    - forc-fmt : 0.46.0
    - forc-index : 0.20.10
    - forc-lsp : 0.46.0
    - forc-tx : 0.46.0
    - forc-wallet : 0.3.0
  fuel-core : 0.20.5
  fuel-core-keygen : Error getting version string
  fuel-indexer : 0.20.10

fuels versions
---------------
forc : 0.45
forc-wallet : 0.45

```

## How to reproduce

```auto
git clone https://github.com/compolabs/sway-lend.git
cd sway-lend    
git checkout beta-4   
cd contracts/market/
forc build   
cargo test --package market --test integration_tests -- local_tests::main_test_uni::main_test --exact --nocapture 

```

---

<div class="post-metadata">

**Author:** ![diyahir](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/diyahir/32/1075_2.png) [@diyahir](https://forum.fuel.network/u/diyahir)\
**Post date:** [October 5, 2023, 8:41pm UTC](https://forum.fuel.network/t/when-using-rust-sdk-v0-48-and-sway-v0-46-there-is-no-error-when-passing-arguments-of-type-assetid-to-contract-methods/3113/2 "2023-10-05T20:41:26Z")

</div>

I am also running into this issue

---

<div class="post-metadata">

**Author:** ![calldelegation](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/calldelegation/32/1484_2.png) [@calldelegation](https://forum.fuel.network/u/calldelegation)\
**Post date:** [October 6, 2023, 9:08pm UTC](https://forum.fuel.network/t/when-using-rust-sdk-v0-48-and-sway-v0-46-there-is-no-error-when-passing-arguments-of-type-assetid-to-contract-methods/3113/3 "2023-10-06T21:08:46Z")

</div>

Cross linking to this [post](https://forum.fuel.network/t/assetid-being-generated-by-abigen-and-causing-type-mismatch-with-fuels-rs/3242) which contains a [PR](https://github.com/FuelLabs/fuels-rs/pull/1148) for this [known issue](https://github.com/FuelLabs/fuels-rs/issues/1134).

---

<div class="post-metadata">

**Author:** ![diyahir](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/diyahir/32/1075_2.png) [@diyahir](https://forum.fuel.network/u/diyahir)\
**Post date:** [October 9, 2023, 5:50pm UTC](https://forum.fuel.network/t/when-using-rust-sdk-v0-48-and-sway-v0-46-there-is-no-error-when-passing-arguments-of-type-assetid-to-contract-methods/3113/4 "2023-10-09T17:50:46Z")

</div>

Awesome! Just saw it merged. Any sense on when that will be reflected in a release / usable by me 😄 ?

---

<div class="post-metadata">

**Author:** ![digorithm](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/digorithm/32/851_2.png) [@digorithm](https://forum.fuel.network/u/digorithm)\
**Post date:** [October 10, 2023, 2:51pm UTC](https://forum.fuel.network/t/when-using-rust-sdk-v0-48-and-sway-v0-46-there-is-no-error-when-passing-arguments-of-type-assetid-to-contract-methods/3113/5 "2023-10-10T14:51:22Z")

</div>

We will be cutting a new release today or, at the latest, tomorrow – keep an eye on the repo!

Edit: it’s been released: [Release v0.49.0 · FuelLabs/fuels-rs · GitHub](https://github.com/FuelLabs/fuels-rs/releases/tag/v0.49.0)

---

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [October 14, 2023, 7:36pm UTC](https://forum.fuel.network/t/when-using-rust-sdk-v0-48-and-sway-v0-46-there-is-no-error-when-passing-arguments-of-type-assetid-to-contract-methods/3113/6 "2023-10-14T19:36:58Z")

</div>

Cool, thanks.  
But we have already replaced all AssetId with b256 in all our contracts, I think we’ll move on from here with b256

---

<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:** [November 4, 2023, 3:37pm UTC](https://forum.fuel.network/t/when-using-rust-sdk-v0-48-and-sway-v0-46-there-is-no-error-when-passing-arguments-of-type-assetid-to-contract-methods/3113/7 "2023-11-04T15:37:58Z")

</div>

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