feat: extend RethCliExt with payload builder (#4022)

This commit is contained in:
Matthias Seitz
2023-08-04 14:39:07 +02:00
committed by GitHub
parent 3f63a0887a
commit 82a2a6f416
7 changed files with 158 additions and 89 deletions

View File

@ -15,7 +15,8 @@ use clap::Parser;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth::{
cli::{
ext::{RethCliExt, RethRpcConfig, RethRpcServerArgsExt},
config::RethRpcConfig,
ext::{RethCliExt, RethNodeCommandExt},
Cli,
},
network::{NetworkInfo, Peers},
@ -37,7 +38,7 @@ struct MyRethCliExt;
impl RethCliExt for MyRethCliExt {
/// This tells the reth CLI to install the `txpool` rpc namespace via `RethCliTxpoolExt`
type RpcExt = RethCliTxpoolExt;
type Node = RethCliTxpoolExt;
}
/// Our custom cli args extension that adds one flag to reth default CLI.
@ -48,7 +49,7 @@ struct RethCliTxpoolExt {
pub enable_ext: bool,
}
impl RethRpcServerArgsExt for RethCliTxpoolExt {
impl RethNodeCommandExt for RethCliTxpoolExt {
// This is the entrypoint for the CLI to extend the RPC server with custom rpc namespaces.
fn extend_rpc_modules<Conf, Provider, Pool, Network, Tasks, Events>(
&self,