Skip to content

Commit e4333be

Browse files
authored
Merge branch 'master' into vaivaswatha/memcpy_prop_new
2 parents 002320e + fc2aed7 commit e4333be

File tree

14 files changed

+46
-32
lines changed

14 files changed

+46
-32
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -538,21 +538,21 @@ jobs:
538538
- name: Run Std Unit Tests - Experimental feature 'const_generics,new_hashing' (Release)
539539
run: forc test --release --path sway-lib-std --experimental const_generics --no-experimental new_hashing
540540
- name: Run In Language Unit Tests (Debug)
541-
run: forc test --path test/src/in_language_tests
541+
run: forc test --error-on-warnings --path test/src/in_language_tests
542542
- name: Run In Language Unit Tests (Release)
543-
run: forc test --release --path test/src/in_language_tests
543+
run: forc test --error-on-warnings --release --path test/src/in_language_tests
544544
- name: Run In Language Unit Tests - Experimental feature 'const_generics' (Debug)
545-
run: forc test --path test/src/in_language_tests --experimental const_generics
545+
run: forc test --error-on-warnings --path test/src/in_language_tests --experimental const_generics
546546
- name: Run In Language Unit Tests - Experimental feature 'const_generics' (Release)
547-
run: forc test --release --path test/src/in_language_tests --experimental const_generics
547+
run: forc test --error-on-warnings --release --path test/src/in_language_tests --experimental const_generics
548548
- name: Run In Language Unit Tests - Experimental feature 'new_hashing' (Debug)
549-
run: forc test --path test/src/in_language_tests --no-experimental new_hashing
549+
run: forc test --error-on-warnings --path test/src/in_language_tests --no-experimental new_hashing
550550
- name: Run In Language Unit Tests - Experimental feature 'new_hashing' (Release)
551-
run: forc test --release --path test/src/in_language_tests --no-experimental new_hashing
551+
run: forc test --error-on-warnings --release --path test/src/in_language_tests --no-experimental new_hashing
552552
- name: Run In Language Unit Tests - Experimental feature 'const_generics,new_hashing' (Debug)
553-
run: forc test --path test/src/in_language_tests --experimental const_generics --no-experimental new_hashing
553+
run: forc test --error-on-warnings --path test/src/in_language_tests --experimental const_generics --no-experimental new_hashing
554554
- name: Run In Language Unit Tests - Experimental feature 'const_generics,new_hashing' (Release)
555-
run: forc test --release --path test/src/in_language_tests --experimental const_generics --no-experimental new_hashing
555+
run: forc test --error-on-warnings --release --path test/src/in_language_tests --experimental const_generics --no-experimental new_hashing
556556

557557
forc-pkg-fuels-deps-check:
558558
runs-on: ubuntu-latest

test/src/in_language_tests/test_programs/crypto_ed25519_inline_tests/src/main.sw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn ed25519_bits() {
3737
}
3838

