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

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:

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

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

That works well if I do like that, but the code became a bit dirty

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

Toolchain

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

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 
1 Like

I am also running into this issue

Cross linking to this post which contains a PR for this known issue.

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

1 Like

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

3 Likes

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

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