Skip to content

Commit

Permalink
Improve fc-rpc (#593)
Browse files Browse the repository at this point in the history
* Split net api and web3 api into their own modules

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* some nits

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* remove some useless trait bound

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
  • Loading branch information
koushiro authored Mar 3, 2022
1 parent 37a1dc0 commit d42806d
Show file tree
Hide file tree
Showing 11 changed files with 275 additions and 269 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions client/rpc-core/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use crate::types::{
BlockNumber, Bytes, CallRequest, FeeHistory, Filter, FilterChanges, Index, Log, Receipt,
RichBlock, SyncStatus, Transaction, TransactionRequest, Work,
};

pub use rpc_impl_EthApi::gen_server::EthApi as EthApiServer;
pub use rpc_impl_EthFilterApi::gen_server::EthFilterApi as EthFilterApiServer;

Expand Down
10 changes: 6 additions & 4 deletions client/rpc-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ mod eth_pubsub;
mod net;
mod web3;

pub use eth::{EthApi, EthApiServer, EthFilterApi, EthFilterApiServer};
pub use eth_pubsub::{EthPubSubApi, EthPubSubApiServer};
pub use net::{NetApi, NetApiServer};
pub use web3::{Web3Api, Web3ApiServer};
pub use self::{
eth::{EthApi, EthApiServer, EthFilterApi, EthFilterApiServer},
eth_pubsub::{EthPubSubApi, EthPubSubApiServer},
net::{NetApi, NetApiServer},
web3::{Web3Api, Web3ApiServer},
};
4 changes: 3 additions & 1 deletion client/rpc-core/src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! Net rpc interface.
use crate::types::PeerCount;

use jsonrpc_core::Result;
use jsonrpc_derive::rpc;

use crate::types::PeerCount;

pub use rpc_impl_NetApi::gen_server::NetApi as NetApiServer;

/// Net rpc interface.
Expand Down
1 change: 1 addition & 0 deletions client/rpc-core/src/web3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! Web3 rpc interface.

use ethereum_types::H256;
use jsonrpc_core::Result;
use jsonrpc_derive::rpc;
Expand Down
24 changes: 12 additions & 12 deletions client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ jsonrpc-core-client = "18.0"
jsonrpc-pubsub = "18.0"
rand = "0.8"
rlp = "0.5"
sha3 = "0.10"
tokio = { version = "1.14", features = [ "sync" ] }

codec = { package = "parity-scale-codec", version = "2.0.0" }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-storage = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-storage = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }

fp-rpc = { version = "3.0.0-dev", path = "../../primitives/rpc" }
fp-storage = { version = "2.0.0-dev", path = "../../primitives/storage" }
Expand Down
Loading

0 comments on commit d42806d

Please sign in to comment.