diff --git a/script/src/verify.rs b/script/src/verify.rs index 3f4ebc81a8..0ff5aca316 100644 --- a/script/src/verify.rs +++ b/script/src/verify.rs @@ -336,8 +336,6 @@ impl { data_loader: DL, - debug_printer: DebugPrinter, - rtx: Arc, binaries_by_data_hash: HashMap, @@ -464,7 +462,6 @@ impl(&mut self, func: F) { - self.debug_printer = Arc::new(func); + self.generator.debug_printer = Arc::new(func); } #[cfg(test)] diff --git a/spec/src/consensus.rs b/spec/src/consensus.rs index a7d053610c..800225209c 100644 --- a/spec/src/consensus.rs +++ b/spec/src/consensus.rs @@ -797,9 +797,18 @@ impl Consensus { epoch_duration_in_milliseconds, } => { if self.permanent_difficulty() { + let primary_epoch_reward = + self.primary_epoch_reward_of_next_epoch(&epoch).as_u64(); + let block_reward = + Capacity::shannons(primary_epoch_reward / epoch.length()); + let remainder_reward = + Capacity::shannons(primary_epoch_reward % epoch.length()); + let dummy_epoch_ext = epoch .clone() .into_builder() + .base_block_reward(block_reward) + .remainder_reward(remainder_reward) .number(epoch.number() + 1) .last_block_hash_in_previous_epoch(header.hash()) .start_number(header.number() + 1) diff --git a/util/app-config/src/cli.rs b/util/app-config/src/cli.rs index a63a974b86..522d3faee8 100644 --- a/util/app-config/src/cli.rs +++ b/util/app-config/src/cli.rs @@ -1,6 +1,6 @@ //! CKB command line arguments parser. use ckb_build_info::Version; -use ckb_resource::{DEFAULT_P2P_PORT, DEFAULT_RPC_PORT, DEFAULT_SPEC}; +use ckb_resource::{AVAILABLE_SPECS, DEFAULT_P2P_PORT, DEFAULT_RPC_PORT, DEFAULT_SPEC}; use clap::{Arg, ArgGroup, ArgMatches, Command}; /// binary file name(ckb) @@ -414,6 +414,12 @@ fn init() -> Command { Arg::new(ARG_CHAIN) .short('c') .long(ARG_CHAIN) + .value_parser( + AVAILABLE_SPECS + .iter() + .map(|v| v.to_string()) + .collect::>(), + ) .default_value(DEFAULT_SPEC) .help("Initializes CKB directory for "), )