From 5e38ce629b772d8604e0a6b48cb1d1c67537cf39 Mon Sep 17 00:00:00 2001 From: david weil Date: Thu, 18 Jul 2024 12:09:07 -0300 Subject: [PATCH] fix: remove use of deprecated function uint::max_value --- .../avoid-panic-error-1/remediated-example/src/lib.rs | 2 +- .../avoid-panic-error-1/vulnerable-example/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test-cases/avoid-panic-error/avoid-panic-error-1/remediated-example/src/lib.rs b/test-cases/avoid-panic-error/avoid-panic-error-1/remediated-example/src/lib.rs index 871aa92d..4a50c7d8 100644 --- a/test-cases/avoid-panic-error/avoid-panic-error-1/remediated-example/src/lib.rs +++ b/test-cases/avoid-panic-error/avoid-panic-error-1/remediated-example/src/lib.rs @@ -60,7 +60,7 @@ mod tests { let client = AvoidPanicErrorClient::new(&env, &contract_id); // When - let _max_value = client.try_add(&u32::max_value()); + let _max_value = client.try_add(&u32::MAX); let overflow = client.try_add(&1); // Then diff --git a/test-cases/avoid-panic-error/avoid-panic-error-1/vulnerable-example/src/lib.rs b/test-cases/avoid-panic-error/avoid-panic-error-1/vulnerable-example/src/lib.rs index 2ead32b9..7119ed1d 100644 --- a/test-cases/avoid-panic-error/avoid-panic-error-1/vulnerable-example/src/lib.rs +++ b/test-cases/avoid-panic-error/avoid-panic-error-1/vulnerable-example/src/lib.rs @@ -54,7 +54,7 @@ mod tests { let client = AvoidPanicErrorClient::new(&env, &contract_id); // When - client.add(&u32::max_value()); + client.add(&u32::MAX); client.add(&1); // Then