mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57:58 +00:00
Remove tx factory (#5890)
* Remove tx factory files. * Remove unused imports. * Revert cargo lock.
This commit is contained in:
@@ -14,12 +14,10 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{chain_spec, factory_impl::FactoryState, service, Cli, FactoryCmd, Subcommand};
|
||||
use crate::{chain_spec, service, Cli, Subcommand};
|
||||
use node_executor::Executor;
|
||||
use node_runtime::{Block, RuntimeApi};
|
||||
use node_transaction_factory::RuntimeAdapter;
|
||||
use sc_cli::{CliConfiguration, ImportParams, Result, SharedParams, SubstrateCli};
|
||||
use sc_service::Configuration;
|
||||
use sc_cli::{Result, SubstrateCli};
|
||||
|
||||
impl SubstrateCli for Cli {
|
||||
fn impl_name() -> &'static str {
|
||||
@@ -94,11 +92,6 @@ pub fn run() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Some(Subcommand::Factory(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
|
||||
runner.sync_run(|config| cmd.run(config))
|
||||
}
|
||||
Some(Subcommand::Base(subcommand)) => {
|
||||
let runner = cli.create_runner(subcommand)?;
|
||||
|
||||
@@ -106,44 +99,3 @@ pub fn run() -> Result<()> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl CliConfiguration for FactoryCmd {
|
||||
fn shared_params(&self) -> &SharedParams {
|
||||
&self.shared_params
|
||||
}
|
||||
|
||||
fn import_params(&self) -> Option<&ImportParams> {
|
||||
Some(&self.import_params)
|
||||
}
|
||||
}
|
||||
|
||||
impl FactoryCmd {
|
||||
fn run(&self, config: Configuration) -> Result<()> {
|
||||
match config.chain_spec.id() {
|
||||
"dev" | "local" => {}
|
||||
_ => return Err("Factory is only supported for development and local testnet.".into()),
|
||||
}
|
||||
|
||||
// Setup tracing.
|
||||
if let Some(tracing_targets) = self.import_params.tracing_targets.as_ref() {
|
||||
let subscriber = sc_tracing::ProfilingSubscriber::new(
|
||||
self.import_params.tracing_receiver.into(),
|
||||
tracing_targets,
|
||||
);
|
||||
if let Err(e) = tracing::subscriber::set_global_default(subscriber) {
|
||||
return Err(format!("Unable to set global default subscriber {}", e).into());
|
||||
}
|
||||
}
|
||||
|
||||
let factory_state = FactoryState::new(self.blocks, self.transactions);
|
||||
|
||||
let service_builder = new_full_start!(config).0;
|
||||
node_transaction_factory::factory(
|
||||
factory_state,
|
||||
service_builder.client(),
|
||||
service_builder
|
||||
.select_chain()
|
||||
.expect("The select_chain is always initialized by new_full_start!; qed"),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user