Skip to content

Commit

Permalink
NODE-84, chore: bifrost-frontier/pull/12 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
alstjd0921 authored Jan 18, 2024
1 parent 246a981 commit 07b5283
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 59 deletions.
80 changes: 44 additions & 36 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions node/common/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ pub struct GrandpaDeps<B> {

/// Full client dependencies.
pub struct FullDevDeps<C, P, BE, SC, A: ChainApi, CIDP> {
/// Client version.
pub client_version: String,
/// The client instance to use.
pub client: Arc<C>,
/// Transaction pool instance.
Expand Down Expand Up @@ -136,6 +138,8 @@ pub struct FullDevDeps<C, P, BE, SC, A: ChainApi, CIDP> {

/// Mainnet/Testnet client dependencies.
pub struct FullDeps<C, P, BE, SC, A: ChainApi, CIDP> {
/// Client version.
pub client_version: String,
/// The client instance to use.
pub client: Arc<C>,
/// Transaction pool instance.
Expand Down
2 changes: 1 addition & 1 deletion node/core/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl SubstrateCli for Cli {
}

fn support_url() -> String {
"support.anonymous.an".into()
env!("CARGO_PKG_HOMEPAGE").into()
}

fn copyright_start_year() -> i32 {
Expand Down
3 changes: 2 additions & 1 deletion node/dev/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ where

let mut io = RpcModule::new(());
let FullDevDeps {
client_version,
client,
pool,
select_chain: _,
Expand Down Expand Up @@ -169,7 +170,7 @@ where
)
.ok();

io.merge(Web3::new(Arc::clone(&client)).into_rpc()).ok();
io.merge(Web3::new(&client_version).into_rpc()).ok();

if ethapi_cmd.contains(&EthApiCmd::Txpool) {
io.merge(TxPool::new(Arc::clone(&client), graph.clone()).into_rpc()).ok();
Expand Down
2 changes: 2 additions & 0 deletions node/dev/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ pub fn build_rpc_extensions_builder(
Some(shared_authority_set.clone()),
);

let client_version = config.impl_version.clone();
let client = builder.client.clone();
let pool = builder.transaction_pool.clone();
let network = builder.network.clone();
Expand Down Expand Up @@ -774,6 +775,7 @@ pub fn build_rpc_extensions_builder(

let rpc_extensions_builder = move |deny_unsafe, subscription_executor| {
let deps = FullDevDeps {
client_version: client_version.clone(),
client: client.clone(),
pool: pool.clone(),
graph: pool.pool().clone(),
Expand Down
3 changes: 2 additions & 1 deletion node/mainnet/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ where

let mut io = RpcModule::new(());
let FullDeps {
client_version,
client,
pool,
select_chain: _,
Expand Down Expand Up @@ -167,7 +168,7 @@ where
)
.ok();

io.merge(Web3::new(Arc::clone(&client)).into_rpc()).ok();
io.merge(Web3::new(&client_version).into_rpc()).ok();

if ethapi_cmd.contains(&EthApiCmd::Txpool) {
io.merge(TxPool::new(Arc::clone(&client), graph.clone()).into_rpc()).ok();
Expand Down
2 changes: 2 additions & 0 deletions node/mainnet/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ pub fn build_rpc_extensions_builder(
Some(shared_authority_set.clone()),
);

let client_version = config.impl_version.clone();
let client = builder.client.clone();
let pool = builder.transaction_pool.clone();
let network = builder.network.clone();
Expand Down Expand Up @@ -571,6 +572,7 @@ pub fn build_rpc_extensions_builder(

let rpc_extensions_builder = move |deny_unsafe, subscription_executor| {
let deps = FullDeps {
client_version: client_version.clone(),
client: client.clone(),
pool: pool.clone(),
graph: pool.pool().clone(),
Expand Down
3 changes: 2 additions & 1 deletion node/testnet/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ where

let mut io = RpcModule::new(());
let FullDeps {
client_version,
client,
pool,
select_chain: _,
Expand Down Expand Up @@ -154,7 +155,7 @@ where
)
.ok();

io.merge(Web3::new(Arc::clone(&client)).into_rpc()).ok();
io.merge(Web3::new(&client_version).into_rpc()).ok();

io.merge(
EthPubSub::new(
Expand Down
2 changes: 2 additions & 0 deletions node/testnet/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ pub fn build_rpc_extensions_builder(
Some(shared_authority_set.clone()),
);

let client_version = config.impl_version.clone();
let client = builder.client.clone();
let pool = builder.transaction_pool.clone();
let network = builder.network.clone();
Expand Down Expand Up @@ -571,6 +572,7 @@ pub fn build_rpc_extensions_builder(

let rpc_extensions_builder = move |deny_unsafe, subscription_executor| {
let deps = FullDeps {
client_version: client_version.clone(),
client: client.clone(),
pool: pool.clone(),
graph: pool.pool().clone(),
Expand Down
38 changes: 19 additions & 19 deletions tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 07b5283

Please sign in to comment.