This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove `no-vm-static` feature * draft usage-marker for the VM * impl usage-marker for the VM * describe boxed closures types in less complex way * fmt * more consistent declarations * add test for VM's cache cleaning
- Loading branch information
Showing
9 changed files
with
113 additions
and
72 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/// Tests related to VM usage and management. | ||
mod common; | ||
use common::assets::modules; | ||
use common::mock::*; | ||
use common::addr::*; | ||
use common::utils; | ||
|
||
#[test] | ||
/// Cache should be cleaned for new block if VM used. | ||
fn mvm_cleanup_cache() { | ||
use sp_mvm::mvm::MoveVmUsed; | ||
|
||
RuntimeBuilder::new().build().execute_with(|| { | ||
roll_next_block(); | ||
// on finalize -> clean cache | ||
assert!(!sp_mvm::Pallet::<Test>::is_move_vm_used()); | ||
|
||
// use the VM | ||
utils::publish_module(bob_public_key(), &modules::user::STORE, None).unwrap(); | ||
|
||
// VM used just now | ||
assert!(sp_mvm::Pallet::<Test>::is_move_vm_used()); | ||
|
||
roll_next_block(); | ||
// on finalize -> clean cache | ||
assert!(!sp_mvm::Pallet::<Test>::is_move_vm_used()); | ||
}); | ||
} |