mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-06 15:23:10 +00:00
minor refactor
This commit is contained in:
parent
23afa1e05a
commit
dfab1d6fa8
@ -12,14 +12,13 @@ impl WalletCore {
|
|||||||
to: Address,
|
to: Address,
|
||||||
balance_to_move: u128,
|
balance_to_move: u128,
|
||||||
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
||||||
let from_data = self.storage.user_data.get_private_account(&from).cloned();
|
let Some((from_keys, mut from_acc)) =
|
||||||
let to_data = self.get_account(to).await;
|
self.storage.user_data.get_private_account(&from).cloned()
|
||||||
|
else {
|
||||||
let Some((from_keys, mut from_acc)) = from_data else {
|
|
||||||
return Err(ExecutionFailureKind::KeyNotFoundError);
|
return Err(ExecutionFailureKind::KeyNotFoundError);
|
||||||
};
|
};
|
||||||
|
|
||||||
let Ok(to_acc) = to_data else {
|
let Ok(to_acc) = self.get_account(to).await else {
|
||||||
return Err(ExecutionFailureKind::KeyNotFoundError);
|
return Err(ExecutionFailureKind::KeyNotFoundError);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -12,9 +12,9 @@ impl WalletCore {
|
|||||||
to_ipk: nssa_core::encryption::IncomingViewingPublicKey,
|
to_ipk: nssa_core::encryption::IncomingViewingPublicKey,
|
||||||
balance_to_move: u128,
|
balance_to_move: u128,
|
||||||
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
||||||
let from_data = self.storage.user_data.get_private_account(&from).cloned();
|
let Some((from_keys, mut from_acc)) =
|
||||||
|
self.storage.user_data.get_private_account(&from).cloned()
|
||||||
let Some((from_keys, mut from_acc)) = from_data else {
|
else {
|
||||||
return Err(ExecutionFailureKind::KeyNotFoundError);
|
return Err(ExecutionFailureKind::KeyNotFoundError);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -116,14 +116,14 @@ impl WalletCore {
|
|||||||
to: Address,
|
to: Address,
|
||||||
balance_to_move: u128,
|
balance_to_move: u128,
|
||||||
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
||||||
let from_data = self.storage.user_data.get_private_account(&from).cloned();
|
let Some((from_keys, mut from_acc)) =
|
||||||
let to_data = self.storage.user_data.get_private_account(&to).cloned();
|
self.storage.user_data.get_private_account(&from).cloned()
|
||||||
|
else {
|
||||||
let Some((from_keys, mut from_acc)) = from_data else {
|
|
||||||
return Err(ExecutionFailureKind::KeyNotFoundError);
|
return Err(ExecutionFailureKind::KeyNotFoundError);
|
||||||
};
|
};
|
||||||
|
|
||||||
let Some((to_keys, mut to_acc)) = to_data else {
|
let Some((to_keys, mut to_acc)) = self.storage.user_data.get_private_account(&to).cloned()
|
||||||
|
else {
|
||||||
return Err(ExecutionFailureKind::KeyNotFoundError);
|
return Err(ExecutionFailureKind::KeyNotFoundError);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -11,14 +11,12 @@ impl WalletCore {
|
|||||||
to: Address,
|
to: Address,
|
||||||
balance_to_move: u128,
|
balance_to_move: u128,
|
||||||
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
||||||
let from_data = self.get_account(from).await;
|
let Ok(from_acc) = self.get_account(from).await else {
|
||||||
let to_data = self.storage.user_data.get_private_account(&to).cloned();
|
|
||||||
|
|
||||||
let Ok(from_acc) = from_data else {
|
|
||||||
return Err(ExecutionFailureKind::KeyNotFoundError);
|
return Err(ExecutionFailureKind::KeyNotFoundError);
|
||||||
};
|
};
|
||||||
|
|
||||||
let Some((to_keys, mut to_acc)) = to_data else {
|
let Some((to_keys, mut to_acc)) = self.storage.user_data.get_private_account(&to).cloned()
|
||||||
|
else {
|
||||||
return Err(ExecutionFailureKind::KeyNotFoundError);
|
return Err(ExecutionFailureKind::KeyNotFoundError);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -107,9 +105,7 @@ impl WalletCore {
|
|||||||
to_ipk: nssa_core::encryption::IncomingViewingPublicKey,
|
to_ipk: nssa_core::encryption::IncomingViewingPublicKey,
|
||||||
balance_to_move: u128,
|
balance_to_move: u128,
|
||||||
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
) -> Result<(SendTxResponse, nssa_core::SharedSecretKey), ExecutionFailureKind> {
|
||||||
let from_data = self.get_account(from).await;
|
let Ok(from_acc) = self.get_account(from).await else {
|
||||||
|
|
||||||
let Ok(from_acc) = from_data else {
|
|
||||||
return Err(ExecutionFailureKind::KeyNotFoundError);
|
return Err(ExecutionFailureKind::KeyNotFoundError);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user