Remove redundant qualifier

This commit is contained in:
Franck Royer 2021-01-29 17:06:14 +11:00
parent 99e34bfc6b
commit 9ccb0492ce
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
11 changed files with 28 additions and 28 deletions

View File

@ -160,7 +160,7 @@ jobs:
key: rust-${{ env.TARGET }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}-v1
- name: Run test ${{ matrix.test_name }}
run: cargo test --package swap --all-features --lib tests::${{ matrix.test_name }} ""
run: cargo test --package swap --all-features --lib tests::${{ matrix.test_name }}
env:
MONERO_ADDITIONAL_SLEEP_PERIOD: 60000
RUST_MIN_STACK: 16777216 # 16 MB. Default is 8MB. This is fine as in tests we start 2 programs: Alice and Bob.

View File

@ -1,15 +1,15 @@
use crate::{
protocol::{alice, bob},
tests::testutils,
tests::utils,
};
use testutils::SlowCancelConfig;
use tokio::join;
use utils::SlowCancelConfig;
/// Run the following tests with RUST_MIN_STACK=10000000
#[tokio::test]
async fn happy_path() {
testutils::setup_test(SlowCancelConfig, |mut ctx| async move {
utils::setup_test(SlowCancelConfig, |mut ctx| async move {
let (alice_swap, _) = ctx.new_swap_as_alice().await;
let (bob_swap, _) = ctx.new_swap_as_bob().await;

View File

@ -1,12 +1,12 @@
use crate::{
protocol::{alice, alice::AliceState, bob},
tests::testutils,
tests::utils,
};
use testutils::{alice_run_until::is_encsig_learned, SlowCancelConfig};
use utils::{alice_run_until::is_encsig_learned, SlowCancelConfig};
#[tokio::test]
async fn given_alice_restarts_after_encsig_is_learned_resume_swap() {
testutils::setup_test(SlowCancelConfig, |mut ctx| async move {
utils::setup_test(SlowCancelConfig, |mut ctx| async move {
let (alice_swap, alice_join_handle) = ctx.new_swap_as_alice().await;
let (bob_swap, _) = ctx.new_swap_as_bob().await;

View File

@ -1,12 +1,12 @@
use crate::{
protocol::{alice, bob, bob::BobState},
tests::testutils,
tests::utils,
};
use testutils::{bob_run_until::is_encsig_sent, SlowCancelConfig};
use utils::{bob_run_until::is_encsig_sent, SlowCancelConfig};
#[tokio::test]
async fn given_bob_restarts_after_encsig_is_sent_resume_swap() {
testutils::setup_test(SlowCancelConfig, |mut ctx| async move {
utils::setup_test(SlowCancelConfig, |mut ctx| async move {
let (alice_swap, _) = ctx.new_swap_as_alice().await;
let (bob_swap, bob_join_handle) = ctx.new_swap_as_bob().await;

View File

@ -1,12 +1,12 @@
use crate::{
protocol::{alice, bob, bob::BobState},
tests::testutils,
tests::utils,
};
use testutils::{bob_run_until::is_lock_proof_received, SlowCancelConfig};
use utils::{bob_run_until::is_lock_proof_received, SlowCancelConfig};
#[tokio::test]
async fn given_bob_restarts_after_lock_proof_received_resume_swap() {
testutils::setup_test(SlowCancelConfig, |mut ctx| async move {
utils::setup_test(SlowCancelConfig, |mut ctx| async move {
let (alice_swap, _) = ctx.new_swap_as_alice().await;
let (bob_swap, bob_join_handle) = ctx.new_swap_as_bob().await;

View File

@ -1,12 +1,12 @@
use crate::{
protocol::{alice, bob, bob::BobState},
tests::testutils,
tests::utils,
};
use testutils::{bob_run_until::is_xmr_locked, SlowCancelConfig};
use utils::{bob_run_until::is_xmr_locked, SlowCancelConfig};
#[tokio::test]
async fn given_bob_restarts_after_xmr_is_locked_resume_swap() {
testutils::setup_test(SlowCancelConfig, |mut ctx| async move {
utils::setup_test(SlowCancelConfig, |mut ctx| async move {
let (alice_swap, _) = ctx.new_swap_as_alice().await;
let (bob_swap, bob_join_handle) = ctx.new_swap_as_bob().await;

View File

@ -6,4 +6,4 @@ mod happy_path_restart_bob_before_comm;
mod punish;
mod refund_restart_alice;
mod refund_restart_alice_cancelled;
pub mod testutils;
pub mod utils;

View File

@ -1,14 +1,14 @@
use crate::{
protocol::{alice, bob, bob::BobState},
tests::testutils,
tests::utils,
};
use testutils::{bob_run_until::is_btc_locked, FastPunishConfig};
use utils::{bob_run_until::is_btc_locked, FastPunishConfig};
/// Bob locks Btc and Alice locks Xmr. Bob does not act; he fails to send Alice
/// the encsig and fail to refund or redeem. Alice punishes.
#[tokio::test]
async fn alice_punishes_if_bob_never_acts_after_fund() {
testutils::setup_test(FastPunishConfig, |mut ctx| async move {
utils::setup_test(FastPunishConfig, |mut ctx| async move {
let (alice_swap, _) = ctx.new_swap_as_alice().await;
let (bob_swap, bob_join_handle) = ctx.new_swap_as_bob().await;

View File

@ -1,14 +1,14 @@
use crate::{
protocol::{alice, alice::AliceState, bob},
tests::testutils,
tests::utils,
};
use testutils::{alice_run_until::is_xmr_locked, FastCancelConfig};
use utils::{alice_run_until::is_xmr_locked, FastCancelConfig};
/// Bob locks btc and Alice locks xmr. Alice fails to act so Bob refunds. Alice
/// then also refunds.
#[tokio::test]
async fn given_alice_restarts_after_xmr_is_locked_refund_swap() {
testutils::setup_test(FastCancelConfig, |mut ctx| async move {
utils::setup_test(FastCancelConfig, |mut ctx| async move {
let (alice_swap, alice_join_handle) = ctx.new_swap_as_alice().await;
let (bob_swap, _) = ctx.new_swap_as_bob().await;

View File

@ -1,16 +1,16 @@
use crate::{
config,
protocol::{alice, alice::AliceState, bob},
tests::testutils,
tests::utils,
};
use testutils::alice_run_until::is_encsig_learned;
use utils::alice_run_until::is_encsig_learned;
/// Bob locks btc and Alice locks xmr. Alice fails to act so Bob refunds. Alice
/// is forced to refund even though she learned the secret and would be able to
/// redeem had the timelock not expired.
#[tokio::test]
async fn given_alice_restarts_after_enc_sig_learned_and_bob_already_cancelled_refund_swap() {
testutils::setup_test(config::Regtest, |mut ctx| async move {
utils::setup_test(config::Regtest, |mut ctx| async move {
let (alice_swap, alice_join_handle) = ctx.new_swap_as_alice().await;
let (bob_swap, _) = ctx.new_swap_as_bob().await;

View File

@ -6,7 +6,7 @@ use crate::{
monero,
protocol::{alice, alice::AliceState, bob, bob::BobState, SwapAmounts},
seed::Seed,
tests::testutils,
tests::utils,
};
use bitcoin_harness::Bitcoind;
use futures::Future;
@ -316,7 +316,7 @@ where
let config = C::get_config();
let (monero, containers) = testutils::init_containers(&cli).await;
let (monero, containers) = utils::init_containers(&cli).await;
let swap_amounts = SwapAmounts {
btc: bitcoin::Amount::from_sat(1_000_000),