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

Deprecate Fixed Point library #278

Merged
merged 7 commits into from
Aug 1, 2024
Merged

Deprecate Fixed Point library #278

merged 7 commits into from
Aug 1, 2024

Conversation

K1-R1
Copy link
Member

@K1-R1 K1-R1 commented Jul 31, 2024

Type of change

  • Improvement (refactoring, restructuring repository, cleaning tech debt, ...)
  • Documentation

Changes

The following changes have been made:

  • The FP lib requires a substantial re-write and is currently not fit for production. This PR removes the FP lib and it's associated elements in the repo.
  • A note has been left on the repo's README explaining that the FP lib as been deprecated/removed pending a re-write.

Notes

  • As the FP lib was not fit for production I have opted for removal as opposed to archival. An issue to re-write the FP lib has been added to the repo.

Related Issues

Closes #277

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.
  • I have updated the changelog to reflect the changes on this PR.

@K1-R1 K1-R1 added Lib: Math Label used to filter for the library issue Breaking This will break user's code labels Jul 31, 2024
@K1-R1 K1-R1 self-assigned this Jul 31, 2024
@K1-R1 K1-R1 marked this pull request as ready for review July 31, 2024 18:38
@K1-R1 K1-R1 requested a review from a team as a code owner July 31, 2024 18:38
bitzoic
bitzoic previously approved these changes Aug 1, 2024
Copy link
Member

@bitzoic bitzoic left a comment

Choose a reason for hiding this comment

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

Needs conflicts resolved

@bitzoic bitzoic requested a review from a team August 1, 2024 06:57
@bitzoic bitzoic added the Bug Something isn't working label Aug 1, 2024
@K1-R1 K1-R1 enabled auto-merge (squash) August 1, 2024 09:33
@K1-R1 K1-R1 merged commit 0b64cbf into master Aug 1, 2024
10 checks passed
@K1-R1 K1-R1 deleted the K1-R1/dep-FP-lib branch August 1, 2024 12:32
@bitzoic bitzoic mentioned this pull request Aug 1, 2024
K1-R1 added a commit that referenced this pull request Aug 1, 2024
## [v0.23.0]

### Added

- [#259](#259) Adds a new
upgradability library, including associated tests and documentation.
- [#265](#265) Adds the
`SetMetadataEvent` and emits `SetMetadataEvent` when the
`_set_metadata()` function is called.
- [#270](#270) Adds `OrdEq`
functionality to Signed Integers.
- [#272](#272) Adds the
`TryFrom` implementation from signed integers to unsigned integers.

### Changed

- [#265](#265) Enables the
metadata events now that the Rust SDK supports wrapped heap types.
- [#269](#269) Hashes the
string "admin" and with the bits of an Identity when creating a storage
slot to storage an admin in the Admin Library.
- [#276](#276) Prepares for
v0.23.0 release.
- [#278](#278) Deprecates the
Fixed Point number library.

### Fixed

- [#258](#258) Fixes incorrect
instructions on how to run tests in README and docs hub.
- [#262](#262) Fixes incorrect
ordering comparison for IFP64, IFP128 and IFP256.
- [#263](#263) Fixes `I256`'s
returned bits.
- [#263](#263) Fixes `I128`
and `I256`'s zero or "indent" value.
- [#268](#268) Fixes
subtraction involving negative numbers for `I8`, `I16`, `I32`, `I64`,
`I128`, and `I256`.
- [#272](#272) Fixes `From`
implementations for Signed Integers with `TryFrom`.
- [#273](#273) Fixes negative
from implementations for Signed Integers.
- [#274](#274) Fixes the
`swap_configurables()` function to correctly handle the case where the
bytecode is too large to fit in the buffer.
- [#275](#275) Fixes an
infinite loop in the Bytecode root library's `_compute_bytecode_root()`
function.

#### Breaking

- [#263](#263) Removes the
`TwosComplement` trait in favor of `WrappingNeg`.

The following demonstrates the breaking change. While this example code
uses the `I8` type, the same logic may be applied to the `I16`, `I32`,
`I64`, `I128`, and `I256` types.

Before:

```sway
let my_i8 = i8::zero();
let twos_complement = my_i8.twos_complement();
```

After:

```sway
let my_i8 = i8::zero();
let wrapping_neg = my_i8.wrapping_neg();
```

- [#272](#272) The `From`
implementation for all signed integers to their respective unsigned
integer has been removed. The `TryFrom` implementation has been added in
its place.

Before:

```sway
let my_i8: I8 = I8::from(1u8);
```

After:

```sway
let my_i8: I8 = I8::try_from(1u8).unwrap();
```

- [#273](#273) The `neg_from`
implementation for all signed integers has been removed. The
`neg_try_from()` implementation has been added in its place.

The following demonstrates the breaking change. While this example code
uses the `I8` type, the same logic may be applied to the `I16`, `I32`,
`I64`, `I128`, and `I256` types.

Before:

```sway
let my_negative_i8: I8 = I8::neg_from(1u8);
```

After:

```sway
let my_negative_i8: I8 = I8::neg_try_from(1u8).unwrap();
```

- [#278](#278) Deprecates the
Fixed Point number library. The Fixed Point number library is no longer
available.

---------

Co-authored-by: K1-R1 <77465250+K1-R1@users.noreply.github.com>
Co-authored-by: SwayStar123 <46050679+SwayStar123@users.noreply.github.com>
kayagokalp added a commit to FuelLabs/sway that referenced this pull request Nov 4, 2024
## Description
closes #6636.
closes #6631.

As of FuelLabs/sway-libs#278
sway-libs/fixed-point library is deprecated and removed completely from
sway-libs repo. We should not link it from our book as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking This will break user's code Bug Something isn't working Lib: Math Label used to filter for the library issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate Fixed Point Number library
3 participants