mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-04-10 13:13:15 +00:00
add test
This commit is contained in:
parent
867d8dac90
commit
52f1c337ec
@ -1021,6 +1021,48 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn privacy_preserving_tx_touching_clock_account_is_dropped() {
|
||||
let (mut sequencer, mempool_handle) = common_setup().await;
|
||||
|
||||
// Craft a PP transaction that declares a modified post-state for a clock account.
|
||||
let crafted_pp_tx = {
|
||||
let message = nssa::privacy_preserving_transaction::Message {
|
||||
public_account_ids: vec![nssa::CLOCK_01_PROGRAM_ACCOUNT_ID],
|
||||
nonces: vec![],
|
||||
public_post_states: vec![nssa::Account::default()],
|
||||
encrypted_private_post_states: vec![],
|
||||
new_commitments: vec![],
|
||||
new_nullifiers: vec![],
|
||||
};
|
||||
let witness_set = nssa::privacy_preserving_transaction::WitnessSet::from_raw_parts(
|
||||
vec![],
|
||||
nssa::privacy_preserving_transaction::circuit::Proof::from_inner(vec![]),
|
||||
);
|
||||
NSSATransaction::PrivacyPreserving(nssa::PrivacyPreservingTransaction::new(
|
||||
message,
|
||||
witness_set,
|
||||
))
|
||||
};
|
||||
|
||||
mempool_handle.push(crafted_pp_tx).await.unwrap();
|
||||
sequencer
|
||||
.produce_new_block_with_mempool_transactions()
|
||||
.unwrap();
|
||||
|
||||
let block = sequencer
|
||||
.store
|
||||
.get_block_at_id(sequencer.chain_height)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
// The PP tx was dropped. Only the system-appended clock tx remains.
|
||||
assert_eq!(
|
||||
block.body.transactions,
|
||||
vec![NSSATransaction::clock_invocation(block.header.timestamp)]
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn start_from_config_uses_db_height_not_config_genesis() {
|
||||
let mut config = setup_sequencer_config();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user