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 get_asset_outputs_for_amount, get_asset_inputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount #1498

Merged
merged 9 commits into from
Sep 11, 2024

Conversation

AurelienFT
Copy link

@AurelienFT AurelienFT commented Aug 29, 2024

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

// 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)

Br1ght0ne
Br1ght0ne previously approved these changes Aug 29, 2024
Copy link
Contributor

@Br1ght0ne Br1ght0ne left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@calldelegation
Copy link
Contributor

@AurelienFT could you add the proper tag to the title, either chore, feat, or fix please? So the migration script can pick it upon the next release :)

Context: #1495

@AurelienFT AurelienFT changed the title Move get_asset_outputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount chore: Move get_asset_outputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount Aug 29, 2024
@AurelienFT
Copy link
Author

@AurelienFT could you add the proper tag to the title, either chore, feat, or fix please? So the migration script can pick it upon the next release :)

Done :)

@AurelienFT AurelienFT changed the title chore: Move get_asset_outputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount chore!: Move get_asset_outputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount Aug 29, 2024
@AurelienFT AurelienFT changed the title chore!: Move get_asset_outputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount chore!: Move get_asset_outputs_for_amount, get_asset_inputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount Aug 29, 2024
@AurelienFT AurelienFT changed the title chore!: Move get_asset_outputs_for_amount, get_asset_inputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount chore!: Move get_asset_outputs_for_amount, get_asset_inputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount Aug 29, 2024
@AurelienFT
Copy link
Author

This PR is based on #1496

This PR can't be merged for now as it contains breaking changes and master do not accept new breaking changes for now.

@digorithm digorithm changed the base branch from master to 0.67.0-dev September 6, 2024 00:12
@digorithm
Copy link
Member

@AurelienFT Is this still a draft, or are we good to review it?

@AurelienFT AurelienFT marked this pull request as ready for review September 6, 2024 07:21
@AurelienFT
Copy link
Author

@AurelienFT Is this still a draft, or are we good to review it?

Yes sorry I placed it to draft to avoid merging before :p

@digorithm digorithm requested a review from a team September 6, 2024 20:08
Copy link
Contributor

@MujkicA MujkicA left a comment

Choose a reason for hiding this comment

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

I've added a small change to docs, LGTM

@AurelienFT AurelienFT merged commit fc1978d into 0.67.0-dev Sep 11, 2024
43 checks passed
@AurelienFT AurelienFT deleted the move_method_from_account_to_view_only_account branch September 11, 2024 07:55
hal3e added a commit that referenced this pull request Sep 13, 2024
…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 <git@hal3e.io>
Co-authored-by: Rodrigo Araújo <rod.dearaujo@gmail.com>
Co-authored-by: MujkicA <ahmedmujkic2@gmail.com>
hal3e added a commit that referenced this pull request Nov 6, 2024
…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 <git@hal3e.io>
Co-authored-by: Rodrigo Araújo <rod.dearaujo@gmail.com>
Co-authored-by: MujkicA <ahmedmujkic2@gmail.com>
hal3e added a commit that referenced this pull request Nov 22, 2024
…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 <git@hal3e.io>
Co-authored-by: Rodrigo Araújo <rod.dearaujo@gmail.com>
Co-authored-by: MujkicA <ahmedmujkic2@gmail.com>
hal3e added a commit that referenced this pull request Jan 7, 2025
…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 <git@hal3e.io>
Co-authored-by: Rodrigo Araújo <rod.dearaujo@gmail.com>
Co-authored-by: MujkicA <ahmedmujkic2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants