Skip to content

Commit

Permalink
Fixes wrong runtime with native flags (#3041)
Browse files Browse the repository at this point in the history
  • Loading branch information
crystalin authored Nov 11, 2024
1 parent c155768 commit 76e746f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
16 changes: 12 additions & 4 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::BenchmarkCmd;
use log::{info, warn};
use moonbeam_cli_opt::EthApi;
use moonbeam_service::{
chain_spec, frontier_database_dir, moonbase_runtime, moonbeam_runtime, moonriver_runtime,
HostFunctions, IdentifyVariant,
};

#[cfg(feature = "moonbase-native")]
use moonbeam_service::moonbase_runtime;
#[cfg(feature = "moonbeam-native")]
use moonbeam_service::moonbeam_runtime;
#[cfg(feature = "moonriver-native")]
use moonbeam_service::moonriver_runtime;

use moonbeam_service::{chain_spec, frontier_database_dir, HostFunctions, IdentifyVariant};
use parity_scale_codec::Encode;
#[cfg(feature = "westend-native")]
use polkadot_service::WestendChainSpec;
Expand Down Expand Up @@ -507,11 +512,14 @@ pub fn run() -> Result<()> {
_ => panic!("invalid chain spec"),
}
} else if cfg!(feature = "moonbase-runtime-benchmarks") {
#[cfg(feature = "moonbase-native")]
return runner.sync_run(|config| {
cmd.run_with_spec::<HashingFor<moonbeam_service::moonbase_runtime::Block>, HostFunctions>(
Some(config.chain_spec),
)
});
#[cfg(not(feature = "moonbase-native"))]
panic!("Benchmarking wasn't enabled when building the node.");
} else {
Err("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`."
Expand Down
5 changes: 2 additions & 3 deletions node/service/src/chain_spec/moonbeam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ use crate::chain_spec::{derive_bip44_pairs_from_mnemonic, get_account_id_from_pa
use crate::chain_spec::{generate_accounts, get_from_seed, Extensions};
use cumulus_primitives_core::ParaId;
use hex_literal::hex;
use moonbase_runtime::EligibilityValue;
use moonbeam_runtime::{
currency::GLMR, currency::SUPPLY_FACTOR, AccountId, AuthorFilterConfig, AuthorMappingConfig,
Balance, BalancesConfig, CrowdloanRewardsConfig, EVMConfig, EthereumChainIdConfig,
EthereumConfig, GenesisAccount, InflationInfo, MaintenanceModeConfig,
Balance, BalancesConfig, CrowdloanRewardsConfig, EVMConfig, EligibilityValue,
EthereumChainIdConfig, EthereumConfig, GenesisAccount, InflationInfo, MaintenanceModeConfig,
OpenTechCommitteeCollectiveConfig, ParachainInfoConfig, ParachainStakingConfig,
PolkadotXcmConfig, Precompiles, Range, RuntimeGenesisConfig, TransactionPaymentConfig,
TreasuryCouncilCollectiveConfig, HOURS, WASM_BINARY,
Expand Down
10 changes: 5 additions & 5 deletions node/service/src/chain_spec/moonriver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ use crate::chain_spec::{derive_bip44_pairs_from_mnemonic, get_account_id_from_pa
use crate::chain_spec::{generate_accounts, get_from_seed, Extensions};
use cumulus_primitives_core::ParaId;
use hex_literal::hex;
use moonbase_runtime::EligibilityValue;
use moonriver_runtime::{
currency::MOVR, AccountId, AuthorFilterConfig, AuthorMappingConfig, Balance, BalancesConfig,
CrowdloanRewardsConfig, EVMConfig, EthereumChainIdConfig, EthereumConfig, GenesisAccount,
InflationInfo, MaintenanceModeConfig, OpenTechCommitteeCollectiveConfig, ParachainInfoConfig,
ParachainStakingConfig, PolkadotXcmConfig, Precompiles, Range, RuntimeGenesisConfig,
TransactionPaymentConfig, TreasuryCouncilCollectiveConfig, HOURS, WASM_BINARY,
CrowdloanRewardsConfig, EVMConfig, EligibilityValue, EthereumChainIdConfig, EthereumConfig,
GenesisAccount, InflationInfo, MaintenanceModeConfig, OpenTechCommitteeCollectiveConfig,
ParachainInfoConfig, ParachainStakingConfig, PolkadotXcmConfig, Precompiles, Range,
RuntimeGenesisConfig, TransactionPaymentConfig, TreasuryCouncilCollectiveConfig, HOURS,
WASM_BINARY,
};
use nimbus_primitives::NimbusId;
use pallet_transaction_payment::Multiplier;
Expand Down
1 change: 1 addition & 0 deletions runtime/moonbeam/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ use moonbeam_runtime_common::{
timestamp::{ConsensusHookWrapperForRelayTimestamp, RelayTimestamp},
weights as moonbeam_weights,
};
pub use pallet_author_slot_filter::EligibilityValue;
use pallet_ethereum::Call::transact;
use pallet_ethereum::{PostLogContent, Transaction as EthereumTransaction};
use pallet_evm::{
Expand Down
1 change: 1 addition & 0 deletions runtime/moonriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ use moonbeam_runtime_common::{
timestamp::{ConsensusHookWrapperForRelayTimestamp, RelayTimestamp},
weights as moonriver_weights,
};
pub use pallet_author_slot_filter::EligibilityValue;
use pallet_ethereum::Call::transact;
use pallet_ethereum::{PostLogContent, Transaction as EthereumTransaction};
use pallet_evm::{
Expand Down

0 comments on commit 76e746f

Please sign in to comment.