-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4504: Update and add execution tests r=AurelienFT a=AurelienFT Close #4503 Co-authored-by: AurelienFT <[email protected]>
- Loading branch information
Showing
24 changed files
with
2,875 additions
and
3,372 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 |
---|---|---|
@@ -1,22 +1,19 @@ | ||
// Copyright (c) 2022 MASSA LABS <[email protected]> | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use hex_literal::hex; | ||
use massa_models::address::Address; | ||
use massa_sc_runtime::Interface; | ||
use std::str::FromStr; | ||
use hex_literal::hex; | ||
use massa_models::address::Address; | ||
use massa_sc_runtime::Interface; | ||
use std::str::FromStr; | ||
|
||
use crate::interface_impl::InterfaceImpl; | ||
#[test] | ||
fn test_hash_sha256() { | ||
let interface = InterfaceImpl::new_default( | ||
Address::from_str("AU12cMW9zRKFDS43Z2W88VCmdQFxmHjAo54XvuVV34UzJeXRLXW9M").unwrap(), | ||
None, | ||
); | ||
let actual_hash = interface.hash_sha256(b"something").unwrap(); | ||
let expected_hash = | ||
&hex!("3fc9b689459d738f8c88a3a48aa9e33542016b7a4052e001aaa536fca74813cb")[..]; | ||
assert_eq!(actual_hash, expected_hash); | ||
} | ||
use crate::interface_impl::InterfaceImpl; | ||
#[test] | ||
fn test_hash_sha256() { | ||
let interface = InterfaceImpl::new_default( | ||
Address::from_str("AU12cMW9zRKFDS43Z2W88VCmdQFxmHjAo54XvuVV34UzJeXRLXW9M").unwrap(), | ||
None, | ||
); | ||
let actual_hash = interface.hash_sha256(b"something").unwrap(); | ||
let expected_hash = | ||
&hex!("3fc9b689459d738f8c88a3a48aa9e33542016b7a4052e001aaa536fca74813cb")[..]; | ||
assert_eq!(actual_hash, expected_hash); | ||
} |
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,26 +1,12 @@ | ||
// Copyright (c) 2022 MASSA LABS <[email protected]> | ||
|
||
#[cfg(any( | ||
test, | ||
feature = "gas_calibration", | ||
feature = "benchmarking", | ||
feature = "test-exports", | ||
test | ||
))] | ||
mod mock; | ||
|
||
#[cfg(all(not(feature = "gas_calibration"), not(feature = "benchmarking")))] | ||
#[cfg(test)] | ||
mod scenarios_mandatories; | ||
|
||
#[cfg(all(not(feature = "gas_calibration"), not(feature = "benchmarking")))] | ||
#[cfg(test)] | ||
mod universe; | ||
|
||
#[cfg(test)] | ||
mod tests_active_history; | ||
|
||
mod interface; | ||
|
||
#[cfg(any( | ||
feature = "gas_calibration", | ||
feature = "benchmarking", | ||
feature = "test-exports", | ||
test | ||
))] | ||
pub use mock::get_sample_state; |
Oops, something went wrong.