diff --git a/framework/libra-framework/sources/ol_sources/lockbox.move b/framework/libra-framework/sources/ol_sources/lockbox.move index f5051ab1c..116013e2c 100644 --- a/framework/libra-framework/sources/ol_sources/lockbox.move +++ b/framework/libra-framework/sources/ol_sources/lockbox.move @@ -385,7 +385,7 @@ module ol_framework::lockbox { } #[test(framework = @0x1, bob_sig = @0x10002)] - #[expected_failure(abort_code = 65545)] // error::invalid_argument(EINVALID_DURATION) + #[expected_failure(abort_code = 65545, location = ol_framework::lockbox)] fun test_non_standard_duration(framework: &signer, bob_sig: &signer) acquires SlowWalletV2 { let bob_addr = signer::address_of(bob_sig); let coin = test_setup(framework, 100); @@ -417,4 +417,4 @@ module ol_framework::lockbox { let balance = balance_duration(bob_addr, 4*12); assert!(balance == 100, 7357003); } -} +} \ No newline at end of file diff --git a/framework/libra-framework/sources/ol_sources/lockbox.spec.move b/framework/libra-framework/sources/ol_sources/lockbox.spec.move index d49eda95c..053979b22 100644 --- a/framework/libra-framework/sources/ol_sources/lockbox.spec.move +++ b/framework/libra-framework/sources/ol_sources/lockbox.spec.move @@ -1,5 +1,3 @@ - - spec ol_framework::lockbox { /// Specification for maybe_initialize: @@ -82,23 +80,9 @@ spec ol_framework::lockbox { requires idx < vector::length(global(signer::address_of(user)).list); } - /// Helper function to calculate minimum amount needed to get non-zero drip spec fun min_amount_for_drip(duration_months: u64): u64 { let days = math64::mul_div(duration_months, 365, 12); days / 10000000 + 1 } - - #[test] - /// Test that verifies a user CANNOT create a lockbox with a non-standard duration - /// This test demonstrates that the DEFAULT_LOCKS list IS enforced - spec test_non_standard_duration(framework: &signer, bob_sig: &signer) { - // Pre-conditions - requires signer::address_of(bob_sig) != @0x0; // Bob must have valid address - - // Post-conditions - // The test should fail when attempting a non-standard duration (e.g., 5*12 months) - // This shows that DEFAULT_LOCKS is enforced - aborts_with error::invalid_argument(EINVALID_DURATION); - } }