mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-04 06:13:10 +00:00
fmt, clippy
This commit is contained in:
parent
3a9d9af815
commit
e8ace6838f
@ -1,4 +1,4 @@
|
|||||||
use crate::{NullifierPublicKey, program::ProgramId};
|
use crate::program::ProgramId;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
pub type Nonce = u128;
|
pub type Nonce = u128;
|
||||||
|
|||||||
@ -40,7 +40,8 @@ impl PrivacyPreservingCircuitOutput {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
account::{Account, AccountWithMetadata, FingerPrint}, Commitment, Nullifier, NullifierPublicKey
|
Commitment, Nullifier, NullifierPublicKey,
|
||||||
|
account::{Account, AccountWithMetadata, FingerPrint},
|
||||||
};
|
};
|
||||||
use risc0_zkvm::serde::from_slice;
|
use risc0_zkvm::serde::from_slice;
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ mod tests {
|
|||||||
data: b"test data".to_vec(),
|
data: b"test data".to_vec(),
|
||||||
nonce: 18446744073709551614,
|
nonce: 18446744073709551614,
|
||||||
},
|
},
|
||||||
is_authorized: true,
|
is_authorized: true,
|
||||||
fingerprint: FingerPrint::new([0; 32]),
|
fingerprint: FingerPrint::new([0; 32]),
|
||||||
},
|
},
|
||||||
AccountWithMetadata {
|
AccountWithMetadata {
|
||||||
@ -65,7 +66,7 @@ mod tests {
|
|||||||
data: b"test data".to_vec(),
|
data: b"test data".to_vec(),
|
||||||
nonce: 9999999999999999999999,
|
nonce: 9999999999999999999999,
|
||||||
},
|
},
|
||||||
is_authorized: false,
|
is_authorized: false,
|
||||||
fingerprint: FingerPrint::new([1; 32]),
|
fingerprint: FingerPrint::new([1; 32]),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use crate::account::{Account, AccountWithMetadata, FingerPrint};
|
use crate::account::{Account, AccountWithMetadata};
|
||||||
use risc0_zkvm::serde::Deserializer;
|
use risc0_zkvm::serde::Deserializer;
|
||||||
use risc0_zkvm::{DeserializeOwned, guest::env};
|
use risc0_zkvm::{DeserializeOwned, guest::env};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|||||||
@ -82,7 +82,6 @@ impl<'de> Deserialize<'de> for Address {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl From<&Address> for FingerPrint {
|
impl From<&Address> for FingerPrint {
|
||||||
fn from(address: &Address) -> Self {
|
fn from(address: &Address) -> Self {
|
||||||
FingerPrint::new(address.value)
|
FingerPrint::new(address.value)
|
||||||
@ -95,7 +94,6 @@ impl From<Address> for FingerPrint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{Address, address::AddressError};
|
use crate::{Address, address::AddressError};
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
use nssa_core::{
|
use nssa_core::{
|
||||||
MembershipProof, NullifierPublicKey, NullifierSecretKey, PrivacyPreservingCircuitInput,
|
MembershipProof, NullifierPublicKey, NullifierSecretKey, PrivacyPreservingCircuitInput,
|
||||||
PrivacyPreservingCircuitOutput, SharedSecretKey,
|
PrivacyPreservingCircuitOutput, SharedSecretKey,
|
||||||
account::{AccountWithMetadata, FingerPrint},
|
account::AccountWithMetadata,
|
||||||
program::{InstructionData, ProgramOutput},
|
program::{InstructionData, ProgramOutput},
|
||||||
};
|
};
|
||||||
use risc0_zkvm::{ExecutorEnv, InnerReceipt, Receipt, default_prover};
|
use risc0_zkvm::{ExecutorEnv, InnerReceipt, Receipt, default_prover};
|
||||||
@ -90,7 +90,7 @@ fn execute_and_prove_program(
|
|||||||
mod tests {
|
mod tests {
|
||||||
use nssa_core::{
|
use nssa_core::{
|
||||||
Commitment, EncryptionScheme, Nullifier,
|
Commitment, EncryptionScheme, Nullifier,
|
||||||
account::{Account, AccountWithMetadata},
|
account::{Account, AccountWithMetadata, FingerPrint},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
use nssa_core::{
|
use nssa_core::{
|
||||||
account::{Account, AccountWithMetadata, FingerPrint},
|
account::{Account, AccountWithMetadata},
|
||||||
program::{InstructionData, ProgramId, ProgramOutput},
|
program::{InstructionData, ProgramId, ProgramOutput},
|
||||||
};
|
};
|
||||||
use program_methods::{AUTHENTICATED_TRANSFER_ELF, AUTHENTICATED_TRANSFER_ID};
|
use program_methods::{AUTHENTICATED_TRANSFER_ELF, AUTHENTICATED_TRANSFER_ID};
|
||||||
|
|||||||
@ -94,7 +94,7 @@ impl PublicTransaction {
|
|||||||
.map(|address| AccountWithMetadata {
|
.map(|address| AccountWithMetadata {
|
||||||
account: state.get_account_by_address(address),
|
account: state.get_account_by_address(address),
|
||||||
is_authorized: signer_addresses.contains(address),
|
is_authorized: signer_addresses.contains(address),
|
||||||
fingerprint: address.into()
|
fingerprint: address.into(),
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user