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

chore!: move methods from Account to ViewOnlyAccount #1540

Closed
wants to merge 3 commits into from
Closed

Conversation

hal3e
Copy link
Contributor

@hal3e hal3e commented Nov 6, 2024

Thanks @AurelienFT for his contribution.

Release notes

In this release, we:

  • Move get_asset_outputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount

Summary

This PR moves get_asset_outputs_for_amount,
get_asset_inputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount trait. It seem that these two methods doesn't require a full Account and so it give more flexibility in order to implement them in other structures such as Wallet.

Now Wallet also implement these two methods. Before you were forced to build a WalletUnlocked even if you don't use the secret_key.

Breaking changes

This contains an API breaking change as some public trait as been edited:

Breaking Changes

// before
use fuels::acounts::Account;

wallet.get_asset_outputs_for_amount(...);
// after
use fuels::acounts::ViewOnlyAccount;

wallet.get_asset_outputs_for_amount(...);

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

Release notes

In this release, we:

  • Did this and that

Summary

Breaking Changes

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

…ount` and `adjust_for_fee` from `Account` to `ViewOnlyAccount` (#1498)

# Release notes

In this release, we:

- Move `get_asset_outputs_for_amount` and `adjust_for_fee` from
`Account` to `ViewOnlyAccount`

# Summary

This PR moves `get_asset_outputs_for_amount`,
`get_asset_inputs_for_amount` and `adjust_for_fee` from `Account` to
`ViewOnlyAccount` trait. It seem that these two methods doesn't require
a full `Account` and so it give more flexibility in order to implement
them in other structures such as `Wallet`.

Now `Wallet` also implement these two methods. Before you were forced to
build a `WalletUnlocked` even if you don't use the `secret_key`.

# Breaking changes

This contains an API breaking change as some public trait as been
edited:

# Breaking Changes

The provider option flag `cacheUtxo` was renamed to `resourceCacheTTL`

```rust
// before
use fuels::acounts::Account;

wallet.get_asset_outputs_for_amount(...);
```

```rust
// after
use fuels::acounts::ViewOnlyAccount;

wallet.get_asset_outputs_for_amount(...);
```

# Checklist

- [x] All **changes** are **covered** by **tests** (or not applicable)
- [x] All **changes** are **documented** (or not applicable)
- [x] I **reviewed** the **entire PR** myself (preferably, on GH UI)
- [x] I **described** all **Breaking Changes** (or there's none)

---------

Co-authored-by: hal3e <[email protected]>
Co-authored-by: Rodrigo Araújo <[email protected]>
Co-authored-by: MujkicA <[email protected]>
@hal3e hal3e self-assigned this Nov 6, 2024
@hal3e hal3e changed the title chore!: Move get_asset_outputs_for_amount, `get_asset_inputs_for_am… chore!: move methods from Account to ViewOnlyAccount Nov 6, 2024
@hal3e hal3e added the breaking Introduces or requires breaking changes label Nov 6, 2024
@hal3e
Copy link
Contributor Author

hal3e commented Nov 6, 2024

close and wait for window for breaking changes

@hal3e hal3e closed this Nov 6, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants