Skip to content

Commit

Permalink
test: Set proving capability to SingleProof
Browse files Browse the repository at this point in the history
Fixes tests that otherwise fail on weak systems because:
 - on such systems, the proving capability is estimated at
   something below `SingleProof`;
 - as a result, the miner cannot merge transactions;
 - leading to a panic crash.

The fix is to specify the `SingleProof` proving capability. Weak
machines running the tests rely on proof servers. In all cases,
the thing being tested is unrelated to the (not yet and maybe
never) implemented use-`ProofCollection`-instead-of-`SingleProof`
functionality.
  • Loading branch information
aszepieniec committed Oct 13, 2024
1 parent 2b61840 commit a3fd237
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/models/state/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,12 +652,13 @@ mod tests {
let in_seven_months = now + Timestamp::months(7);
let in_eight_months = now + Timestamp::months(8);
let (tx_by_bob, maybe_change_output) = bob
.create_transaction(
.create_transaction_with_prover_capability(
utxos_from_bob.clone(),
bob_spending_key.into(),
UtxoNotificationMedium::OnChain,
NeptuneCoins::new(1),
in_seven_months,
TxProvingCapability::SingleProof,
)
.await
.unwrap();
Expand All @@ -684,12 +685,13 @@ mod tests {
alice_address.into(),
)];
let (tx_from_alice_original, _maybe_change_output) = alice
.create_transaction(
.create_transaction_with_prover_capability(
utxos_from_alice.into(),
alice_spending_key.into(),
UtxoNotificationMedium::OffChain,
NeptuneCoins::new(1),
in_seven_months,
TxProvingCapability::SingleProof,
)
.await
.unwrap();
Expand Down
8 changes: 5 additions & 3 deletions src/models/state/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ mod wallet_tests {

#[traced_test]
#[tokio::test]
async fn wallet_state_maintanence_multiple_inputs_outputs_test() {
async fn wallet_state_maintenence_multiple_inputs_outputs_test() {
// Bob is premine receiver, Alice is not. They send coins back and forth
// and the blockchain forks.

Expand Down Expand Up @@ -903,12 +903,13 @@ mod wallet_tests {
let receiver_data_to_alice: TxOutputList =
vec![receiver_data_12_to_alice, receiver_data_1_to_alice].into();
let (tx, _change_output) = bob
.create_transaction(
.create_transaction_with_prover_capability(
receiver_data_to_alice.clone(),
bob_wallet.nth_generation_spending_key_for_tests(0).into(),
UtxoNotificationMedium::OnChain,
NeptuneCoins::new(2),
in_seven_months,
TxProvingCapability::SingleProof,
)
.await
.unwrap();
Expand Down Expand Up @@ -1172,12 +1173,13 @@ mod wallet_tests {
);

let (tx_from_bob, _maybe_change_output) = bob
.create_transaction(
.create_transaction_with_prover_capability(
vec![receiver_data_1_to_alice_new.clone()].into(),
bob_wallet.nth_generation_spending_key_for_tests(0).into(),
UtxoNotificationMedium::OffChain,
NeptuneCoins::new(4),
in_seven_months,
TxProvingCapability::SingleProof,
)
.await
.unwrap();
Expand Down

0 comments on commit a3fd237

Please sign in to comment.