Skip to content

Commit

Permalink
add path
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg committed Dec 9, 2024
1 parent a9189f1 commit 19d9b50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion contrib-contracts/src/merkle_distributor_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn test_merkle_distributor() -> Result<()> {
let mut source_files: Vec<String> = starcoin_move_stdlib::MOVE_STDLIB_SOURCE_FILES.clone();
let starcoin_stdlib_files: Vec<String> =
starcoin_move_stdlib::STARCOIN_STDLIB_SOURCE_FILES.clone();
source_files.extend(starcoin_stdlib_files);
// source_files.extend(starcoin_stdlib_files);

println!("YSG source_files: {:?}", source_files);

Expand Down
10 changes: 1 addition & 9 deletions vm/framework/move-stdlib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@ use starcoin_logger::prelude::*;
pub const MOVE_STDLIB_SOURCES_DIR: Dir = include_dir!("sources");

pub static MOVE_STDLIB_SOURCE_FILES: Lazy<Vec<String>> = Lazy::new(|| {
let tempdir = tempfile::tempdir().expect("local dir should be created");
let sources_dir = tempdir.path().join("move-stdlib").join("sources");
std::fs::create_dir_all(sources_dir.as_path()).expect("create dir should success");

MOVE_STDLIB_SOURCES_DIR
.extract(sources_dir.as_path())
.expect("extract should success");
info!("restore move-stdlib sources in: {:?}", sources_dir);
let files: Vec<String> = MOVE_STDLIB_SOURCES_DIR
.files()
.iter()
.filter_map(|file| {
let ext = file.path().extension();
if let Some(ext) = ext {
if ext == "move" {
Some(sources_dir.join(file.path()).display().to_string())
Some(MOVE_STDLIB_SOURCES_DIR.join(file.path()).display().to_string())
} else {
None
}
Expand Down

0 comments on commit 19d9b50

Please sign in to comment.