forked from Manta-Network/Manta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MantaSBT to Manta Runtime (Manta-Network#1135)
* add manta sbt to manta runtime Signed-off-by: Charles Ferrell <[email protected]> * add rpc call to manta node Signed-off-by: Charles Ferrell <[email protected]> * fix ambiguous name Signed-off-by: Charles Ferrell <[email protected]> --------- Signed-off-by: Charles Ferrell <[email protected]>
- Loading branch information
1 parent
fa10f39
commit 3a7f7b9
Showing
13 changed files
with
319 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright 2020-2023 Manta Network. | ||
// This file is part of Manta. | ||
// | ||
// Manta is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Manta is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Manta. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//! Calamari RPC Extensions | ||
use super::*; | ||
use pallet_manta_sbt::{ | ||
rpc::{SBTPull, SBTPullApiServer}, | ||
runtime::SBTPullLedgerDiffApi, | ||
}; | ||
|
||
/// Instantiate all RPC extensions for calamari. | ||
pub fn create_manta_full<C, P>(deps: FullDeps<C, P>) -> Result<RpcExtension, sc_service::Error> | ||
where | ||
C: ProvideRuntimeApi<Block> | ||
+ HeaderBackend<Block> | ||
+ AuxStore | ||
+ HeaderMetadata<Block, Error = BlockChainError> | ||
+ Send | ||
+ Sync | ||
+ 'static, | ||
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>, | ||
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>, | ||
C::Api: BlockBuilder<Block>, | ||
C::Api: SBTPullLedgerDiffApi<Block>, | ||
P: TransactionPool + Sync + Send + 'static, | ||
{ | ||
use frame_rpc_system::{System, SystemApiServer}; | ||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; | ||
|
||
let mut module = RpcExtension::new(()); | ||
let FullDeps { | ||
client, | ||
pool, | ||
deny_unsafe, | ||
} = deps; | ||
|
||
module | ||
.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc()) | ||
.map_err(|e| sc_service::Error::Other(e.to_string()))?; | ||
module | ||
.merge(TransactionPayment::new(client.clone()).into_rpc()) | ||
.map_err(|e| sc_service::Error::Other(e.to_string()))?; | ||
|
||
let manta_sbt_rpc: jsonrpsee::RpcModule<SBTPull<Block, C>> = SBTPull::new(client).into_rpc(); | ||
module | ||
.merge(manta_sbt_rpc) | ||
.map_err(|e| sc_service::Error::Other(e.to_string()))?; | ||
|
||
Ok(module) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.