Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix precompiled lib #4342

Merged
merged 6 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/starcoin/src/state/get_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use starcoin_vm_types::language_storage::{ModuleId, StructTag};
#[clap(name = "get")]
pub enum GetOpt {
Code {
#[clap(help = "module id like: 0x1::Account")]
#[clap(help = "module id like: 0x1::account")]
module_id: StrView<ModuleId>,
#[clap(long, short = 'n')]
/// Get state at a special block height.
Expand All @@ -30,7 +30,7 @@ pub enum GetOpt {
Resource {
#[clap(help = "account address")]
address: AccountAddress,
#[clap(help = "resource struct tag,", default_value = "0x1::Account::Account")]
#[clap(help = "resource struct tag,", default_value = "0x1::account::Account")]
resource_type: StrView<StructTag>,
#[clap(long, short = 'n')]
/// Get state at a special block height.
Expand Down
11 changes: 7 additions & 4 deletions vm/compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ pub mod shared {

pub fn starcoin_framework_named_addresses() -> BTreeMap<String, NumericalAddress> {
let mapping = [
("VMReserved", "0x0"),
("Genesis", "0x1"),
("StarcoinFramework", "0x1"),
("StarcoinAssociation", "0xA550C18"),
("vm", "0x0"),
("vm_reserved", "0x0"),
("std", "0x1"),
("starcoin_std", "0x1"),
("starcoin_framework", "0x1"),
("starcoin_fungible_asset", "0x1"),
("starcoin_token", "0x1"),
("starcoin_token_objects", "0x1"),
("core_resources", "0xA550C18"),
];
mapping
.iter()
Expand Down
2 changes: 2 additions & 0 deletions vm/starcoin-transactional-test-harness/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ starcoin-framework = { workspace = true }
stdlib = { workspace = true }
starcoin-dag = { workspace = true }
bytes = { workspace = true }
starcoin-framework = { workspace = true }
starcoin-cached-packages = { workspace = true }

[dev-dependencies]
datatest-stable = { workspace = true }
Expand Down
10 changes: 6 additions & 4 deletions vm/starcoin-transactional-test-harness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ use std::io::{Read, Write};
use std::path::PathBuf;
use std::sync::Mutex;
use std::{collections::BTreeMap, convert::TryInto, path::Path, str::FromStr};
use stdlib::{starcoin_framework_named_addresses, stdlib_files};
use stdlib::starcoin_framework_named_addresses;
use tempfile::{NamedTempFile, TempDir};

pub mod context;
Expand Down Expand Up @@ -1506,7 +1506,9 @@ pub fn print_help(task_name: Option<String>) -> Result<()> {
//TODO(simon): construct PackagePaths properly
pub static G_PRECOMPILED_STARCOIN_FRAMEWORK: Lazy<(FullyCompiledProgram, Vec<PackagePaths>)> =
Lazy::new(|| {
let sources = stdlib_files();
let sources = starcoin_cached_packages::head_release_bundle()
.files()
.unwrap();
let package_paths = vec![PackagePaths {
name: None,
paths: sources,
Expand All @@ -1515,8 +1517,8 @@ pub static G_PRECOMPILED_STARCOIN_FRAMEWORK: Lazy<(FullyCompiledProgram, Vec<Pac
let program_res = construct_pre_compiled_lib(
package_paths,
None,
move_compiler::Flags::empty(),
&BTreeSet::new(),
move_compiler::Flags::empty().set_sources_shadow_deps(false),
starcoin_framework::extended_checks::get_all_attribute_names(),
)
.unwrap();
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

//# call-api chain.get_block_by_number [1]

//# call-api state.get_with_proof_by_root_raw ["0x1/1/0x1::Account::Account","{{$.call-api[0].header.state_root}}"]
//# call-api state.get_with_proof_by_root_raw ["0x1/1/0x1::account::Account","{{$.call-api[0].header.state_root}}"]

//# run --signers creator --args {{$.call-api[0].header.number}}u64 --args "{{$.call-api[0].header.block_hash}}" --args "{{$.call-api[1]}}"
script{
Expand Down
Loading