Skip to content

Commit

Permalink
Merge pull request #47 from Raj-RR1/logical-changes
Browse files Browse the repository at this point in the history
node related changes
  • Loading branch information
Raj-RR1 authored Aug 16, 2023
2 parents 6193074 + 8f1a745 commit cbe1390
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 22 deletions.
9 changes: 4 additions & 5 deletions node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,17 @@ pub struct Extensions {
pub fork_blocks: sc_client_api::ForkBlocks<Block>,
/// Known bad block hashes.
pub bad_blocks: sc_client_api::BadBlocks<Block>,

/// The light sync state extension used by the sync-state rpc.
pub light_sync_state: sc_sync_state_rpc::LightSyncStateExtension,
}

/// Specialized `ChainSpec`.
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;
/// Flaming Fir testnet generator
pub fn flaming_fir_config() -> Result<ChainSpec, String>{
ChainSpec::from_json_bytes()//pending
}

pub fn flaming_fir_config() -> Result<ChainSpec, String>{
ChainSpec::from_json_bytes()//pending
}
/// Mainnet configuration
pub fn edgeware_mainnet_official() -> ChainSpec {
match ChainSpec::from_json_bytes(&include_bytes!("../res/mainnet.chainspec.raw.json")[..]) {
Expand Down
20 changes: 10 additions & 10 deletions node/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ pub struct Cli {
#[allow(missing_docs)]
#[clap(flatten)]
pub run: RunCmd,


/// Disable automatic hardware benchmarks.
///
Expand All @@ -120,12 +119,13 @@ pub struct Cli {
/// Possible subcommands of the main binary.
#[derive(Debug, clap::Subcommand)]
pub enum Subcommand {

/// The custom inspect subcommmand for decoding blocks and extrinsics.
#[command(
name = "inspect",
about = "Decode given block or extrinsic using current native runtime."
)]
Inspect(node_inspect::cli::InspectCmd),
#[command(
name = "inspect",
about = "Decode given block or extrinsic using current native runtime."
)]
Inspect(node_inspect::cli::InspectCmd),
/// Key management cli utilities
#[clap(subcommand)]
Key(KeySubcommand),
Expand All @@ -135,13 +135,14 @@ pub enum Subcommand {
#[clap(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),


/// Try some command against runtime state.
#[cfg(feature = "try-runtime")]
TryRuntime(try_runtime_cli::TryRuntimeCmd),
TryRuntime(try_runtime_cli::TryRuntimeCmd),

/// Try some command against runtime state. Note: `try-runtime` feature must be enabled.
#[cfg(not(feature = "try-runtime"))]
TryRuntime,
TryRuntime,

/// Verify a signature for a message, provided on STDIN, with a given
/// (public or secret) key.
Expand Down Expand Up @@ -174,7 +175,6 @@ pub enum Subcommand {
/// Revert the chain to a previous state.
Revert(sc_cli::RevertCmd),


/// Db meta columns information.
ChainInfo(sc_cli::ChainInfoCmd),
}
2 changes: 1 addition & 1 deletion node/consensus-transition/manual-seal/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub trait ConsensusDataProvider<B: BlockT>: Send + Sync {
/// Block import transaction type
type Transaction;

/// The proof type.
/// The proof type.
type Proof;

/// Attempt to create a consensus digest.
Expand Down
4 changes: 2 additions & 2 deletions node/consensus-transition/manual-seal/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub enum Error {
SendError(#[from] SendError),
/// Some other error.
#[error("Other error: {0}")]
Other(#[from] Box<dyn std::error::Error + Send + Sync>),
Other(Box<dyn std::error::Error + Send + Sync>),
}

impl From<ImportResult> for Error {
Expand Down Expand Up @@ -120,4 +120,4 @@ impl From<Error> for JsonRpseeError {
fn from(err: Error) -> Self {
CallError::Custom(ErrorObject::owned(err.to_code(), err.to_string(), None::<()>)).into()
}
}
}
8 changes: 5 additions & 3 deletions node/consensus-transition/manual-seal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ pub struct ManualSealParams<B: BlockT, BI, E, C: ProvideRuntimeApi<B>, TP, SC, C

/// Digest provider for inclusion in blocks.
pub consensus_data_provider:
Option<Box<dyn ConsensusDataProvider<B, Proof=P, Transaction = TransactionFor<C, B>>>>,

Option<Box<dyn ConsensusDataProvider<B, Proof = P, Transaction = TransactionFor<C, B>>>>,

/// Something that can create the inherent data providers.
pub create_inherent_data_providers: CIDP,
Expand All @@ -128,9 +129,10 @@ pub struct InstantSealParams<B: BlockT, BI, E, C: ProvideRuntimeApi<B>, TP, SC,

/// Digest provider for inclusion in blocks.
pub consensus_data_provider:
Option<Box<dyn ConsensusDataProvider<B,Proof=P, Transaction = TransactionFor<C, B>>>>,

/// Something that can create the inherent data providers.
Option<Box<dyn ConsensusDataProvider<B, Proof = P, Transaction = TransactionFor<C, B>>>>,

/// Something that can create the inherent data providers.
pub create_inherent_data_providers: CIDP,
}

Expand Down
3 changes: 3 additions & 0 deletions node/consensus-transition/manual-seal/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ use sp_runtime::EncodedJustification;

/// Future's type for jsonrpc
//type FutureResult<T> = jsonrpc_core::BoxFuture<Result<T, Error>>;



/// sender passed to the authorship task to report errors or successes.
pub type Sender<T> = Option<oneshot::Sender<std::result::Result<T, crate::Error>>>;

Expand Down
2 changes: 1 addition & 1 deletion node/consensus-transition/manual-seal/src/seal_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub async fn seal_block<B, BI, SC, C, E, TP, CIDP, P>(
create_inherent_data_providers,
consensus_data_provider: digest_provider,
mut sender,
}: SealBlockParams<'_, B, BI, SC, C, E, TP, CIDP, P>,
}: SealBlockParams<'_, B, BI, SC, C, E, TP, CIDP,P>,
) where
B: BlockT,
BI: BlockImport<B, Error = sp_consensus::Error, Transaction = sp_api::TransactionFor<C, B>>
Expand Down

0 comments on commit cbe1390

Please sign in to comment.