Skip to content

Commit

Permalink
Merge branch 'master' into bitzoic-bytecode-root-loop
Browse files Browse the repository at this point in the history
  • Loading branch information
bitzoic authored Aug 1, 2024
2 parents 856a8d8 + 3a8a5dc commit ecb7f6a
Show file tree
Hide file tree
Showing 138 changed files with 36 additions and 5,475 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Description of the upcoming release here.

- [#265](https://github.com/FuelLabs/sway-libs/pull/265) Enables the metadata events now that the Rust SDK supports wrapped heap types.
- [#269](https://github.com/FuelLabs/sway-libs/pull/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.
- [#278](https://github.com/FuelLabs/sway-libs/pull/278) Deprecates the Fixed Point number library.

### Fixed

Expand All @@ -30,13 +31,13 @@ Description of the upcoming release here.
- [#268](https://github.com/FuelLabs/sway-libs/pull/268) Fixes subtraction involving negative numbers for `I8`, `I16`, `I32`, `I64`, `I128`, and `I256`.
- [#272](https://github.com/FuelLabs/sway-libs/pull/272) Fixes `From` implementations for Signed Integers with `TryFrom`.
- [#273](https://github.com/FuelLabs/sway-libs/pull/273) Fixes negative from implementations for Signed Integers.
- [#274](https://github.com/FuelLabs/sway-libs/pull/274) Fixes the `swap_configurables()` function to correctly handle the case where the bytecode is too large to fit in the buffer.
- [#275](https://github.com/FuelLabs/sway-libs/pull/275) Fixes an infinite loop in the Bytecode root library's `_compute_bytecode_root()` function.


#### Breaking

- [#263](https://github.com/FuelLabs/sway-libs/pull/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:
Expand Down Expand Up @@ -82,3 +83,5 @@ After:
```sway
let my_negative_i8: I8 = I8::neg_try_from(1u8).unwrap();
```

- [#278](https://github.com/FuelLabs/sway-libs/pull/278) Deprecates the Fixed Point number library. The Fixed Point number library is no longer available.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ For implementation details on the libraries please see the [Sway Libs Docs](http

#### Math

- [Fixed Point Number](https://docs.fuel.network/docs/sway-libs/fixed_point/) is an interface to implement fixed-point numbers.
- [Signed Integers](https://docs.fuel.network/docs/sway-libs/queue/) is an interface to implement signed integers.

> **NOTE:**
> The Fixed Point Number library has been deprecated pending a re-write.
#### Data Structures

- [Queue](https://docs.fuel.network/docs/sway-libs/queue/) is a linear data structure that provides First-In-First-Out (FIFO) operations.
Expand Down
1 change: 0 additions & 1 deletion docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- [Reentrancy Guard Library](./reentrancy/index.md)
- [Bytecode Library](./bytecode/index.md)
- [Merkle Library](./merkle/index.md)
- [Fixed Point Number Library](./fixed_point/index.md)
- [Signed Integers Library](./signed_integers/index.md)
- [Queue Library](./queue/index.md)
- [Upgradability](./upgradability/index.md)
87 changes: 0 additions & 87 deletions docs/book/src/fixed_point/index.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/book/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ The [Merkle Proof](./merkle/index.md) Library is used to verify Binary Merkle Tr

Math Libraries are libraries which provide mathematic functions or number types that are outside of the std-lib's scope.

### [Fixed Point Number Library](./fixed_point/index.md)

The [Fixed Point Number](./fixed_point/index.md) Library is an interface to implement fixed-point numbers.

### [Signed Integers](./signed_integers/index.md)

The [Signed Integers](./signed_integers/index.md) Library is an interface to implement signed integers.
Expand Down
8 changes: 0 additions & 8 deletions examples/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ dependencies = [
name = "core"
source = "path+from-root-E19CE48B3E858B72"

[[package]]
name = "fixed_point_examples"
source = "member"
dependencies = [
"std",
"sway_libs",
]

[[package]]
name = "merkle_examples"
source = "member"
Expand Down
1 change: 0 additions & 1 deletion examples/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ members = [
"./asset/setting_src20_attributes",
"./asset/supply_docs",
"./bytecode",
"./fixed_point",
"./merkle",
"./ownership",
"./pausable/pausable",
Expand Down
8 changes: 0 additions & 8 deletions examples/fixed_point/Forc.toml

This file was deleted.

60 changes: 0 additions & 60 deletions examples/fixed_point/src/main.sw

This file was deleted.

3 changes: 3 additions & 0 deletions libs/src/bytecode/utils.sw
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ pub fn _swap_configurables(
while configurable_iterator < configurables.len() {
let (offset, data) = configurables.get(configurable_iterator).unwrap();

// Make sure the configurable data doesnt overflow the bytecode
assert(offset + data.len() <= bytecode.len::<u8>());

// Overwrite the configurable data into the bytecode
data
.ptr()
Expand Down
8 changes: 0 additions & 8 deletions libs/src/fixed_point.sw

This file was deleted.

Loading

0 comments on commit ecb7f6a

Please sign in to comment.