feat: Mortal extrinsic construction

This commit is contained in:
emostov
2020-12-13 20:13:16 -08:00
parent 80aff7eb6e
commit c9059d1a32
8 changed files with 112 additions and 14 deletions
+6 -2
View File
@@ -64,6 +64,7 @@ pub fn call(s: Structure) -> TokenStream {
fn #call<'a>(
&'a self,
signer: &'a (dyn #subxt::Signer<T> + Send + Sync),
opts: #subxt::SignedOptions,
#args
) -> core::pin::Pin<Box<dyn core::future::Future<Output = Result<T::Hash, #subxt::Error>> + Send + 'a>>;
@@ -71,6 +72,7 @@ pub fn call(s: Structure) -> TokenStream {
fn #call_and_watch<'a>(
&'a self,
signer: &'a (dyn #subxt::Signer<T> + Send + Sync),
opts: #subxt::SignedOptions,
#args
) -> core::pin::Pin<Box<dyn core::future::Future<Output = Result<#subxt::ExtrinsicSuccess<T>, #subxt::Error>> + Send + 'a>>;
}
@@ -82,19 +84,21 @@ pub fn call(s: Structure) -> TokenStream {
fn #call<'a>(
&'a self,
signer: &'a (dyn #subxt::Signer<T> + Send + Sync),
opts: #subxt::SignedOptions,
#args
) -> core::pin::Pin<Box<dyn core::future::Future<Output = Result<T::Hash, #subxt::Error>> + Send + 'a>> {
let #marker = core::marker::PhantomData::<T>;
Box::pin(self.submit(#build_struct, signer))
Box::pin(self.submit(#build_struct, signer, opts))
}
fn #call_and_watch<'a>(
&'a self,
signer: &'a (dyn #subxt::Signer<T> + Send + Sync),
opts: #subxt::SignedOptions,
#args
) -> core::pin::Pin<Box<dyn core::future::Future<Output = Result<#subxt::ExtrinsicSuccess<T>, #subxt::Error>> + Send + 'a>> {
let #marker = core::marker::PhantomData::<T>;
Box::pin(self.watch(#build_struct, signer))
Box::pin(self.watch(#build_struct, signer, opts))
}
}
}