Skip to content

Commit

Permalink
Merge branch 'master' into feat/script_analyzing
Browse files Browse the repository at this point in the history
  • Loading branch information
hal3e authored Dec 8, 2024
2 parents af4e8d6 + f989679 commit 556c09a
Show file tree
Hide file tree
Showing 16 changed files with 393 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
FUEL_CORE_PATCH_BRANCH: ""
FUEL_CORE_PATCH_REVISION: ""
RUST_VERSION: 1.79.0
FORC_VERSION: 0.66.4
FORC_VERSION: 0.66.5
FORC_PATCH_BRANCH: ""
FORC_PATCH_REVISION: ""
NEXTEST_HIDE_PROGRESS_BAR: "true"
Expand Down
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ elliptic-curve = { version = "0.13.8", default-features = false }
test-case = { version = "3.3", default-features = false }
eth-keystore = "0.5.0"
flate2 = { version = "1.0", default-features = false }
fuel-abi-types = "0.7.0"
fuel-abi-types = "0.8.0"
futures = "0.3.29"
hex = { version = "0.4.3", default-features = false }
itertools = "0.12.0"
Expand Down Expand Up @@ -88,23 +88,23 @@ dotenv = { version = "0.15", default-features = false }
toml = { version = "0.8", default-features = false }

