forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes to update fuels-rs on small values as single bytes (FuelLabs#5264)
## Description This PR contains some necessary fixes to enable this FuelLabs/fuels-rs#1163 to be merged. 1 - It guarantees that when the env var `FORC_IMPLICIT_STD_GIT_BRANCH` is used, no `tag` or `rev` is also used; 2 - It removes all warnings from the sway std-lib; 3 - It fixes reading predicates witness when it is only one byte. ## 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](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: hal3e <[email protected]> Co-authored-by: IGI-111 <[email protected]>
- Loading branch information
1 parent
b4df674
commit 1c310f3
Showing
58 changed files
with
1,079 additions
and
780 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
test/src/e2e_vm_tests/test_programs/should_pass/language/gtf_intrinsic/Forc.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
[[package]] | ||
name = 'gtf_intrinsic' | ||
source = 'member' | ||
name = "core" | ||
source = "path+from-root-AC247AEA3D39B916" | ||
|
||
[[package]] | ||
name = "gtf_intrinsic" | ||
source = "member" | ||
dependencies = ["std"] | ||
|
||
[[package]] | ||
name = "std" | ||
source = "git+https://github.com/fuellabs/sway?tag=v0.47.0#34265301c6037d51444899a99df1cfc563df6016" | ||
dependencies = ["core"] |
1 change: 0 additions & 1 deletion
1
test/src/e2e_vm_tests/test_programs/should_pass/language/gtf_intrinsic/Forc.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
[project] | ||
authors = ["Fuel Labs <[email protected]>"] | ||
entry = "main.sw" | ||
implicit-std = false | ||
license = "Apache-2.0" | ||
name = "gtf_intrinsic" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
test/src/e2e_vm_tests/test_programs/should_pass/language/gtf_intrinsic/src/main.sw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
script; | ||
|
||
const SOME_TX_FIELD = 0x42; | ||
const SOME_OTHER_TX_FIELD = 0x77; | ||
use std::tx::*; | ||
|
||
fn main() -> (u64, b256) { | ||
// Test expected to compile but revert because `fuel-core` does not support `gtf` yet. | ||
let u64_field = __gtf::<u64>(1, SOME_TX_FIELD); | ||
let b256_field = __gtf::<b256>(2, SOME_OTHER_TX_FIELD); | ||
(u64_field, b256_field) | ||
fn main() -> u64 { | ||
assert(tx_witnesses_count() == 3); | ||
assert(tx_witness_data::<u8>(1) == 1); | ||
assert(tx_witness_data::<u64>(2) == 1234); | ||
0 | ||
} |
3 changes: 2 additions & 1 deletion
3
test/src/e2e_vm_tests/test_programs/should_pass/language/gtf_intrinsic/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
category = "run" | ||
expected_result = { action = "revert", value = 0 } | ||
expected_result = { action = "return", value = 0 } | ||
validate_abi = true | ||
witness_data = [ "0000000000000001", "00000000000004D2" ] |
Oops, something went wrong.