From aeddb56978ab6021320e28942975bbf2b5479885 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Thu, 19 Mar 2026 18:55:19 -0300 Subject: [PATCH] fmt --- common/src/transaction.rs | 8 ++++--- indexer/service/protocol/src/convert.rs | 6 ++++- indexer/service/src/mock_service.rs | 2 +- nssa/core/src/circuit_io.rs | 8 +++++-- .../src/bin/privacy_preserving_circuit.rs | 1 - wallet-ffi/src/transfer.rs | 24 +++++++++---------- 6 files changed, 29 insertions(+), 20 deletions(-) diff --git a/common/src/transaction.rs b/common/src/transaction.rs index c34249f3..5e0a50f6 100644 --- a/common/src/transaction.rs +++ b/common/src/transaction.rs @@ -3,7 +3,7 @@ use log::warn; use nssa::{AccountId, V02State}; use serde::{Deserialize, Serialize}; -use crate::{block::BlockId, HashType}; +use crate::{HashType, block::BlockId}; #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] pub enum NSSATransaction { @@ -56,11 +56,13 @@ impl NSSATransaction { pub fn execute_check_on_state( self, state: &mut V02State, - block_id: BlockId + block_id: BlockId, ) -> Result { match &self { Self::Public(tx) => state.transition_from_public_transaction(tx, block_id), - Self::PrivacyPreserving(tx) => state.transition_from_privacy_preserving_transaction(tx, block_id), + Self::PrivacyPreserving(tx) => { + state.transition_from_privacy_preserving_transaction(tx, block_id) + } Self::ProgramDeployment(tx) => state.transition_from_program_deployment_transaction(tx), } .inspect_err(|err| warn!("Error at transition {err:#?}"))?; diff --git a/indexer/service/protocol/src/convert.rs b/indexer/service/protocol/src/convert.rs index a53da4ee..d4e58df4 100644 --- a/indexer/service/protocol/src/convert.rs +++ b/indexer/service/protocol/src/convert.rs @@ -3,7 +3,11 @@ use nssa_core::account::Nonce; use crate::{ - Account, AccountId, BedrockStatus, Block, BlockBody, BlockHeader, Ciphertext, Commitment, CommitmentSetDigest, Data, EncryptedAccountData, EphemeralPublicKey, HashType, MantleMsgId, Nullifier, PrivacyPreservingMessage, PrivacyPreservingTransaction, ProgramDeploymentMessage, ProgramDeploymentTransaction, ProgramId, Proof, PublicKey, PublicMessage, PublicTransaction, Signature, Transaction, ValidityWindow, WitnessSet + Account, AccountId, BedrockStatus, Block, BlockBody, BlockHeader, Ciphertext, Commitment, + CommitmentSetDigest, Data, EncryptedAccountData, EphemeralPublicKey, HashType, MantleMsgId, + Nullifier, PrivacyPreservingMessage, PrivacyPreservingTransaction, ProgramDeploymentMessage, + ProgramDeploymentTransaction, ProgramId, Proof, PublicKey, PublicMessage, PublicTransaction, + Signature, Transaction, ValidityWindow, WitnessSet, }; // ============================================================================ diff --git a/indexer/service/src/mock_service.rs b/indexer/service/src/mock_service.rs index bfd66597..6c7e4474 100644 --- a/indexer/service/src/mock_service.rs +++ b/indexer/service/src/mock_service.rs @@ -13,7 +13,7 @@ use indexer_service_protocol::{ CommitmentSetDigest, Data, EncryptedAccountData, HashType, MantleMsgId, PrivacyPreservingMessage, PrivacyPreservingTransaction, ProgramDeploymentMessage, ProgramDeploymentTransaction, ProgramId, PublicMessage, PublicTransaction, Signature, - Transaction, WitnessSet, ValidityWindow + Transaction, ValidityWindow, WitnessSet, }; use jsonrpsee::{core::SubscriptionResult, types::ErrorObjectOwned}; diff --git a/nssa/core/src/circuit_io.rs b/nssa/core/src/circuit_io.rs index d187f359..86d4abec 100644 --- a/nssa/core/src/circuit_io.rs +++ b/nssa/core/src/circuit_io.rs @@ -1,7 +1,11 @@ use serde::{Deserialize, Serialize}; use crate::{ - account::{Account, AccountWithMetadata}, encryption::Ciphertext, program::{ProgramId, ProgramOutput, ValidityWindow}, Commitment, CommitmentSetDigest, MembershipProof, Nullifier, NullifierPublicKey, NullifierSecretKey, SharedSecretKey + Commitment, CommitmentSetDigest, MembershipProof, Nullifier, NullifierPublicKey, + NullifierSecretKey, SharedSecretKey, + account::{Account, AccountWithMetadata}, + encryption::Ciphertext, + program::{ProgramId, ProgramOutput, ValidityWindow}, }; #[derive(Serialize, Deserialize)] @@ -32,7 +36,7 @@ pub struct PrivacyPreservingCircuitOutput { pub ciphertexts: Vec, pub new_commitments: Vec, pub new_nullifiers: Vec<(Nullifier, CommitmentSetDigest)>, - pub validity_window: ValidityWindow + pub validity_window: ValidityWindow, } #[cfg(feature = "host")] diff --git a/program_methods/guest/src/bin/privacy_preserving_circuit.rs b/program_methods/guest/src/bin/privacy_preserving_circuit.rs index c66fbee9..db767e3e 100644 --- a/program_methods/guest/src/bin/privacy_preserving_circuit.rs +++ b/program_methods/guest/src/bin/privacy_preserving_circuit.rs @@ -53,7 +53,6 @@ impl ExecutionState { }; let mut chained_calls = VecDeque::from_iter([(initial_call, None)]); - let mut program_outputs_iter = program_outputs.into_iter(); let mut chain_calls_counter = 0; diff --git a/wallet-ffi/src/transfer.rs b/wallet-ffi/src/transfer.rs index ea188f9b..a014028f 100644 --- a/wallet-ffi/src/transfer.rs +++ b/wallet-ffi/src/transfer.rs @@ -163,8 +163,8 @@ pub unsafe extern "C" fn wallet_ffi_transfer_shielded( transfer.send_shielded_transfer_to_outer_account(from_id, to_npk, to_vpk, amount), ) { Ok((response, _shared_key)) => { - let tx_hash = CString::new(response.tx_hash) - .map_or(ptr::null_mut(), std::ffi::CString::into_raw); + let tx_hash = + CString::new(response.tx_hash).map_or(ptr::null_mut(), std::ffi::CString::into_raw); unsafe { (*out_result).tx_hash = tx_hash; @@ -243,8 +243,8 @@ pub unsafe extern "C" fn wallet_ffi_transfer_deshielded( match block_on(transfer.send_deshielded_transfer(from_id, to_id, amount)) { Ok((response, _shared_key)) => { - let tx_hash = CString::new(response.tx_hash) - .map_or(ptr::null_mut(), std::ffi::CString::into_raw); + let tx_hash = + CString::new(response.tx_hash).map_or(ptr::null_mut(), std::ffi::CString::into_raw); unsafe { (*out_result).tx_hash = tx_hash; @@ -331,8 +331,8 @@ pub unsafe extern "C" fn wallet_ffi_transfer_private( match block_on(transfer.send_private_transfer_to_outer_account(from_id, to_npk, to_vpk, amount)) { Ok((response, _shared_key)) => { - let tx_hash = CString::new(response.tx_hash) - .map_or(ptr::null_mut(), std::ffi::CString::into_raw); + let tx_hash = + CString::new(response.tx_hash).map_or(ptr::null_mut(), std::ffi::CString::into_raw); unsafe { (*out_result).tx_hash = tx_hash; @@ -414,8 +414,8 @@ pub unsafe extern "C" fn wallet_ffi_transfer_shielded_owned( match block_on(transfer.send_shielded_transfer(from_id, to_id, amount)) { Ok((response, _shared_key)) => { - let tx_hash = CString::new(response.tx_hash) - .map_or(ptr::null_mut(), std::ffi::CString::into_raw); + let tx_hash = + CString::new(response.tx_hash).map_or(ptr::null_mut(), std::ffi::CString::into_raw); unsafe { (*out_result).tx_hash = tx_hash; @@ -497,8 +497,8 @@ pub unsafe extern "C" fn wallet_ffi_transfer_private_owned( match block_on(transfer.send_private_transfer_to_owned_account(from_id, to_id, amount)) { Ok((response, _shared_keys)) => { - let tx_hash = CString::new(response.tx_hash) - .map_or(ptr::null_mut(), std::ffi::CString::into_raw); + let tx_hash = + CString::new(response.tx_hash).map_or(ptr::null_mut(), std::ffi::CString::into_raw); unsafe { (*out_result).tx_hash = tx_hash; @@ -639,8 +639,8 @@ pub unsafe extern "C" fn wallet_ffi_register_private_account( match block_on(transfer.register_account_private(account_id)) { Ok((res, _secret)) => { - let tx_hash = CString::new(res.tx_hash) - .map_or(ptr::null_mut(), std::ffi::CString::into_raw); + let tx_hash = + CString::new(res.tx_hash).map_or(ptr::null_mut(), std::ffi::CString::into_raw); unsafe { (*out_result).tx_hash = tx_hash;