-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
critical tests for ol_account, slow, sacred, written and passing
- Loading branch information
1 parent
679b67a
commit 92018e5
Showing
8 changed files
with
100 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
# Prover Tests are WIP | ||
# These are the prover tests that have been written | ||
# and are known to pass | ||
PROVER_TESTS = demo ol_account slow sacred | ||
|
||
test: | ||
cargo r upgrade --output-dir ./releases/upgrade --framework-local-dir ./libra-framework | ||
VENDOR_TESTS = chain_id guid | ||
|
||
prove: | ||
@cd libra-framework && \ | ||
for i in ${PROVER_TESTS} ${VENDOR_TESTS}; do \ | ||
diem move prove -f $$i; \ | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 14 additions & 37 deletions
51
framework/libra-framework/sources/ol_sources/demo.spec.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,23 @@ | ||
spec ol_framework::demo { | ||
spec module { | ||
pragma verify = true; | ||
pragma aborts_if_is_strict; | ||
} | ||
|
||
// spec set_version(account: &signer, major: u64) { | ||
// use std::signer; | ||
// use diem_framework::chain_status; | ||
// use diem_framework::timestamp; | ||
// use diem_framework::stake; | ||
// use diem_framework::coin::CoinInfo; | ||
// use diem_framework::gas_coin::GasCoin; | ||
// use diem_framework::transaction_fee; | ||
// // use diem_framework::staking_config; | ||
// // Not verified when verify_duration_estimate > vc_timeout | ||
// pragma verify_duration_estimate = 120; // TODO: set because of timeout (property proved). | ||
// include transaction_fee::RequiresCollectedFeesPerValueLeqBlockDiemSupply; | ||
// // include staking_config::StakingRewardsConfigRequirement; | ||
// requires chain_status::is_operating(); | ||
// requires timestamp::spec_now_microseconds() >= reconfiguration::last_reconfiguration_time(); | ||
// requires exists<stake::ValidatorFees>(@diem_framework); | ||
// requires exists<CoinInfo<GasCoin>>(@diem_framework); | ||
|
||
// aborts_if !exists<SetVersionCapability>(signer::address_of(account)); | ||
// aborts_if !exists<Version>(@diem_framework); | ||
|
||
// let old_major = global<Version>(@diem_framework).major; | ||
// aborts_if !(old_major < major); | ||
// } | ||
spec print_this(account: &signer) { | ||
// should not abort | ||
pragma aborts_if_is_strict; | ||
} | ||
|
||
// /// Abort if resource already exists in `@diem_framwork` when initializing. | ||
// spec initialize(diem_framework: &signer, initial_version: u64) { | ||
// use std::signer; | ||
// TODO in strict mode | ||
spec set_message(account: &signer, message: string::String) { | ||
// pragma aborts_if_is_strict; | ||
// let events = borrow_global<MessageHolder>(signer::address_of(account)).message_change_events; | ||
// aborts_if event::counter(events) > MAX_U64; | ||
} | ||
|
||
// aborts_if signer::address_of(diem_framework) != @diem_framework; | ||
// aborts_if exists<Version>(@diem_framework); | ||
// aborts_if exists<SetVersionCapability>(@diem_framework); | ||
// } | ||
spec get_message(addr: address): string::String { | ||
pragma aborts_if_is_strict; | ||
aborts_if !exists<MessageHolder>(addr); | ||
|
||
// /// This module turns on `aborts_if_is_strict`, so need to add spec for test function `initialize_for_test`. | ||
// spec initialize_for_test { | ||
// // Don't verify test functions. | ||
// pragma verify = false; | ||
// } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters