mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Integrate ink!
This commit is contained in:
@@ -39,6 +39,7 @@ sp-blockchain = { git = "https://github.com/serai-dex/substrate" }
|
||||
sp-block-builder = { git = "https://github.com/serai-dex/substrate" }
|
||||
substrate-frame-rpc-system = { git = "https://github.com/serai-dex/substrate" }
|
||||
pallet-transaction-payment-rpc = { git = "https://github.com/serai-dex/substrate" }
|
||||
pallet-contracts-rpc = { git = "https://github.com/serai-dex/substrate", package = "pallet-contracts-rpc" }
|
||||
|
||||
# These dependencies are used for runtime benchmarking
|
||||
frame-benchmarking = { git = "https://github.com/serai-dex/substrate" }
|
||||
|
||||
@@ -9,7 +9,7 @@ use sp_api::ProvideRuntimeApi;
|
||||
|
||||
pub use sc_rpc_api::DenyUnsafe;
|
||||
|
||||
use serai_runtime::{opaque::Block, AccountId, Balance, Index};
|
||||
use serai_runtime::{BlockNumber, Hash, opaque::Block, AccountId, Balance, Index};
|
||||
|
||||
pub struct FullDeps<C, P> {
|
||||
pub client: Arc<C>,
|
||||
@@ -29,18 +29,21 @@ pub fn create_full<
|
||||
deps: FullDeps<C, P>,
|
||||
) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
|
||||
where
|
||||
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
|
||||
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
|
||||
+ BlockBuilder<Block>,
|
||||
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index> +
|
||||
pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance> +
|
||||
pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber, Hash> +
|
||||
BlockBuilder<Block>,
|
||||
{
|
||||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
use substrate_frame_rpc_system::{System, SystemApiServer};
|
||||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
use pallet_contracts_rpc::{Contracts, ContractsApiServer};
|
||||
|
||||
let mut module = RpcModule::new(());
|
||||
let FullDeps { client, pool, deny_unsafe } = deps;
|
||||
|
||||
module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
|
||||
module.merge(TransactionPayment::new(client).into_rpc())?;
|
||||
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
|
||||
module.merge(Contracts::new(client).into_rpc())?;
|
||||
|
||||
Ok(module)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user