Skip to content

Commit

Permalink
fix api bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tuminfei committed Jan 13, 2021
1 parent fe00349 commit 3ffeee3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
21 changes: 21 additions & 0 deletions 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 node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ frame-benchmarking-cli = { version = "2.0.0" }
uart-runtime = { path = "../runtime" }
pallet-staking-rpc = { path = "../pallets/staking/rpc" }
pallet-contracts = { version = "2.0.0" }
pallet-contracts-rpc = { version = "0.8.0" }

[build-dependencies]
substrate-build-script-utils = { version = "2.0.0" }
Expand Down
6 changes: 5 additions & 1 deletion node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use std::sync::Arc;

use uart_runtime::{opaque::Block, AccountId, Balance, Index};
use uart_runtime::{opaque::Block, AccountId, Balance, Index, BlockNumber};
use sp_api::ProvideRuntimeApi;
use sp_blockchain::{Error as BlockChainError, HeaderMetadata, HeaderBackend};
use sp_block_builder::BlockBuilder;
Expand Down Expand Up @@ -35,12 +35,14 @@ pub fn create_full<C, P>(
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: pallet_staking_rpc::StakingRuntimeApi<Block, AccountId, Balance>,
C::Api: pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber>,
C::Api: BlockBuilder<Block>,
P: TransactionPool + 'static,
{
use substrate_frame_rpc_system::{FullSystem, SystemApi};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
use pallet_staking_rpc::{Staking, StakingApi};
use pallet_contracts_rpc::{Contracts, ContractsApi};

let mut io = jsonrpc_core::IoHandler::default();
let FullDeps {
Expand All @@ -57,6 +59,8 @@ pub fn create_full<C, P>(
TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))
);

io.extend_with(ContractsApi::to_delegate(Contracts::new(client.clone())));

io.extend_with(
StakingApi::to_delegate(Staking::new(client.clone()))
);
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("uart"),
impl_name: create_runtime_str!("uart"),
authoring_version: 1,
spec_version: 20,
spec_version: 21,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down

0 comments on commit 3ffeee3

Please sign in to comment.