|
|
@@ -133,12 +133,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Faucet] Executing Alice token mint tx");
|
|
|
info!(target: "money", "[Faucet] =============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.faucet
|
|
|
+ let erroneous_txs = th
|
|
|
+ .faucet
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alice_mint_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(alice_params.output.coin.inner()));
|
|
|
mint_verify_times.push(timer.elapsed());
|
|
|
|
|
|
@@ -146,12 +148,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Faucet] Executing Bob token mint tx");
|
|
|
info!(target: "money", "[Faucet] ===========================");
|
|
|
let timer = Instant::now();
|
|
|
- th.faucet
|
|
|
+ let erroneous_txs = th
|
|
|
+ .faucet
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[bob_mint_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(bob_params.output.coin.inner()));
|
|
|
mint_verify_times.push(timer.elapsed());
|
|
|
|
|
|
@@ -159,12 +163,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Alice] Executing Alice token mint tx");
|
|
|
info!(target: "money", "[Alice] =============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.alice
|
|
|
+ let erroneous_txs = th
|
|
|
+ .alice
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alice_mint_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(alice_params.output.coin.inner()));
|
|
|
// Alice has to witness this coin because it's hers.
|
|
|
let alice_leaf_pos = th.alice.merkle_tree.witness().unwrap();
|
|
|
@@ -174,12 +180,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Alice] Executing Bob token mint tx");
|
|
|
info!(target: "money", "[Alice] ===========================");
|
|
|
let timer = Instant::now();
|
|
|
- th.alice
|
|
|
+ let erroneous_txs = th
|
|
|
+ .alice
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[bob_mint_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(bob_params.output.coin.inner()));
|
|
|
mint_verify_times.push(timer.elapsed());
|
|
|
|
|
|
@@ -187,12 +195,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Bob] Executing Alice token mint tx");
|
|
|
info!(target: "money", "[Bob] =============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.bob
|
|
|
+ let erroneous_txs = th
|
|
|
+ .bob
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alice_mint_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(alice_params.output.coin.inner()));
|
|
|
mint_verify_times.push(timer.elapsed());
|
|
|
|
|
|
@@ -200,12 +210,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Bob] Executing Bob token mint tx");
|
|
|
info!(target: "money", "[Bob] ===========================");
|
|
|
let timer = Instant::now();
|
|
|
- th.bob
|
|
|
+ let erroneous_txs = th
|
|
|
+ .bob
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[bob_mint_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(bob_params.output.coin.inner()));
|
|
|
let bob_leaf_pos = th.bob.merkle_tree.witness().unwrap();
|
|
|
mint_verify_times.push(timer.elapsed());
|
|
|
@@ -299,12 +311,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Faucet] Executing Alice2Bob payment tx");
|
|
|
info!(target: "money", "[Faucet] ==============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.faucet
|
|
|
+ let erroneous_txs = th
|
|
|
+ .faucet
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alice2bob_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(alice2bob_params.outputs[0].coin.inner()));
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(alice2bob_params.outputs[1].coin.inner()));
|
|
|
transfer_verify_times.push(timer.elapsed());
|
|
|
@@ -313,12 +327,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Alice] Executing Alice2Bob payment tx");
|
|
|
info!(target: "money", "[Alice] ==============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.alice
|
|
|
+ let erroneous_txs = th
|
|
|
+ .alice
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alice2bob_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(alice2bob_params.outputs[0].coin.inner()));
|
|
|
let alice_leaf_pos = th.alice.merkle_tree.witness().unwrap();
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(alice2bob_params.outputs[1].coin.inner()));
|
|
|
@@ -328,12 +344,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Bob] Executing Alice2Bob payment tx");
|
|
|
info!(target: "money", "[Bob] ==============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.bob
|
|
|
+ let erroneous_txs = th
|
|
|
+ .bob
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alice2bob_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(alice2bob_params.outputs[0].coin.inner()));
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(alice2bob_params.outputs[1].coin.inner()));
|
|
|
let bob_leaf_pos = th.bob.merkle_tree.witness().unwrap();
|
|
|
@@ -431,12 +449,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Faucet] Executing Bob2Alice payment tx");
|
|
|
info!(target: "money", "[Faucet] ==============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.faucet
|
|
|
+ let erroneous_txs = th
|
|
|
+ .faucet
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[bob2alice_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(bob2alice_params.outputs[0].coin.inner()));
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(bob2alice_params.outputs[1].coin.inner()));
|
|
|
transfer_verify_times.push(timer.elapsed());
|
|
|
@@ -445,12 +465,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Alice] Executing Bob2Alice payment tx");
|
|
|
info!(target: "money", "[Alice] ==============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.alice
|
|
|
+ let erroneous_txs = th
|
|
|
+ .alice
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[bob2alice_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(bob2alice_params.outputs[0].coin.inner()));
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(bob2alice_params.outputs[1].coin.inner()));
|
|
|
let alice_leaf_pos = th.alice.merkle_tree.witness().unwrap();
|
|
|
@@ -460,12 +482,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Bob] Executing Bob2Alice payment tx");
|
|
|
info!(target: "money", "[Bob] ==================+===========");
|
|
|
let timer = Instant::now();
|
|
|
- th.bob
|
|
|
+ let erroneous_txs = th
|
|
|
+ .bob
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[bob2alice_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(bob2alice_params.outputs[0].coin.inner()));
|
|
|
let bob_leaf_pos = th.bob.merkle_tree.witness().unwrap();
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(bob2alice_params.outputs[1].coin.inner()));
|
|
|
@@ -622,12 +646,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Faucet] Executing AliceBob swap tx");
|
|
|
info!(target: "money", "[Faucet] ==========================");
|
|
|
let timer = Instant::now();
|
|
|
- th.faucet
|
|
|
+ let erroneous_txs = th
|
|
|
+ .faucet
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alicebob_swap_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[0].coin.inner()));
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[1].coin.inner()));
|
|
|
swap_verify_times.push(timer.elapsed());
|
|
|
@@ -636,12 +662,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Alice] Executing AliceBob swap tx");
|
|
|
info!(target: "money", "[Alice] ==========================");
|
|
|
let timer = Instant::now();
|
|
|
- th.alice
|
|
|
+ let erroneous_txs = th
|
|
|
+ .alice
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alicebob_swap_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[0].coin.inner()));
|
|
|
let alice_leaf_pos = th.alice.merkle_tree.witness().unwrap();
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[1].coin.inner()));
|
|
|
@@ -651,12 +679,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Bob] Executing AliceBob swap tx");
|
|
|
info!(target: "money", "[Bob] ==========================");
|
|
|
let timer = Instant::now();
|
|
|
- th.bob
|
|
|
+ let erroneous_txs = th
|
|
|
+ .bob
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alicebob_swap_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[0].coin.inner()));
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[1].coin.inner()));
|
|
|
let bob_leaf_pos = th.bob.merkle_tree.witness().unwrap();
|
|
|
@@ -758,12 +788,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Faucet] Executing Alice2Alice payment tx");
|
|
|
info!(target: "money", "[Faucet] ================================");
|
|
|
let timer = Instant::now();
|
|
|
- th.faucet
|
|
|
+ let erroneous_txs = th
|
|
|
+ .faucet
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alice2alice_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(alice2alice_params.outputs[0].coin.inner()));
|
|
|
transfer_verify_times.push(timer.elapsed());
|
|
|
|
|
|
@@ -771,12 +803,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Alice] Executing Alice2Alice payment tx");
|
|
|
info!(target: "money", "[Alice] ================================");
|
|
|
let timer = Instant::now();
|
|
|
- th.alice
|
|
|
+ let erroneous_txs = th
|
|
|
+ .alice
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alice2alice_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(alice2alice_params.outputs[0].coin.inner()));
|
|
|
let alice_leaf_pos = th.alice.merkle_tree.witness().unwrap();
|
|
|
transfer_verify_times.push(timer.elapsed());
|
|
|
@@ -785,12 +819,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Bob] Executing Alice2Alice payment tx");
|
|
|
info!(target: "money", "[Bob] ================================");
|
|
|
let timer = Instant::now();
|
|
|
- th.bob
|
|
|
+ let erroneous_txs = th
|
|
|
+ .bob
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alice2alice_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(alice2alice_params.outputs[0].coin.inner()));
|
|
|
transfer_verify_times.push(timer.elapsed());
|
|
|
|
|
|
@@ -875,12 +911,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Faucet] Executing Bob2Bob payment tx");
|
|
|
info!(target: "money", "[Faucet] ============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.faucet
|
|
|
+ let erroneous_txs = th
|
|
|
+ .faucet
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[bob2bob_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(bob2bob_params.outputs[0].coin.inner()));
|
|
|
transfer_verify_times.push(timer.elapsed());
|
|
|
|
|
|
@@ -888,12 +926,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Alice] Executing Bob2Bob payment tx");
|
|
|
info!(target: "money", "[Alice] ============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.alice
|
|
|
+ let erroneous_txs = th
|
|
|
+ .alice
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[bob2bob_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(bob2bob_params.outputs[0].coin.inner()));
|
|
|
transfer_verify_times.push(timer.elapsed());
|
|
|
|
|
|
@@ -901,12 +941,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Bob] Executing Bob2Bob payment tx");
|
|
|
info!(target: "money", "[Bob] ============================");
|
|
|
let timer = Instant::now();
|
|
|
- th.bob
|
|
|
+ let erroneous_txs = th
|
|
|
+ .bob
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[bob2bob_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(bob2bob_params.outputs[0].coin.inner()));
|
|
|
let bob_leaf_pos = th.bob.merkle_tree.witness().unwrap();
|
|
|
transfer_verify_times.push(timer.elapsed());
|
|
|
@@ -1040,12 +1082,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Faucet] Executing AliceBob swap tx");
|
|
|
info!(target: "money", "[Faucet] ==========================");
|
|
|
let timer = Instant::now();
|
|
|
- th.faucet
|
|
|
+ let erroneous_txs = th
|
|
|
+ .faucet
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alicebob_swap_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[0].coin.inner()));
|
|
|
th.faucet.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[1].coin.inner()));
|
|
|
swap_verify_times.push(timer.elapsed());
|
|
|
@@ -1054,12 +1098,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Alice] Executing AliceBob swap tx");
|
|
|
info!(target: "money", "[Alice] ==========================");
|
|
|
let timer = Instant::now();
|
|
|
- th.alice
|
|
|
+ let erroneous_txs = th
|
|
|
+ .alice
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alicebob_swap_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[0].coin.inner()));
|
|
|
let alice_leaf_pos = th.alice.merkle_tree.witness().unwrap();
|
|
|
th.alice.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[1].coin.inner()));
|
|
|
@@ -1069,12 +1115,14 @@ async fn money_contract_transfer() -> Result<()> {
|
|
|
info!(target: "money", "[Bob] Executing AliceBob swap tx");
|
|
|
info!(target: "money", "[Bob] ==========================");
|
|
|
let timer = Instant::now();
|
|
|
- th.bob
|
|
|
+ let erroneous_txs = th
|
|
|
+ .bob
|
|
|
.state
|
|
|
.read()
|
|
|
.await
|
|
|
.verify_transactions(&[alicebob_swap_tx.clone()], current_slot, true)
|
|
|
.await?;
|
|
|
+ assert!(erroneous_txs.is_empty());
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[0].coin.inner()));
|
|
|
th.bob.merkle_tree.append(&MerkleNode::from(swap_full_params.outputs[1].coin.inner()));
|
|
|
let bob_leaf_pos = th.bob.merkle_tree.witness().unwrap();
|