diff --git a/artifacts/program_methods/amm.bin b/artifacts/program_methods/amm.bin
index 27d0796c..a1ab1938 100644
Binary files a/artifacts/program_methods/amm.bin and b/artifacts/program_methods/amm.bin differ
diff --git a/artifacts/program_methods/authenticated_transfer.bin b/artifacts/program_methods/authenticated_transfer.bin
index 17543901..847ee230 100644
Binary files a/artifacts/program_methods/authenticated_transfer.bin and b/artifacts/program_methods/authenticated_transfer.bin differ
diff --git a/artifacts/program_methods/pinata.bin b/artifacts/program_methods/pinata.bin
index 8cd9efb2..a248b3e0 100644
Binary files a/artifacts/program_methods/pinata.bin and b/artifacts/program_methods/pinata.bin differ
diff --git a/artifacts/program_methods/pinata_token.bin b/artifacts/program_methods/pinata_token.bin
index 07d9e13c..1b6366b2 100644
Binary files a/artifacts/program_methods/pinata_token.bin and b/artifacts/program_methods/pinata_token.bin differ
diff --git a/artifacts/program_methods/privacy_preserving_circuit.bin b/artifacts/program_methods/privacy_preserving_circuit.bin
index 56bf86f7..1612651a 100644
Binary files a/artifacts/program_methods/privacy_preserving_circuit.bin and b/artifacts/program_methods/privacy_preserving_circuit.bin differ
diff --git a/artifacts/program_methods/token.bin b/artifacts/program_methods/token.bin
index 4b7346c5..8841f4dc 100644
Binary files a/artifacts/program_methods/token.bin and b/artifacts/program_methods/token.bin differ
diff --git a/artifacts/test_program_methods/burner.bin b/artifacts/test_program_methods/burner.bin
index 5b92cfc4..6fb8556d 100644
Binary files a/artifacts/test_program_methods/burner.bin and b/artifacts/test_program_methods/burner.bin differ
diff --git a/artifacts/test_program_methods/chain_caller.bin b/artifacts/test_program_methods/chain_caller.bin
index adb03a26..a41dea0b 100644
Binary files a/artifacts/test_program_methods/chain_caller.bin and b/artifacts/test_program_methods/chain_caller.bin differ
diff --git a/artifacts/test_program_methods/changer_claimer.bin b/artifacts/test_program_methods/changer_claimer.bin
index 5d5b157a..faf6b90a 100644
Binary files a/artifacts/test_program_methods/changer_claimer.bin and b/artifacts/test_program_methods/changer_claimer.bin differ
diff --git a/artifacts/test_program_methods/claimer.bin b/artifacts/test_program_methods/claimer.bin
index b816a527..c7f999fa 100644
Binary files a/artifacts/test_program_methods/claimer.bin and b/artifacts/test_program_methods/claimer.bin differ
diff --git a/artifacts/test_program_methods/data_changer.bin b/artifacts/test_program_methods/data_changer.bin
index 3dcd0663..ca1152de 100644
Binary files a/artifacts/test_program_methods/data_changer.bin and b/artifacts/test_program_methods/data_changer.bin differ
diff --git a/artifacts/test_program_methods/extra_output.bin b/artifacts/test_program_methods/extra_output.bin
index 37bd04e3..e1c7492e 100644
Binary files a/artifacts/test_program_methods/extra_output.bin and b/artifacts/test_program_methods/extra_output.bin differ
diff --git a/artifacts/test_program_methods/malicious_authorization_changer.bin b/artifacts/test_program_methods/malicious_authorization_changer.bin
index 6d25674b..fb316c91 100644
Binary files a/artifacts/test_program_methods/malicious_authorization_changer.bin and b/artifacts/test_program_methods/malicious_authorization_changer.bin differ
diff --git a/artifacts/test_program_methods/minter.bin b/artifacts/test_program_methods/minter.bin
index 73607e85..807bd3e9 100644
Binary files a/artifacts/test_program_methods/minter.bin and b/artifacts/test_program_methods/minter.bin differ
diff --git a/artifacts/test_program_methods/missing_output.bin b/artifacts/test_program_methods/missing_output.bin
index 7b2aa8a3..25401987 100644
Binary files a/artifacts/test_program_methods/missing_output.bin and b/artifacts/test_program_methods/missing_output.bin differ
diff --git a/artifacts/test_program_methods/modified_transfer.bin b/artifacts/test_program_methods/modified_transfer.bin
index ccb40a3a..6e093883 100644
Binary files a/artifacts/test_program_methods/modified_transfer.bin and b/artifacts/test_program_methods/modified_transfer.bin differ
diff --git a/artifacts/test_program_methods/nonce_changer.bin b/artifacts/test_program_methods/nonce_changer.bin
index 7e26bf73..59fbf869 100644
Binary files a/artifacts/test_program_methods/nonce_changer.bin and b/artifacts/test_program_methods/nonce_changer.bin differ
diff --git a/artifacts/test_program_methods/noop.bin b/artifacts/test_program_methods/noop.bin
index 69608bbf..0d64d95f 100644
Binary files a/artifacts/test_program_methods/noop.bin and b/artifacts/test_program_methods/noop.bin differ
diff --git a/artifacts/test_program_methods/program_owner_changer.bin b/artifacts/test_program_methods/program_owner_changer.bin
index f4c91bae..83669e54 100644
Binary files a/artifacts/test_program_methods/program_owner_changer.bin and b/artifacts/test_program_methods/program_owner_changer.bin differ
diff --git a/artifacts/test_program_methods/simple_balance_transfer.bin b/artifacts/test_program_methods/simple_balance_transfer.bin
index b3381b5f..8fa8de92 100644
Binary files a/artifacts/test_program_methods/simple_balance_transfer.bin and b/artifacts/test_program_methods/simple_balance_transfer.bin differ
diff --git a/common/src/test_utils.rs b/common/src/test_utils.rs
index 09651c18..432bdc40 100644
--- a/common/src/test_utils.rs
+++ b/common/src/test_utils.rs
@@ -1,4 +1,5 @@
use nssa::AccountId;
+use nssa_core::account::Nonce;
use crate::{
HashType,
@@ -64,7 +65,7 @@ pub fn create_transaction_native_token_transfer(
signing_key: nssa::PrivateKey,
) -> NSSATransaction {
let account_ids = vec![from, to];
- let nonces = vec![nonce];
+ let nonces = vec![Nonce(nonce)];
let program_id = nssa::program::Program::authenticated_transfer_program().id();
let message = nssa::public_transaction::Message::try_new(
program_id,
diff --git a/examples/program_deployment/src/bin/run_hello_world_with_authorization.rs b/examples/program_deployment/src/bin/run_hello_world_with_authorization.rs
index 5e7df2d2..e137b0ac 100644
--- a/examples/program_deployment/src/bin/run_hello_world_with_authorization.rs
+++ b/examples/program_deployment/src/bin/run_hello_world_with_authorization.rs
@@ -3,6 +3,7 @@ use nssa::{
program::Program,
public_transaction::{Message, WitnessSet},
};
+use nssa_core::account::Nonce;
use wallet::WalletCore;
// Before running this example, compile the `hello_world_with_authorization.rs` guest program with:
@@ -62,7 +63,7 @@ async fn main() {
.await
.expect("Node should be reachable to query account data");
let signing_keys = [signing_key];
- let message = Message::try_new(program.id(), vec![account_id], nonces, greeting).unwrap();
+ let message = Message::try_new(program.id(), vec![account_id], nonces.iter().map(|x|Nonce(*x)).collect(), greeting).unwrap();
// Pass the signing key to sign the message. This will be used by the node
// to flag the pre_state as `is_authorized` when executing the program
let witness_set = WitnessSet::for_message(&message, &signing_keys);
diff --git a/explorer_service/src/components/account_preview.rs b/explorer_service/src/components/account_preview.rs
index 3a99eeb8..7226ce71 100644
--- a/explorer_service/src/components/account_preview.rs
+++ b/explorer_service/src/components/account_preview.rs
@@ -33,7 +33,7 @@ pub fn AccountPreview(account_id: AccountId, account: Account) -> impl IntoView
"Nonce: "
- {nonce.to_string()}
+ {nonce.0.to_string()}
"Data: "
diff --git a/explorer_service/src/pages/account_page.rs b/explorer_service/src/pages/account_page.rs
index efd9ae81..a5633052 100644
--- a/explorer_service/src/pages/account_page.rs
+++ b/explorer_service/src/pages/account_page.rs
@@ -101,7 +101,7 @@ pub fn AccountPage() -> impl IntoView {
let account_id_str = format_utils::format_account_id(&acc_id);
let program_id = format_utils::format_program_id(&program_owner);
let balance_str = balance.to_string();
- let nonce_str = nonce.to_string();
+ let nonce_str = nonce.0.to_string();
let data_len = data.0.len();
view! {
diff --git a/explorer_service/src/pages/transaction_page.rs b/explorer_service/src/pages/transaction_page.rs
index aab7f57a..c2e73858 100644
--- a/explorer_service/src/pages/transaction_page.rs
+++ b/explorer_service/src/pages/transaction_page.rs
@@ -130,7 +130,7 @@ pub fn TransactionPage() -> impl IntoView {
{account_id_str}
- " (nonce: " {nonce.to_string()} ")"
+ " (nonce: " {nonce.0.to_string()} ")"
}
@@ -204,7 +204,7 @@ pub fn TransactionPage() -> impl IntoView {
{account_id_str}
- " (nonce: " {nonce.to_string()} ")"
+ " (nonce: " {nonce.0.to_string()} ")"
}
diff --git a/indexer/service/protocol/src/convert.rs b/indexer/service/protocol/src/convert.rs
index d1caaf81..c24b33ff 100644
--- a/indexer/service/protocol/src/convert.rs
+++ b/indexer/service/protocol/src/convert.rs
@@ -34,7 +34,7 @@ impl From for Account {
program_owner,
balance,
data: data.into(),
- nonce,
+ nonce: Nonce(nonce.0),
}
}
}
@@ -54,7 +54,7 @@ impl TryFrom for nssa_core::account::Account {
program_owner,
balance,
data: data.try_into()?,
- nonce,
+ nonce: nssa_core::account::Nonce(nonce.0),
})
}
}
@@ -232,7 +232,7 @@ impl From for PublicMessage {
Self {
program_id,
account_ids: account_ids.into_iter().map(Into::into).collect(),
- nonces,
+ nonces: nonces.iter().map(|x|Nonce(x.0)).collect(),
instruction_data,
}
}
@@ -249,7 +249,7 @@ impl From for nssa::public_transaction::Message {
Self::new_preserialized(
program_id,
account_ids.into_iter().map(Into::into).collect(),
- nonces,
+ nonces.iter().map(|x|nssa_core::account::Nonce(x.0)).collect(),
instruction_data,
)
}
@@ -267,7 +267,7 @@ impl From for PrivacyPre
} = value;
Self {
public_account_ids: public_account_ids.into_iter().map(Into::into).collect(),
- nonces,
+ nonces: nonces.iter().map(|x|Nonce(x.0)).collect(),
public_post_states: public_post_states.into_iter().map(Into::into).collect(),
encrypted_private_post_states: encrypted_private_post_states
.into_iter()
@@ -296,7 +296,7 @@ impl TryFrom for nssa::privacy_preserving_transaction:
} = value;
Ok(Self {
public_account_ids: public_account_ids.into_iter().map(Into::into).collect(),
- nonces,
+ nonces: nonces.iter().map(|x|nssa_core::account::Nonce(x.0)).collect(),
public_post_states: public_post_states
.into_iter()
.map(TryInto::try_into)
diff --git a/indexer/service/protocol/src/lib.rs b/indexer/service/protocol/src/lib.rs
index 91dcc5ce..91f81295 100644
--- a/indexer/service/protocol/src/lib.rs
+++ b/indexer/service/protocol/src/lib.rs
@@ -9,7 +9,8 @@ use serde::{Deserialize, Serialize};
#[cfg(feature = "convert")]
mod convert;
-pub type Nonce = u128;
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
+pub struct Nonce(pub u128);
pub type ProgramId = [u32; 8];
diff --git a/integration_tests/src/config.rs b/integration_tests/src/config.rs
index 9d69fe22..136df85e 100644
--- a/integration_tests/src/config.rs
+++ b/integration_tests/src/config.rs
@@ -4,7 +4,7 @@ use anyhow::{Context, Result};
use indexer_service::{BackoffConfig, BedrockClientConfig, ChannelId, IndexerConfig};
use key_protocol::key_management::KeyChain;
use nssa::{Account, AccountId, PrivateKey, PublicKey};
-use nssa_core::{account::Data, program::DEFAULT_PROGRAM_ID};
+use nssa_core::{account::{Data, Nonce}, program::DEFAULT_PROGRAM_ID};
use sequencer_core::config::{
AccountInitialData, BedrockConfig, CommitmentsInitialData, SequencerConfig,
};
@@ -156,7 +156,7 @@ impl InitialData {
balance: 10_000,
data: Data::default(),
program_owner: DEFAULT_PROGRAM_ID,
- nonce: 0,
+ nonce: Nonce(0),
},
),
(
@@ -165,7 +165,7 @@ impl InitialData {
balance: 20_000,
data: Data::default(),
program_owner: DEFAULT_PROGRAM_ID,
- nonce: 0,
+ nonce: Nonce(0),
},
),
],
diff --git a/integration_tests/tests/account.rs b/integration_tests/tests/account.rs
index ec53da78..f0a2f9a8 100644
--- a/integration_tests/tests/account.rs
+++ b/integration_tests/tests/account.rs
@@ -20,7 +20,7 @@ async fn get_existing_account() -> Result<()> {
);
assert_eq!(account.balance, 10000);
assert!(account.data.is_empty());
- assert_eq!(account.nonce, 0);
+ assert_eq!(account.nonce.0, 0);
info!("Successfully retrieved account with correct details");
diff --git a/integration_tests/tests/auth_transfer/public.rs b/integration_tests/tests/auth_transfer/public.rs
index d4a7167a..be03d8ec 100644
--- a/integration_tests/tests/auth_transfer/public.rs
+++ b/integration_tests/tests/auth_transfer/public.rs
@@ -235,7 +235,7 @@ async fn initialize_public_account() -> Result<()> {
Program::authenticated_transfer_program().id()
);
assert_eq!(account.balance, 0);
- assert_eq!(account.nonce, 1);
+ assert_eq!(account.nonce.0, 1);
assert!(account.data.is_empty());
info!("Successfully initialized public account");
diff --git a/integration_tests/tests/program_deployment.rs b/integration_tests/tests/program_deployment.rs
index 098083d2..6a40e56c 100644
--- a/integration_tests/tests/program_deployment.rs
+++ b/integration_tests/tests/program_deployment.rs
@@ -58,7 +58,7 @@ async fn deploy_and_execute_program() -> Result<()> {
assert_eq!(post_state_account.program_owner, data_changer.id());
assert_eq!(post_state_account.balance, 0);
assert_eq!(post_state_account.data.as_ref(), &[0]);
- assert_eq!(post_state_account.nonce, 0);
+ assert_eq!(post_state_account.nonce.0, 0);
info!("Successfully deployed and executed program");
diff --git a/integration_tests/tests/tps.rs b/integration_tests/tests/tps.rs
index aa86d465..ec2dfac0 100644
--- a/integration_tests/tests/tps.rs
+++ b/integration_tests/tests/tps.rs
@@ -15,7 +15,7 @@ use nssa::{
};
use nssa_core::{
MembershipProof, NullifierPublicKey,
- account::{AccountWithMetadata, data::Data},
+ account::{AccountWithMetadata, data::Data, Nonce},
encryption::IncomingViewingPublicKey,
};
use tokio::test;
@@ -135,7 +135,7 @@ impl TpsTestManager {
let message = putx::Message::try_new(
program.id(),
[pair[0].1, pair[1].1].to_vec(),
- [0u128].to_vec(),
+ [Nonce(0u128)].to_vec(),
amount,
)
.unwrap();
@@ -164,7 +164,7 @@ impl TpsTestManager {
let key_chain = KeyChain::new_os_random();
let account = Account {
balance: 100,
- nonce: 0xdeadbeef,
+ nonce: Nonce(0xdeadbeef),
program_owner: Program::authenticated_transfer_program().id(),
data: Data::default(),
};
@@ -198,7 +198,7 @@ fn build_privacy_transaction() -> PrivacyPreservingTransaction {
let sender_pre = AccountWithMetadata::new(
Account {
balance: 100,
- nonce: 0xdeadbeef,
+ nonce: Nonce(0xdeadbeef),
program_owner: program.id(),
data: Data::default(),
},
@@ -232,7 +232,6 @@ fn build_privacy_transaction() -> PrivacyPreservingTransaction {
vec![sender_pre, recipient_pre],
Program::serialize_instruction(balance_to_move).unwrap(),
vec![1, 2],
- vec![0xdeadbeef1, 0xdeadbeef2],
vec![
(sender_npk.clone(), sender_ss),
(recipient_npk.clone(), recipient_ss),
diff --git a/integration_tests/tests/wallet_ffi.rs b/integration_tests/tests/wallet_ffi.rs
index 9a36cf93..3e0010d0 100644
--- a/integration_tests/tests/wallet_ffi.rs
+++ b/integration_tests/tests/wallet_ffi.rs
@@ -373,7 +373,7 @@ fn test_wallet_ffi_get_account_public() -> Result<()> {
);
assert_eq!(account.balance, 10000);
assert!(account.data.is_empty());
- assert_eq!(account.nonce, 0);
+ assert_eq!(account.nonce.0, 0);
unsafe {
wallet_ffi_free_account_data((&mut out_account) as *mut FfiAccount);
diff --git a/nssa/core/src/account.rs b/nssa/core/src/account.rs
index 4e523e9b..1c988a4a 100644
--- a/nssa/core/src/account.rs
+++ b/nssa/core/src/account.rs
@@ -3,14 +3,43 @@ use std::{fmt::Display, str::FromStr};
use base58::{FromBase58, ToBase58};
use borsh::{BorshDeserialize, BorshSerialize};
pub use data::Data;
+use risc0_zkvm::{guest::sha::guest::Impl, sha::Sha256};
use serde::{Deserialize, Serialize};
use serde_with::{DeserializeFromStr, SerializeDisplay};
-use crate::program::ProgramId;
+use crate::{NullifierPublicKey, NullifierSecretKey, program::ProgramId};
pub mod data;
-pub type Nonce = u128;
+#[derive(Copy, Debug, Default, Clone, Eq, PartialEq, Serialize, Deserialize, BorshDeserialize, BorshSerialize)]
+pub struct Nonce(pub u128);
+
+impl Nonce {
+ pub fn public_account_nonce_increment(mut self) {
+ self.0 += 1;
+ }
+
+ pub fn private_account_nonce_init(self, npk: &NullifierPublicKey) -> Nonce {
+ let mut bytes = Vec::new();
+ bytes.extend_from_slice(&npk.to_byte_array());
+ let bytes = Impl::hash_bytes(&bytes).as_bytes();
+ let bytes = bytes.first_chunk::<16>().unwrap();
+
+ Nonce(u128::from_le_bytes(*bytes))
+ }
+
+ pub fn private_account_nonce_increment(self, nsk: &NullifierSecretKey) -> Nonce {
+ let mut bytes = Vec::new();
+ bytes.extend_from_slice(nsk);
+ let bytes = Impl::hash_bytes(&bytes).as_bytes();
+ let bytes = bytes.first_chunk::<16>().unwrap();
+
+ Nonce(u128::from_le_bytes(*bytes))
+ }
+
+}
+
+
/// Account to be used both in public and private contexts
#[derive(
@@ -123,7 +152,7 @@ mod tests {
fn test_zero_nonce_account_data_creation() {
let new_acc = Account::default();
- assert_eq!(new_acc.nonce, 0);
+ assert_eq!(new_acc.nonce.0, 0);
}
#[test]
@@ -150,7 +179,7 @@ mod tests {
.to_vec()
.try_into()
.unwrap(),
- nonce: 0xdeadbeef,
+ nonce: Nonce(0xdeadbeef),
};
let fingerprint = AccountId::new([8; 32]);
let new_acc_with_metadata = AccountWithMetadata::new(account.clone(), true, fingerprint);
diff --git a/nssa/core/src/circuit_io.rs b/nssa/core/src/circuit_io.rs
index dedcf780..7f8efa6e 100644
--- a/nssa/core/src/circuit_io.rs
+++ b/nssa/core/src/circuit_io.rs
@@ -18,8 +18,6 @@ pub struct PrivacyPreservingCircuitInput {
/// - `1` - private account with authentication
/// - `2` - private account without authentication
pub visibility_mask: Vec,
- /// Nonces of private accounts.
- pub private_account_nonces: Vec,
/// Public keys of private accounts.
pub private_account_keys: Vec<(NullifierPublicKey, SharedSecretKey)>,
/// Nullifier secret keys for authorized private accounts.
@@ -67,7 +65,7 @@ mod tests {
program_owner: [1, 2, 3, 4, 5, 6, 7, 8],
balance: 12345678901234567890,
data: b"test data".to_vec().try_into().unwrap(),
- nonce: 18446744073709551614,
+ nonce: Nonce(18446744073709551614),
},
true,
AccountId::new([0; 32]),
@@ -77,7 +75,7 @@ mod tests {
program_owner: [9, 9, 9, 8, 8, 8, 7, 7],
balance: 123123123456456567112,
data: b"test data".to_vec().try_into().unwrap(),
- nonce: 9999999999999999999999,
+ nonce: Nonce(9999999999999999999999),
},
false,
AccountId::new([1; 32]),
@@ -87,7 +85,7 @@ mod tests {
program_owner: [1, 2, 3, 4, 5, 6, 7, 8],
balance: 100,
data: b"post state data".to_vec().try_into().unwrap(),
- nonce: 18446744073709551615,
+ nonce: Nonce(18446744073709551615),
}],
ciphertexts: vec![Ciphertext(vec![255, 255, 1, 1, 2, 2])],
new_commitments: vec![Commitment::new(
diff --git a/nssa/core/src/commitment.rs b/nssa/core/src/commitment.rs
index b08e3005..9a5bce2d 100644
--- a/nssa/core/src/commitment.rs
+++ b/nssa/core/src/commitment.rs
@@ -47,7 +47,7 @@ impl Commitment {
this.extend_from_slice(&word.to_le_bytes());
}
this.extend_from_slice(&account.balance.to_le_bytes());
- this.extend_from_slice(&account.nonce.to_le_bytes());
+ this.extend_from_slice(&account.nonce.0.to_le_bytes());
let hashed_data: [u8; 32] = Impl::hash_bytes(&account.data)
.as_bytes()
.try_into()
diff --git a/nssa/core/src/encoding.rs b/nssa/core/src/encoding.rs
index 34be3782..1b256e61 100644
--- a/nssa/core/src/encoding.rs
+++ b/nssa/core/src/encoding.rs
@@ -23,7 +23,7 @@ impl Account {
bytes.extend_from_slice(&word.to_le_bytes());
}
bytes.extend_from_slice(&self.balance.to_le_bytes());
- bytes.extend_from_slice(&self.nonce.to_le_bytes());
+ bytes.extend_from_slice(&self.nonce.0.to_le_bytes());
let data_length: u32 = self.data.len() as u32;
bytes.extend_from_slice(&data_length.to_le_bytes());
bytes.extend_from_slice(self.data.as_ref());
@@ -32,7 +32,7 @@ impl Account {
#[cfg(feature = "host")]
pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result {
- use crate::account::data::Data;
+ use crate::account::{Nonce, data::Data};
let mut u32_bytes = [0u8; 4];
let mut u128_bytes = [0u8; 16];
@@ -50,7 +50,7 @@ impl Account {
// nonce
cursor.read_exact(&mut u128_bytes)?;
- let nonce = u128::from_le_bytes(u128_bytes);
+ let nonce = Nonce(u128::from_le_bytes(u128_bytes));
// data
let data = Data::from_cursor(cursor)?;
@@ -160,6 +160,8 @@ impl AccountId {
#[cfg(test)]
mod tests {
+ use crate::account::Nonce;
+
use super::*;
#[test]
@@ -167,7 +169,7 @@ mod tests {
let account = Account {
program_owner: [1, 2, 3, 4, 5, 6, 7, 8],
balance: 123456789012345678901234567890123456,
- nonce: 42,
+ nonce: Nonce(42),
data: b"hola mundo".to_vec().try_into().unwrap(),
};
@@ -225,10 +227,12 @@ mod tests {
#[cfg(feature = "host")]
#[test]
fn test_account_to_bytes_roundtrip() {
+ use crate::account::Nonce;
+
let account = Account {
program_owner: [1, 2, 3, 4, 5, 6, 7, 8],
balance: 123456789012345678901234567890123456,
- nonce: 42,
+ nonce: Nonce(42),
data: b"hola mundo".to_vec().try_into().unwrap(),
};
let bytes = account.to_bytes();
diff --git a/nssa/core/src/program.rs b/nssa/core/src/program.rs
index a6a04425..0c6ad50a 100644
--- a/nssa/core/src/program.rs
+++ b/nssa/core/src/program.rs
@@ -327,6 +327,8 @@ impl WrappedBalanceSum {
#[cfg(test)]
mod tests {
+ use crate::account::Nonce;
+
use super::*;
#[test]
@@ -335,7 +337,7 @@ mod tests {
program_owner: [1, 2, 3, 4, 5, 6, 7, 8],
balance: 1337,
data: vec![0xde, 0xad, 0xbe, 0xef].try_into().unwrap(),
- nonce: 10,
+ nonce: Nonce(10),
};
let account_post_state = AccountPostState::new_claimed(account.clone());
@@ -350,7 +352,7 @@ mod tests {
program_owner: [1, 2, 3, 4, 5, 6, 7, 8],
balance: 1337,
data: vec![0xde, 0xad, 0xbe, 0xef].try_into().unwrap(),
- nonce: 10,
+ nonce: Nonce(10),
};
let account_post_state = AccountPostState::new(account.clone());
@@ -365,7 +367,7 @@ mod tests {
program_owner: [1, 2, 3, 4, 5, 6, 7, 8],
balance: 1337,
data: vec![0xde, 0xad, 0xbe, 0xef].try_into().unwrap(),
- nonce: 10,
+ nonce: Nonce(10),
};
let mut account_post_state = AccountPostState::new(account.clone());
diff --git a/nssa/src/privacy_preserving_transaction/circuit.rs b/nssa/src/privacy_preserving_transaction/circuit.rs
index 1ebe90f3..12ed37a3 100644
--- a/nssa/src/privacy_preserving_transaction/circuit.rs
+++ b/nssa/src/privacy_preserving_transaction/circuit.rs
@@ -59,7 +59,6 @@ pub fn execute_and_prove(
pre_states: Vec,
instruction_data: InstructionData,
visibility_mask: Vec,
- private_account_nonces: Vec,
private_account_keys: Vec<(NullifierPublicKey, SharedSecretKey)>,
private_account_nsks: Vec,
private_account_membership_proofs: Vec