mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-24 15:57:58 +00:00
Make signing fallable and asynchronous (#119)
* Make signing fallable and asynchronous This is needed for hardware wallets, which require human confirmation to sign transactions. Blocking on a human to sign transactions is not a good idea, and the signing might fail for many reasons (device unplugged, authorization not granted, etc). * Reformat * Refactor as suggested by Andrew Jones (@ascjones). * Use future::ok Co-authored-by: Andrew Jones <ascjones@gmail.com>
This commit is contained in:
@@ -82,6 +82,7 @@ pub fn call(s: Structure) -> TokenStream {
|
||||
T: #module + #subxt::system::System + Send + Sync + 'static,
|
||||
S: #codec::Encode + Send + Sync + 'static,
|
||||
E: #subxt::SignedExtra<T> + #subxt::sp_runtime::traits::SignedExtension + Send + Sync + 'static,
|
||||
<<E as #subxt::SignedExtra<T>>::Extra as #subxt::sp_runtime::traits::SignedExtension>::AdditionalSigned: Send + Sync,
|
||||
{
|
||||
fn #call<'a>(
|
||||
&'a self,
|
||||
@@ -154,6 +155,7 @@ mod tests {
|
||||
T: Balances + substrate_subxt::system::System + Send + Sync + 'static,
|
||||
S: codec::Encode + Send + Sync + 'static,
|
||||
E: substrate_subxt::SignedExtra<T> + substrate_subxt::sp_runtime::traits::SignedExtension + Send + Sync + 'static,
|
||||
<<E as substrate_subxt::SignedExtra<T>>::Extra as substrate_subxt::sp_runtime::traits::SignedExtension>::AdditionalSigned: Send + Sync,
|
||||
{
|
||||
fn transfer<'a>(
|
||||
&'a self,
|
||||
|
||||
Reference in New Issue
Block a user