# Dependencies from the `fuel-core` repository:
fuel-core = { version = "0.40.0", default-features = false, features = [
fuel-core = { version = "0.40.1", default-features = false, features = [
"wasm-executor",
] }
fuel-core-chain-config = { version = "0.40.0", default-features = false }
fuel-core-client = { version = "0.40.0", default-features = false }
fuel-core-poa = { version = "0.40.0", default-features = false }
fuel-core-services = { version = "0.40.0", default-features = false }
fuel-core-types = { version = "0.40.0", default-features = false }
fuel-core-chain-config = { version = "0.40.1", default-features = false }
fuel-core-client = { version = "0.40.1", default-features = false }
fuel-core-poa = { version = "0.40.1", default-features = false }
fuel-core-services = { version = "0.40.1", default-features = false }
fuel-core-types = { version = "0.40.1", default-features = false }

# Dependencies from the `fuel-vm` repository:
fuel-asm = { version = "0.58.0" }
fuel-crypto = { version = "0.58.0" }
fuel-merkle = { version = "0.58.0" }
fuel-storage = { version = "0.58.0" }
fuel-tx = { version = "0.58.0" }
fuel-types = { version = "0.58.0" }
fuel-vm = { version = "0.58.0" }
fuel-asm = { version = "0.58.2" }
fuel-crypto = { version = "0.58.2" }
fuel-merkle = { version = "0.58.2" }
fuel-storage = { version = "0.58.2" }
fuel-tx = { version = "0.58.2" }
fuel-types = { version = "0.58.2" }
fuel-vm = { version = "0.58.2" }

# Workspace projects
fuels = { version = "0.66.10", path = "./packages/fuels", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions e2e/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ members = [
'sway/contracts/needs_custom_decoder',
'sway/contracts/payable_annotation',
'sway/contracts/proxy',
'sway/contracts/require',
'sway/contracts/revert_logs',
'sway/contracts/revert_transaction_error',
'sway/contracts/storage',
'sway/contracts/token_ops',
Expand Down Expand Up @@ -55,7 +55,7 @@ members = [
'sway/scripts/script_enum',
'sway/scripts/script_needs_custom_decoder',
'sway/scripts/script_proxy',
'sway/scripts/script_require',
'sway/scripts/script_revert_logs',
'sway/scripts/script_struct',
'sway/scripts/transfer_script',
'sway/types/contracts/b256',
Expand Down
17 changes: 15 additions & 2 deletions e2e/sway/contracts/asserts/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ impl Eq for TestEnum {

abi TestContract {
fn assert_primitive(a: u64, b: u64);

fn assert_eq_primitive(a: u64, b: u64);
fn assert_eq_struct(test_struct: TestStruct, test_struct2: TestStruct);
fn assert_eq_enum(test_enum: TestEnum, test_enum2: TestEnum);

fn assert_ne_primitive(a: u64, b: u64);
fn assert_ne_struct(test_struct: TestStruct, test_struct2: TestStruct);
fn assert_ne_enum(test_enum: TestEnum, test_enum2: TestEnum);
}

impl TestContract for Contract {
Expand All @@ -42,12 +47,20 @@ impl TestContract for Contract {
fn assert_eq_primitive(a: u64, b: u64) {
assert_eq(a, b);
}

fn assert_eq_struct(test_struct: TestStruct, test_struct2: TestStruct) {
assert_eq(test_struct, test_struct2);
}

fn assert_eq_enum(test_enum: TestEnum, test_enum2: TestEnum) {
assert_eq(test_enum, test_enum2);
}

fn assert_ne_primitive(a: u64, b: u64) {
assert_ne(a, b);
}
fn assert_ne_struct(test_struct: TestStruct, test_struct2: TestStruct) {
assert_ne(test_struct, test_struct2);
}
fn assert_ne_enum(test_enum: TestEnum, test_enum2: TestEnum) {
assert_ne(test_enum, test_enum2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
authors = ["Fuel Labs <[email protected]>"]
entry = "main.sw"
license = "Apache-2.0"
name = "require"
name = "revert_logs"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ abi TestContract {
fn require_string();
fn require_custom_generic();
fn require_with_additional_logs();

fn rev_w_log_primitive();
fn rev_w_log_string();
fn rev_w_log_custom_generic();
}

impl TestContract for Contract {
Expand Down Expand Up @@ -57,4 +61,28 @@ impl TestContract for Contract {
log(__to_str_array("fuel"));
require(false, 64);
}

fn rev_w_log_primitive() {
revert_with_log(42);
}

fn rev_w_log_string() {
revert_with_log(__to_str_array("fuel"));
}

fn rev_w_log_custom_generic() {
let l: [u8; 3] = [1u8, 2u8, 3u8];

let test_enum = EnumWithGeneric::VariantOne(l);
let test_struct_nested = StructWithNestedGeneric {
field_1: test_enum,
field_2: 64,
};
let test_deeply_nested_generic = StructDeeplyNestedGeneric {
field_1: test_struct_nested,
field_2: 64,
};

revert_with_log(test_deeply_nested_generic);
}
}
11 changes: 11 additions & 0 deletions e2e/sway/scripts/script_asserts/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ enum MatchEnum {
AssertEqPrimitive: (u64, u64),
AssertEqStruct: (TestStruct, TestStruct),
AssertEqEnum: (TestEnum, TestEnum),
AssertNePrimitive: (u64, u64),
AssertNeStruct: (TestStruct, TestStruct),
AssertNeEnum: (TestEnum, TestEnum),
}

fn main(match_enum: MatchEnum) {
Expand All @@ -46,5 +49,13 @@ fn main(match_enum: MatchEnum) {
} else if let MatchEnum::AssertEqEnum((test_enum, test_enum2)) = match_enum
{
assert_eq(test_enum, test_enum2);
} else if let MatchEnum::AssertNePrimitive((a, b)) = match_enum {
assert_ne(a, b);
} else if let MatchEnum::AssertNeStruct((test_struct, test_struct2)) = match_enum
{
assert_ne(test_struct, test_struct2);
} else if let MatchEnum::AssertNeEnum((test_enum, test_enum2)) = match_enum
{
assert_ne(test_enum, test_enum2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
authors = ["Fuel Labs <[email protected]>"]
entry = "main.sw"
license = "Apache-2.0"
name = "script_require"
name = "script_revert_logs"
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ enum MatchEnum {
RequireString: (),
RequireCustomGeneric: (),
RequireWithAdditionalLogs: (),
RevWLogPrimitive: (),
RevWLogString: (),
RevWLogCustomGeneric: (),
}

fn main(match_enum: MatchEnum) {
Expand All @@ -51,5 +54,23 @@ fn main(match_enum: MatchEnum) {
log(42);
log(__to_str_array("fuel"));
require(false, 64);
} else if let MatchEnum::RevWLogPrimitive = match_enum {
revert_with_log(42);
} else if let MatchEnum::RevWLogString = match_enum {
revert_with_log(__to_str_array("fuel"));
} else if let MatchEnum::RevWLogCustomGeneric = match_enum {
let l: [u8; 3] = [1u8, 2u8, 3u8];

let test_enum = EnumWithGeneric::VariantOne(l);
let test_struct_nested = StructWithNestedGeneric {
field_1: test_enum,
field_2: 64,
};
let test_deeply_nested_generic = StructDeeplyNestedGeneric {
field_1: test_struct_nested,
field_2: 64,
};

revert_with_log(test_deeply_nested_generic);
}
}
2 changes: 1 addition & 1 deletion e2e/sway/types/contracts/vectors/src/main.sw
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
contract;

mod data_structures;
pub mod data_structures;
mod eq_impls;
mod utils;

Expand Down
2 changes: 1 addition & 1 deletion e2e/sway/types/scripts/script_vectors/src/main.sw
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script;

mod data_structures;
pub mod data_structures;
mod eq_impls;
mod utils;

Expand Down
Loading

0 comments on commit 556c09a

Please sign in to comment.