Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: convert client types to fuels types #707

Merged
merged 21 commits into from
Dec 6, 2022

Conversation

MujkicA
Copy link
Contributor

@MujkicA MujkicA commented Nov 22, 2022

Closes #711

The goal of this PR is to introduce an anti-corruption layer between the SDK and fuel-core and to provide a more consistent interface to our users.
It adds the Rust SDK equivalent of types we usually query from the client:
Message,
Coin,
TransactionResponse,
Block etc.

The new types have been applied to provider methods as a return type and to fuels-test-helpers methods like setup_single_asset_coins, setup_single_message.
Previously, setup methods would use different types, from those returned by provider methods even though they describe the same data, e.g. fuel_gql_client::...:: Coin vs. 'fuel_core_interface::...:: Coin'.
This also lets us hide Address (in some cases) in favor of Bech32Addres, ridding us of .into() calls and thereby reducing confusion for the user.

@MujkicA MujkicA changed the title feat!: add client type wrappers feat!: convert client types to fuels types Nov 29, 2022
@MujkicA MujkicA requested a review from a team November 29, 2022 15:32
@MujkicA MujkicA self-assigned this Nov 29, 2022
@MujkicA MujkicA added breaking Introduces or requires breaking changes enhancement New feature or request labels Nov 29, 2022
@MujkicA MujkicA marked this pull request as ready for review November 29, 2022 16:57
iqdecay
iqdecay previously approved these changes Nov 30, 2022
Copy link
Contributor

@iqdecay iqdecay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just one question

iqdecay
iqdecay previously approved these changes Dec 1, 2022
Copy link
Contributor

@iqdecay iqdecay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 it

@MujkicA MujkicA requested review from iqdecay and a team December 5, 2022 12:03
Copy link
Contributor

@hal3e hal3e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MujkicA MujkicA enabled auto-merge (squash) December 6, 2022 16:18
@MujkicA MujkicA merged commit 1106b58 into master Dec 6, 2022
@MujkicA MujkicA deleted the mujkica/add_client_wrappers branch December 6, 2022 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Introduces or requires breaking changes enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce an anti-corruption layer between the SDK and common fuel-core types
3 participants