Skip to content

Commit

Permalink
transaction test
Browse files Browse the repository at this point in the history
  • Loading branch information
bazzilic authored and mariari committed Aug 30, 2023
1 parent a625518 commit 7d9a13c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion taiga_halo2/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,25 @@ pub mod testing {
(bundle, r_vec)
}

#[test]
fn test_halo2_transaction() {
use super::Transaction;
use rand::rngs::OsRng;

let rng = OsRng;

let (shielded_ptx_bundle, r_vec) = create_shielded_ptx_bundle(2);
// TODO: add transparent_ptx_bundle test
let transparent_ptx_bundle = None;
let tx = Transaction::build(
rng,
Some(shielded_ptx_bundle),
transparent_ptx_bundle,
r_vec,
);
let (_, _) = tx.execute().unwrap();
}

#[cfg(feature = "borsh")]
#[test]
fn test_halo2_transaction_borsh_serialize() {
Expand All @@ -358,7 +377,6 @@ pub mod testing {

let rng = OsRng;

// Create shielded partial tx bundle
let (shielded_ptx_bundle, r_vec) = create_shielded_ptx_bundle(2);
// TODO: add transparent_ptx_bundle test
let transparent_ptx_bundle = None;
Expand Down

0 comments on commit 7d9a13c

Please sign in to comment.