Skip to content

Commit

Permalink
[compiler-v2 framework] fixed known_attribute warning in move test (#…
Browse files Browse the repository at this point in the history
…4340)

* [compiler-v2 framework] fixed known_attribute warning in move test context

* [compiler-v2 framework] removed unused code

* [compiler-v2 framework] fixed fmt
  • Loading branch information
welbon authored Dec 12, 2024
1 parent 992727f commit ce02c09
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 51 deletions.
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.

This file was deleted.

This file was deleted.

6 changes: 4 additions & 2 deletions vm/gas-schedule/src/gas_schedule/starcoin_framework.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2.0

use move_core_types::gas_algebra::InternalGasPerArg;

use starcoin_gas_algebra::{InternalGas, InternalGasPerAbstractValueUnit, InternalGasPerByte};

use crate::gas_schedule::NativeGasParameters;
use crate::traits::EXECUTION_GAS_MULTIPLIER as MUL;
use crate::ver::gas_feature_versions::*;
use move_core_types::gas_algebra::InternalGasPerArg;
use starcoin_gas_algebra::{InternalGas, InternalGasPerAbstractValueUnit, InternalGasPerByte};

// see starcoin/vm/types/src/on_chain_config/genesis_gas_schedule.rs
// same order as from https://github.com/starcoinorg/starcoin-framework/blob/main/sources/VMConfig.move#native_schedule
Expand Down
2 changes: 2 additions & 0 deletions vm/move-package-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ pub fn run_integration_test(move_arg: Move, cmd: IntegrationTestCommand) -> Resu
// force move to rebuild all packages, so that we can use compile_driver to generate the full compiled program.
let mut build_config = move_arg.build_config;
build_config.force_recompilation = true;
build_config.compiler_config.known_attributes =
starcoin_framework::extended_checks::get_all_attribute_names().clone();
let resolved_graph = build_config
.clone()
.resolution_graph_for_package(&rerooted_path, &mut std::io::stdout())?;
Expand Down
1 change: 1 addition & 0 deletions vm/starcoin-transactional-test-harness/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ starcoin-vm-runtime = { workspace = true }
starcoin-vm-types = { workspace = true }
starcoin-gas-meter = { workspace = true }
starcoin-gas-schedule = { workspace = true }
starcoin-framework = { workspace = true }
stdlib = { workspace = true }
starcoin-dag = { workspace = true }
bytes = { workspace = true }
Expand Down
5 changes: 3 additions & 2 deletions vm/starcoin-transactional-test-harness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use move_binary_format::{file_format::CompiledScript, CompiledModule};
use move_command_line_common::address::ParsedAddress;
use move_command_line_common::files::verify_and_create_named_address_mapping;
use move_compiler::compiled_unit::{AnnotatedCompiledUnit, CompiledUnitEnum};
use move_compiler::shared::known_attributes::KnownAttribute;
use move_compiler::shared::{NumberFormat, NumericalAddress, PackagePaths};
use move_compiler::{construct_pre_compiled_lib, FullyCompiledProgram};
use move_core_types::language_storage::StructTag;
Expand Down Expand Up @@ -38,6 +37,7 @@ use starcoin_config::{genesis_key_pair, BuiltinNetworkID};
use starcoin_crypto::hash::PlainCryptoHash;
use starcoin_crypto::HashValue;
use starcoin_dev::playground::call_contract;
use starcoin_framework::extended_checks;
use starcoin_gas_meter::StarcoinGasParameters;
use starcoin_gas_schedule::FromOnChainGasSchedule;
use starcoin_rpc_api::types::{
Expand Down Expand Up @@ -1072,7 +1072,8 @@ impl<'a> MoveTestAdapter<'a> for StarcoinTestAdapter<'a> {
}

fn known_attributes(&self) -> &BTreeSet<String> {
KnownAttribute::get_all_attribute_names()
// KnownAttribute::get_all_attribute_names()
extended_checks::get_all_attribute_names()
}

fn init(
Expand Down

0 comments on commit ce02c09

Please sign in to comment.