mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 04:28:01 +00:00
Remove poorly panickable unwraps
This commit is contained in:
@@ -80,7 +80,7 @@ where
|
||||
},
|
||||
None => (Era::Immortal, genesis_hash)
|
||||
};
|
||||
let extra: T::Extra = T::Extra::new(spec_version, tx_version, nonce, genesis_hash, era_info);
|
||||
let extra = T::Extra::new(spec_version, tx_version, nonce, genesis_hash, era_info);
|
||||
let payload = SignedPayload::<T>::new(call, extra.extra())?;
|
||||
let signed = signer.sign(payload).await?;
|
||||
Ok(signed)
|
||||
|
||||
+6
-4
@@ -199,7 +199,7 @@ pub struct Client<T: Runtime> {
|
||||
}
|
||||
|
||||
/// Construction options for a signed extrinsic
|
||||
#[derive(Clone)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
pub struct SignedOptions {
|
||||
/// The period, measured in blocks, that transaction will live for, starting from a checkpoint
|
||||
/// block. A good default is 64 (64 * 6secs = 6min 40sec).
|
||||
@@ -473,9 +473,11 @@ impl<T: Runtime> Client<T> {
|
||||
self.account(signer.account_id(), None).await?.nonce
|
||||
};
|
||||
let call = self.encode(call)?;
|
||||
let era_opts = if opts.era_period.is_some() {
|
||||
let era_period = opts.era_period.unwrap();
|
||||
let current_block = self.block(None::<T::Hash>).await?.unwrap().block;
|
||||
let era_opts = if let Some(era_period) = opts.era_period {
|
||||
let current_block = match self.block(None::<T::Hash>).await? {
|
||||
Some(signed_block) => signed_block.block,
|
||||
None => return Err("RPC chain_getBlock returned None when Some(signed_block) was expected".into()),
|
||||
};
|
||||
let current_number = (*current_block.header().number()).saturated_into::<u64>();
|
||||
let current_hash = current_block.hash();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user