1515
1616// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
1717
18+ use relay_substrate_client:: { AccountKeyPairOf , ChainWithTransactions } ;
1819use structopt:: StructOpt ;
1920use strum:: { EnumString , EnumVariantNames } ;
2021
@@ -134,16 +135,16 @@ pub trait TransactionParamsProvider {
134135 /// Returns `true` if transaction parameters are defined by this provider.
135136 fn is_defined ( & self ) -> bool ;
136137 /// Returns transaction parameters.
137- fn transaction_params < Chain : CliChain > (
138+ fn transaction_params < Chain : ChainWithTransactions > (
138139 & self ,
139- ) -> anyhow:: Result < TransactionParams < Chain :: KeyPair > > ;
140+ ) -> anyhow:: Result < TransactionParams < AccountKeyPairOf < Chain > > > ;
140141
141142 /// Returns transaction parameters, defined by `self` provider or, if they're not defined,
142143 /// defined by `other` provider.
143- fn transaction_params_or < Chain : CliChain , T : TransactionParamsProvider > (
144+ fn transaction_params_or < Chain : ChainWithTransactions , T : TransactionParamsProvider > (
144145 & self ,
145146 other : & T ,
146- ) -> anyhow:: Result < TransactionParams < Chain :: KeyPair > > {
147+ ) -> anyhow:: Result < TransactionParams < AccountKeyPairOf < Chain > > > {
147148 if self . is_defined ( ) {
148149 self . transaction_params :: < Chain > ( )
149150 } else {
@@ -201,7 +202,7 @@ macro_rules! declare_chain_signing_params_cli_schema {
201202
202203 /// Parse signing params into chain-specific KeyPair.
203204 #[ allow( dead_code) ]
204- pub fn to_keypair<Chain : CliChain >( & self ) -> anyhow:: Result <Chain :: KeyPair > {
205+ pub fn to_keypair<Chain : ChainWithTransactions >( & self ) -> anyhow:: Result <AccountKeyPairOf < Chain > > {
205206 let suri = match ( self . [ <$chain_prefix _signer>] . as_ref( ) , self . [ <$chain_prefix _signer_file>] . as_ref( ) ) {
206207 ( Some ( suri) , _) => suri. to_owned( ) ,
207208 ( None , Some ( suri_file) ) => std:: fs:: read_to_string( suri_file)
@@ -234,7 +235,7 @@ macro_rules! declare_chain_signing_params_cli_schema {
234235
235236 use sp_core:: crypto:: Pair ;
236237
237- Chain :: KeyPair :: from_string(
238+ AccountKeyPairOf :: < Chain > :: from_string(
238239 & suri,
239240 suri_password. as_deref( )
240241 ) . map_err( |e| anyhow:: format_err!( "{:?}" , e) )
@@ -247,7 +248,7 @@ macro_rules! declare_chain_signing_params_cli_schema {
247248 self . [ <$chain_prefix _signer>] . is_some( ) || self . [ <$chain_prefix _signer_file>] . is_some( )
248249 }
249250
250- fn transaction_params<Chain : CliChain >( & self ) -> anyhow:: Result <TransactionParams <Chain :: KeyPair >> {
251+ fn transaction_params<Chain : ChainWithTransactions >( & self ) -> anyhow:: Result <TransactionParams <AccountKeyPairOf < Chain > >> {
251252 Ok ( TransactionParams {
252253 mortality: self . transactions_mortality( ) ?,
253254 signer: self . to_keypair:: <Chain >( ) ?,
0 commit comments