Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Fix return types of context::contract_id & context::msg_asset_id #59

Merged
merged 12 commits into from
Mar 3, 2022

Conversation

nfurfaro
Copy link
Contributor

@nfurfaro nfurfaro commented Feb 24, 2022

2 functions in the context module currently return a b256 type as the ContractId type didn't exist when they were written.

  • msg_asset_id()
  • contract_id
    This fixes that, and ports the tests from the sway repo into the std-lib repo, using the rust SDK.
    I also modified the second function msg_asset_id() to reuse the first for consistency.

This closes #45

Note: still some failing tests, blocked by an issue related to the difference between Return and ReturnData and how the SDK reads returned data. @digorithm is already on it.

@nfurfaro nfurfaro added the bug Something isn't working label Feb 24, 2022
@nfurfaro nfurfaro self-assigned this Feb 24, 2022
@nfurfaro nfurfaro marked this pull request as draft February 24, 2022 22:59
@nfurfaro nfurfaro changed the title Furnic/bugfix contract Fix return types of context::contract_id & context::msg_asset_id Feb 24, 2022
@digorithm
Copy link
Member

The issue mentioned on the SDK side has been fixed here: FuelLabs/fuels-rs#112

Just gotta wait for some reviews and a release. Will keep you updated!

@nfurfaro nfurfaro marked this pull request as ready for review March 3, 2022 18:06
@nfurfaro nfurfaro requested a review from adlerjohn March 3, 2022 18:07
@nfurfaro
Copy link
Contributor Author

nfurfaro commented Mar 3, 2022

Just a small change here.
A follow-up PR will be porting the context tests over to the new harness and provides good test coverage for this. It's WIP already, but blocked atm.

Note: this is a breaking change, so our next release will have to reflect that.

@nfurfaro nfurfaro merged commit 8470621 into master Mar 3, 2022
@nfurfaro nfurfaro deleted the furnic/bugfix-contract-id branch March 3, 2022 22:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

The stdlib function context::contract_id() should return a ContractId type
3 participants