Skip to content

Commit

Permalink
[move] Enabled debug printing in code published on chain
Browse files Browse the repository at this point in the history
  • Loading branch information
awelc committed Sep 2, 2022
1 parent abca03c commit fb53894
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
12 changes: 1 addition & 11 deletions crates/sui-framework-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,10 @@ use sui_verifier::verifier as sui_bytecode_verifier;
const SUI_PACKAGE_NAME: &str = "Sui";
const MOVE_STDLIB_PACKAGE_NAME: &str = "MoveStdlib";

pub fn move_stdlib_module_denylist() -> Vec<String> {
vec![
#[cfg(not(test))]
"debug".to_string(),
]
}

pub fn build_move_stdlib_modules(lib_dir: &Path) -> SuiResult<Vec<CompiledModule>> {
let build_config = BuildConfig::default();
let pkg = build_move_package_with_deps(lib_dir, build_config)?;
let modules: Vec<CompiledModule> = filter_package_modules(&pkg)?
.into_iter()
.filter(|m| !move_stdlib_module_denylist().contains(&m.self_id().name().to_string()))
.collect();
let modules: Vec<CompiledModule> = filter_package_modules(&pkg)?;
verify_modules(&modules)?;
Ok(modules)
}
Expand Down
5 changes: 1 addition & 4 deletions crates/sui-framework/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ pub mod natives;

pub use sui_framework_build::build_move_stdlib_modules as get_move_stdlib_modules;
pub use sui_framework_build::verify_modules;
use sui_framework_build::{
build_move_package_with_deps, filter_package_modules, move_stdlib_module_denylist,
};
use sui_framework_build::{build_move_package_with_deps, filter_package_modules};
use sui_types::sui_serde::{Base64, Encoding};

// Move unit tests will halt after executing this many steps. This is a protection to avoid divergence
Expand Down Expand Up @@ -193,7 +191,6 @@ fn verify_framework_version(pkg: &CompiledPackage) -> SuiResult<()> {
let dep_stdlib: Vec<&CompiledModule> = dep_stdlib_modules
.iter()
.filter(|m| *m.self_id().address() == MOVE_STDLIB_ADDRESS)
.filter(|m| !move_stdlib_module_denylist().contains(&m.self_id().name().to_string()))
.collect();

let stdlib_modules = Modules::new(get_move_stdlib().iter()).iter_modules_owned();
Expand Down

0 comments on commit fb53894

Please sign in to comment.