Skip to content

Commit

Permalink
fix: include contracts in rpc calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrizsabin committed Jan 2, 2023
1 parent 8f5cefd commit 6dadc48
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 4 additions & 0 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ use sp_runtime::traits::BlakeTwo256;
use std::collections::BTreeMap;
use std::sync::Arc;
use substrate_frame_rpc_system::{System, SystemApiServer};
use pallet_contracts_rpc::{Contracts};
use pallet_contracts_rpc::ContractsApiServer;

use crate::primitives::*;

Expand Down Expand Up @@ -134,6 +136,7 @@ where
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
+ fp_rpc::ConvertTransactionRuntimeApi<Block>
+ fp_rpc::EthereumRuntimeRPCApi<Block>
+ pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber, Hash>
+ BlockBuilder<Block>,
P: TransactionPool<Block = Block> + Sync + Send + 'static,
BE: Backend<Block> + 'static,
Expand All @@ -159,6 +162,7 @@ where

io.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
io.merge(TransactionPayment::new(client.clone()).into_rpc())?;
io.merge(Contracts::new(client.clone()).into_rpc())?;

io.merge(
Eth::new(
Expand Down
1 change: 1 addition & 0 deletions node/src/service/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ where
+ sp_block_builder::BlockBuilder<Block>
+ substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
+ pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber, Hash>
+ fp_rpc::EthereumRuntimeRPCApi<Block>
+ fp_rpc::ConvertTransactionRuntimeApi<Block>
+ cumulus_primitives_core::CollectCollationInfo<Block>,
Expand Down
6 changes: 0 additions & 6 deletions node/src/service/solo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,6 @@ pub fn start_frost_node(config: Configuration) -> Result<TaskManager, ServiceErr
let mut io = crate::rpc::create_full(deps, subscription)
.map_err::<ServiceError, _>(Into::into)?;

// Local node support WASM contracts
io.merge(pallet_contracts_rpc::Contracts::new(Arc::clone(&client)).into_rpc())
.map_err(|_| {
ServiceError::Other("Failed to register pallet-contracts RPC methods.".into())
})?;

Ok(io)
})
};
Expand Down

0 comments on commit 6dadc48

Please sign in to comment.