3939
#[test]
40-
fn ed25519__verify() {
40+
fn ed25519_verify() {
4141
let pub_key = 0x314fa58689bbe1da2430517de2d772b384a1c1d2e9cb87e73c6afcf246045b10;
4242
let msg = b256::zero();
4343
let msg_hash = sha256(msg);

test/src/in_language_tests/test_programs/crypto_secp256k1_inline_tests/src/main.sw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ fn secp256k1_verify_address() {
165165
let lo_2 = 0x2555de81cd3a40382d3d64eb1c77e463eea5a76d65ec85f283e0b3d568352678;
166166
let msg_hash_2 = 0xa13f4ab54057ce064d3dd97ac3ff30ed704e73956896c03650fe59b1a561fe15;
167167
let address_2 = Address::zero();
168-
let signature_2 = Secp256k1::from((hi_2, lo_2));
168+
let _signature_2 = Secp256k1::from((hi_2, lo_2));
169169
let message_2 = Message::from(msg_hash_2);
170170

171171
// A recovered Fuel address.
@@ -190,7 +190,7 @@ fn secp256k1_verify_evm_address() {
190190
let lo_2 = 0x44ac566bd156b4fc71a4a4cb2655d3dd360c695edb17dc3b64d611e122fea23d;
191191
let msg_hash_2 = 0xee45573606c96c98ba970ff7cf9511f1b8b25e6bcd52ced30b89df1e4a9c4323;
192192
let address_2 = EvmAddress::zero();
193-
let signature_2 = Secp256k1::from((hi_2, lo_2));
193+
let _signature_2 = Secp256k1::from((hi_2, lo_2));
194194
let message_2 = Message::from(msg_hash_2);
195195

196196
// A recovered Fuel address.

test/src/in_language_tests/test_programs/crypto_secp256r1_inline_tests/src/main.sw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ fn secp256r1_verify_address() {
165165
let lo_2 = 0x44ac566bd156b4fc71a4a4cb2655d3dd360c695edb17dc3b64d611e122fea23d;
166166
let msg_hash_2 = 0xee45573606c96c98ba970ff7cf9511f1b8b25e6bcd52ced30b89df1e4a9c4323;
167167
let address_2 = Address::zero();
168-
let signature_2 = Secp256r1::from((hi_2, lo_2));
168+
let _signature_2 = Secp256r1::from((hi_2, lo_2));
169169
let message_2 = Message::from(msg_hash_2);
170170

171171
// A recovered Fuel address.

test/src/in_language_tests/test_programs/crypto_signature_inline_tests/src/main.sw

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn signature_recover() {
5252
let msg_hash_3 = sha256(msg_3);
5353
let hi_3 = 0xf38cef9361894be6c6e0eddec28a663d099d7ddff17c8077a1447d7ecb4e6545;
5454
let lo_3 = 0xf5084560039486d3462dd65a40c80a74709b2f06d450ffc5dc00345c6b2cdd00;
55-
let public_key_3: PublicKey = PublicKey::from(pub_key_3);
55+
let _public_key_3: PublicKey = PublicKey::from(pub_key_3);
5656
let signature_3: Signature = Signature::Ed25519(Ed25519::from((hi_3, lo_3)));
5757
let message_3: Message = Message::from(msg_hash_3);
5858

@@ -92,7 +92,7 @@ fn signature_address() {
9292
let msg_hash_3 = sha256(msg_3);
9393
let hi_3 = 0xf38cef9361894be6c6e0eddec28a663d099d7ddff17c8077a1447d7ecb4e6545;
9494
let lo_3 = 0xf5084560039486d3462dd65a40c80a74709b2f06d450ffc5dc00345c6b2cdd00;
95-
let public_key_3: PublicKey = PublicKey::from(pub_key_3);
95+
let _public_key_3: PublicKey = PublicKey::from(pub_key_3);
9696
let signature_3: Signature = Signature::Ed25519(Ed25519::from((hi_3, lo_3)));
9797
let message_3: Message = Message::from(msg_hash_3);
9898

@@ -130,7 +130,7 @@ fn signature_evm_address() {
130130
let msg_hash_3 = sha256(msg_3);
131131
let hi_3 = 0xf38cef9361894be6c6e0eddec28a663d099d7ddff17c8077a1447d7ecb4e6545;
132132
let lo_3 = 0xf5084560039486d3462dd65a40c80a74709b2f06d450ffc5dc00345c6b2cdd00;
133-
let public_key_3: PublicKey = PublicKey::from(pub_key_3);
133+
let _public_key_3: PublicKey = PublicKey::from(pub_key_3);
134134
let signature_3: Signature = Signature::Ed25519(Ed25519::from((hi_3, lo_3)));
135135
let message_3: Message = Message::from(msg_hash_3);
136136

@@ -210,7 +210,7 @@ fn signature_verify_address() {
210210
let msg_hash_3 = sha256(msg_3);
211211
let hi_3 = 0xf38cef9361894be6c6e0eddec28a663d099d7ddff17c8077a1447d7ecb4e6545;
212212
let lo_3 = 0xf5084560039486d3462dd65a40c80a74709b2f06d450ffc5dc00345c6b2cdd00;
213-
let public_key_3: PublicKey = PublicKey::from(pub_key_3);
213+
let _public_key_3: PublicKey = PublicKey::from(pub_key_3);
214214
let signature_3: Signature = Signature::Ed25519(Ed25519::from((hi_3, lo_3)));
215215
let message_3: Message = Message::from(msg_hash_3);
216216

@@ -248,7 +248,7 @@ fn signature_verify_evm_address() {
248248
let msg_hash_3 = sha256(msg_3);
249249
let hi_3 = 0xf38cef9361894be6c6e0eddec28a663d099d7ddff17c8077a1447d7ecb4e6545;
250250
let lo_3 = 0xf5084560039486d3462dd65a40c80a74709b2f06d450ffc5dc00345c6b2cdd00;
251-
let public_key_3: PublicKey = PublicKey::from(pub_key_3);
251+
let _public_key_3: PublicKey = PublicKey::from(pub_key_3);
252252
let signature_3: Signature = Signature::Ed25519(Ed25519::from((hi_3, lo_3)));
253253
let message_3: Message = Message::from(msg_hash_3);
254254

test/src/in_language_tests/test_programs/ecr_inline_tests/src/main.sw

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use std::{
1616
},
1717
};
1818

19+
#[allow(deprecated)]
1920
#[test]
2021
fn ecr_ec_recover() {
2122
let hi_1 = 0x61f3caf4c0912cec69ff0b226638d397115c623a7f057914d48a7e4daf1cf6d8;
@@ -41,6 +42,7 @@ fn ecr_ec_recover() {
4142
assert(result_2.is_err());
4243
}
4344

45+
#[allow(deprecated)]
4446
#[test]
4547
fn ecr_ec_recover_r1() {
4648
let hi_1 = 0xbd0c9b8792876712afadbff382e1bf31c44437823ed761cc3600d0016de511ac;
@@ -65,6 +67,7 @@ fn ecr_ec_recover_r1() {
6567
assert(result_2.is_err());
6668
}
6769

70+
#[allow(deprecated)]
6871
#[test]
6972
fn ecr_ec_recover_address() {
7073
let hi_1 = 0x61f3caf4c0912cec69ff0b226638d397115c623a7f057914d48a7e4daf1cf6d8;
@@ -86,6 +89,7 @@ fn ecr_ec_recover_address() {
8689
assert(result_2.is_err());
8790
}
8891

92+
#[allow(deprecated)]
8993
#[test]
9094
fn ecr_ec_recover_address_r1() {
9195
let hi_1 = 0xbd0c9b8792876713afa8bf3383eebf31c43437823ed761cc3600d0016de5110c;
@@ -150,6 +154,7 @@ fn ecr_ec_recover_address_r1() {
150154
// x = 16, (5573fe0bf140c8f1ca1b6b41fd4dc0bfcf92aefc67ab7dfd8aac1c264a66e67f, b47ed5cd8285cc2e8bf4a24a5e923a543278c43630f6e3d3da5a884de4982406)
151155
// x = 32, (00d8a17c74a926854155f0092fe8c2db55220cff891a38f0ee00e549fec8ba07, f2dda3573b2f03d19eefebf93aa93d4ebca81e2c42de5b0f52d8c957f6390a0b)
152156
// x = 64, (9a9e7077c905c855c86fb6aea6052f50a2cf29f70205f465d809cb0b81c6503f, fea5d320a5f9d4164b7eca627d3e81293083e7f6682b3b1ebc257459fcf89b08)
157+
#[allow(deprecated)]
153158
#[test]
154159
fn ecr_ed_verify() {
155160
let pub_key = 0x7127a92630327cfa3fac37b0dcc969968da0efb18bbbbf498c16966373973b21;
@@ -194,6 +199,7 @@ fn ecr_ed_verify() {
194199
}
195200
}
196201

202+
#[allow(deprecated)]
197203
#[test]
198204
fn ecr_ed_verify_fail() {
199205
let pub_key = 0x7127a92630327cfa3fac37b0dcc969968da0efb18bbbbf498c16966373973b21;

test/src/in_language_tests/test_programs/flags_inline_tests/src/main.sw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn test_panic_on_overflow_enabled() {
7373
// Enabled by default
7474
assert(panic_on_overflow_enabled());
7575

76-
disable_panic_on_overflow();
76+
let _ = disable_panic_on_overflow();
7777
assert(!panic_on_overflow_enabled());
7878

7979
enable_panic_on_overflow();
@@ -85,7 +85,7 @@ fn test_panic_on_unsafe_math_enabled() {
8585
// Enabled by default
8686
assert(panic_on_unsafe_math_enabled());
8787

88-
disable_panic_on_unsafe_math();
88+
let _ = disable_panic_on_unsafe_math();
8989
assert(!panic_on_unsafe_math_enabled());
9090

9191
enable_panic_on_unsafe_math();

test/src/in_language_tests/test_programs/math_inline_tests/src/modulo.sw

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn revert_math_u8_modulo_panic_on_overflow_disabled() {
3131

3232
#[test]
3333
pub fn math_u8_modulo_unsafe_math() {
34-
disable_panic_on_unsafe_math();
34+
let _ = disable_panic_on_unsafe_math();
3535
assert(0u8 % 0u8 == 0u8);
3636
assert(1u8 % 0u8 == 0u8);
3737
assert(u8::max() % 0u8 == 0u8);
@@ -66,7 +66,7 @@ pub fn revert_math_u16_modulo_panic_on_overflow_disabled() {
6666

6767
#[test]
6868
pub fn math_u16_modulo_unsafe_math() {
69-
disable_panic_on_unsafe_math();
69+
let _ = disable_panic_on_unsafe_math();
7070
assert(0u16 % 0u16 == 0u16);
7171
assert(1u16 % 0u16 == 0u16);
7272
assert(u16::max() % 0u16 == 0u16);
@@ -101,7 +101,7 @@ pub fn revert_math_u32_modulo_panic_on_overflow_disabled() {
101101

102102
#[test]
103103
pub fn math_u32_modulo_unsafe_math() {
104-
disable_panic_on_unsafe_math();
104+
let _ = disable_panic_on_unsafe_math();
105105
assert(0u32 % 0u32 == 0u32);
106106
assert(1u32 % 0u32 == 0u32);
107107
assert(u32::max() % 0u32 == 0u32);
@@ -136,7 +136,7 @@ pub fn revert_math_u64_modulo_panic_on_disabled_overflow() {
136136

137137
#[test]
138138
pub fn math_u64_modulo_unsafe_math() {
139-
disable_panic_on_unsafe_math();
139+
let _ = disable_panic_on_unsafe_math();
140140
assert(0u64 % 0u64 == 0u64);
141141
assert(1u64 % 0u64 == 0u64);
142142
assert(u64::max() % 0u64 == 0u64);
@@ -170,7 +170,7 @@ pub fn revert_math_u256_modulo_panic_on_disabled_overflow() {
170170

171171
#[test]
172172
pub fn math_u256_modulo_unsafe_math() {
173-
disable_panic_on_unsafe_math();
173+
let _ = disable_panic_on_unsafe_math();
174174
assert(0x0u256 % 0x0u256 == 0x0u256);
175175
assert(0x1u256 % 0x0u256 == 0x0u256);
176176
assert(u256::max() % 0x0u256 == 0x0u256);

test/src/in_language_tests/test_programs/math_inline_tests/src/pow.sw

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ fn math_power_u256() {
221221
let zero = 0x00u256;
222222
let one = 0x01u256;
223223
let two = 0x02u256;
224+
let three = 0x03u256;
224225
let four = 0x04u256;
225226
let five = 0x05u256;
226227
let eight = 0x08u256;
@@ -242,6 +243,9 @@ fn math_power_u256() {
242243
assert(two.pow(3) == eight);
243244
assert(two ** 3 == eight);
244245

246+
assert(three.pow(2) == nine);
247+
assert(three ** 2 == nine);
248+
245249
assert(0x2au256.pow(2) == 0x06e4u256);
246250
assert(0x2au256 ** 2 == 0x06e4u256);
247251

test/src/in_language_tests/test_programs/storage_vec_iter_tests/src/main.sw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ storage {
1313
vec_of_vec: StorageVec<StorageVec<u64>> = StorageVec {},
1414
}
1515

16+
#[allow(dead_code)] // TODO-DCA: Remove this `allow` once https://github.com/FuelLabs/sway/issues/7462 is fixed.
1617
#[storage(read)]
1718
fn assert_empty_vec_next_returns_none_impl<T>(slot_id_preimage: u64) {
1819
let vec: StorageKey<StorageVec<T>> = StorageKey::new(sha256(slot_id_preimage), 0, sha256(slot_id_preimage + 100));
1920
assert(vec.iter().next().is_none());
2021
}
2122

23+
#[allow(dead_code)] // TODO-DCA: Remove this `allow` once https://github.com/FuelLabs/sway/issues/7462 is fixed.
2224
#[storage(read, write)]
2325
fn assert_vec_with_elements_next_returns_element_impl<T>(
2426
slot_id_preimage: u64,
@@ -54,6 +56,7 @@ where
5456
assert(element_after_last.is_none());
5557
}
5658

59+
#[allow(dead_code)] // TODO-DCA: Remove this `allow` once https://github.com/FuelLabs/sway/issues/7462 is fixed.
5760
#[storage(read, write)]
5861
fn assert_vec_with_elements_for_loop_iteration_impl<T>(
5962
slot_id_preimage: u64,

0 commit comments

Comments
 (0)