@@ -17,6 +17,8 @@ use automata_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Index};
1717// };
1818// #[cfg(feature = "contextfree")]
1919// use contextfree_runtime::apis::TransferApi as TransferRuntimeApi;
20+ #[ cfg( feature = "contextfree" ) ]
21+ use contextfree_runtime:: apis:: DAOPortalApi as DAOPortalRuntimeApi ;
2022use fc_rpc:: { OverrideHandle , RuntimeApiStorageOverride , SchemaV1Override , StorageOverride } ;
2123use fc_rpc_core:: types:: PendingTransactions ;
2224// #[cfg(feature = "finitestate")]
@@ -53,6 +55,9 @@ use std::sync::Arc;
5355// #[cfg(feature = "automata")]
5456// pub mod transfer;
5557
58+ #[ cfg( feature = "contextfree" ) ]
59+ pub mod daoportal;
60+
5661#[ cfg( feature = "finitestate" ) ]
5762pub mod daoportal;
5863
@@ -168,15 +173,22 @@ where
168173 C :: Api : fp_rpc:: EthereumRuntimeRPCApi < Block > ,
169174 C :: Api : sp_consensus_babe:: BabeApi < Block > ,
170175 C :: Api : BlockBuilder < Block > ,
176+ C :: Api : DAOPortalRuntimeApi < Block > ,
171177 P : TransactionPool < Block = Block > + ' static ,
172178 B : sc_client_api:: Backend < Block > + Send + Sync + ' static ,
173179 B :: State : sc_client_api:: StateBackend < sp_runtime:: traits:: HashFor < Block > > ,
174180 SC : sp_consensus:: SelectChain < Block > + ' static ,
175181{
176- Ok ( create_full_base :: < C , P , BE , B , SC > (
177- deps,
178- subscription_task_executor,
179- ) )
182+ use daoportal:: DAOPortalServer ;
183+
184+ let _client = deps. client . clone ( ) ;
185+ let mut io = create_full_base :: < C , P , BE , B , SC > ( deps, subscription_task_executor) ;
186+
187+ io. extend_with ( DAOPortalServer :: to_delegate ( daoportal:: DAOPortalApi :: new (
188+ _client. clone ( ) ,
189+ ) ) ) ;
190+
191+ Ok ( io)
180192}
181193
182194#[ cfg( feature = "automata" ) ]
0 commit comments