From 6409aa15bfa3c33e1ee5eb6792f2c320fb06b976 Mon Sep 17 00:00:00 2001 From: Marcos Henrich Date: Tue, 13 Aug 2024 12:52:15 +0100 Subject: [PATCH] Fixes build. --- Cargo.lock | 1 + .../standalone_contract-abi.json | 20 +++++++++---------- sway-lib-std/src/ecr.sw | 3 ++- sway-lib-std/src/execution.sw | 2 +- .../predicate_invalid_opcodes/src/main.sw | 2 +- .../predicate_invalid_opcodes/test.toml | 2 +- test/src/ir_generation/tests/jmp_mem.sw | 6 +++--- test/src/sdk-harness/Cargo.toml | 5 ++--- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41ba01bb113..1f59d935970 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2036,6 +2036,7 @@ dependencies = [ "fuel-crypto", "fuel-tx", "fuel-vm", + "fuels", "fuels-accounts", "fuels-core", "futures", diff --git a/forc-plugins/forc-client/test/data/standalone_contract/standalone_contract-abi.json b/forc-plugins/forc-client/test/data/standalone_contract/standalone_contract-abi.json index 05b0f04b2d3..a2d797817fc 100644 --- a/forc-plugins/forc-client/test/data/standalone_contract/standalone_contract-abi.json +++ b/forc-plugins/forc-client/test/data/standalone_contract/standalone_contract-abi.json @@ -1,23 +1,23 @@ { + "programType": "contract", + "specVersion": "1", + "encodingVersion": "1", "concreteTypes": [ { - "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0", - "type": "u64" + "type": "bool", + "concreteTypeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903" } ], - "configurables": [], - "encodingVersion": "1", + "metadataTypes": [], "functions": [ { - "attributes": null, "inputs": [], - "name": "main", - "output": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" + "name": "test_function", + "output": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903", + "attributes": null } ], "loggedTypes": [], "messagesTypes": [], - "metadataTypes": [], - "programType": "script", - "specVersion": "1" + "configurables": [] } \ No newline at end of file diff --git a/sway-lib-std/src/ecr.sw b/sway-lib-std/src/ecr.sw index 78078e0db2f..ce1beb8f4d2 100644 --- a/sway-lib-std/src/ecr.sw +++ b/sway-lib-std/src/ecr.sw @@ -163,8 +163,9 @@ pub fn ed_verify( buffer: public_key, sig: __addr_of(signature), hash: msg_hash, + len: 32, ) { - ed19 buffer sig hash i32; + ed19 buffer sig hash len; err }; // check the $err register to see if the `ed19` opcode succeeded diff --git a/sway-lib-std/src/execution.sw b/sway-lib-std/src/execution.sw index 8bd4f558418..ad4770992af 100644 --- a/sway-lib-std/src/execution.sw +++ b/sway-lib-std/src/execution.sw @@ -68,4 +68,4 @@ pub fn run_external2(load_target1: ContractId, load_target2: ContractId) -> ! { sw hp ssp_saved i0; } __jmp_mem() -} \ No newline at end of file +} diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes/src/main.sw index c4afb3c6574..1475bcf18f3 100644 --- a/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes/src/main.sw @@ -57,7 +57,7 @@ fn main() -> bool { }; asm(r1: 0, r2: 0, r3: 0) { - ldc r1 r2 r3; + ldc r1 r2 r3 i0; } asm(r1: 0, r2: 0, r3: 0, r4: 0) { diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes/test.toml b/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes/test.toml index b384ae9f5a9..05d73f3c66d 100644 --- a/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes/test.toml @@ -35,7 +35,7 @@ category = "fail" # not: $()The GM (get-metadata) opcode, when called from an external context, will cause the VM to panic. -# check: ldc r1 r2 r3; +# check: ldc r1 r2 r3 i0; # nextln: $()The LDC opcode cannot be used in a predicate. # check: log r1 r2 r3 r4; diff --git a/test/src/ir_generation/tests/jmp_mem.sw b/test/src/ir_generation/tests/jmp_mem.sw index fd5f10a2a65..7861956060b 100644 --- a/test/src/ir_generation/tests/jmp_mem.sw +++ b/test/src/ir_generation/tests/jmp_mem.sw @@ -19,7 +19,7 @@ impl MyContract for Contract { csiz length code_id; // Save the old ssp move ssp_saved ssp; - ldc code_id zero length; + ldc code_id zero length i0; // Store the old ssp to MEM[$hp] so that we can jump to it. // allocate a word the stack addi word zero i64; @@ -40,7 +40,7 @@ impl MyContract for Contract { // check: pub entry fn test_function // not: local // check: csiz length code_id -// check: ldc code_id zero length, +// check: ldc code_id zero length i0, // check: jmp_mem // ::check-asm:: @@ -48,7 +48,7 @@ impl MyContract for Contract { // regex: REG=.r\d+\b // check: csiz $(len=$REG) $REG -// check: ldc $REG $$zero $len +// check: ldc $REG $$zero $len i0 // check: lw $(target=$REG) $$hp i0 // check: sub $(jmp_target_4=$REG) $target $$is // check: divi $(jmp_target=$REG) $jmp_target_4 i4 diff --git a/test/src/sdk-harness/Cargo.toml b/test/src/sdk-harness/Cargo.toml index 32c4b51c7f2..108e5820aa5 100644 --- a/test/src/sdk-harness/Cargo.toml +++ b/test/src/sdk-harness/Cargo.toml @@ -14,11 +14,10 @@ fuel-core = { version = "0.31.0", default-features = false } fuel-core-client = { version = "0.31.0", default-features = false } # Dependencies from the `fuel-vm` repository: -fuel-vm = { version = "0.55.0", features = ["random"] } +fuel-vm = { version = "0.56.0", features = ["random"] } # Dependencies from the `fuels-rs` repository: -fuels = { git = "https://github.com/FuelLabs/fuels-rs", branch = "esdrubal/abi_changes2", features = ["fuel-core-lib"]} -#fuels = { version = "0.65.1", features = ["fuel-core-lib"] } +uels = { version = "0.66.0", features = ["fuel-core-lib"] } hex = "0.4.3" paste = "1.0.14"