From 4a242d69e435b4faf0f05767967ad77b24d03f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoe=20Faltib=C3=A0?= Date: Wed, 11 Sep 2024 11:57:39 +0200 Subject: [PATCH 1/4] tapret_wlt_receiving_opret: de-ignore and improve to show bug --- tests/transfers.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/transfers.rs b/tests/transfers.rs index 4a0efa4..08187f1 100644 --- a/tests/transfers.rs +++ b/tests/transfers.rs @@ -736,7 +736,6 @@ fn mainnet_wlt_receiving_test_asset() { } #[test] -#[ignore = "this was working, fix needed"] fn tapret_wlt_receiving_opret() { initialize(); @@ -776,4 +775,26 @@ fn tapret_wlt_receiving_opret() { 1000, None, ); + + println!("4th transfer"); + wlt_2.send( + &mut wlt_1, + TransferType::Blinded, + contract_id, + &iface_type_name, + 560, + 1000, + None, + ); + + println!("5th transfer"); + wlt_1.send( + &mut wlt_2, + TransferType::Blinded, + contract_id, + &iface_type_name, + 600, + 1000, + None, + ); } From a36e7fc52d7fdc6812af588fa1dca1eea41b7d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoe=20Faltib=C3=A0?= Date: Wed, 25 Sep 2024 15:44:24 +0200 Subject: [PATCH 2/4] try rgb-std PR #272 --- rgb-std | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rgb-std b/rgb-std index 94aeb57..fc20101 160000 --- a/rgb-std +++ b/rgb-std @@ -1 +1 @@ -Subproject commit 94aeb57a3db7dfe89b8c03bd4a90a8eabae09ff3 +Subproject commit fc20101b8f947089a2d3a0740d77976b122330f2 From 829c9bb48bbbfef23a14d755da3ac1e41fa0bbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoe=20Faltib=C3=A0?= Date: Thu, 26 Sep 2024 11:12:42 +0200 Subject: [PATCH 3/4] add assertions on consignments --- tests/transfers.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/transfers.rs b/tests/transfers.rs index 08187f1..ed695d0 100644 --- a/tests/transfers.rs +++ b/tests/transfers.rs @@ -745,7 +745,7 @@ fn tapret_wlt_receiving_opret() { let (contract_id, iface_type_name) = wlt_1.issue_nia(600, wlt_1.close_method(), None); println!("1st transfer"); - wlt_1.send( + let (consignment, _) = wlt_1.send( &mut wlt_2, TransferType::Blinded, contract_id, @@ -754,6 +754,8 @@ fn tapret_wlt_receiving_opret() { 5000, None, ); + assert_eq!(consignment.bundles.len(), 1); + assert_eq!(consignment.terminals.len(), 1); println!("2nd transfer"); let invoice = wlt_1.invoice( @@ -763,10 +765,12 @@ fn tapret_wlt_receiving_opret() { CloseMethod::OpretFirst, InvoiceType::Witness, ); - wlt_2.send_to_invoice(&mut wlt_1, invoice, None, None, None); + let (consignment, _) = wlt_2.send_to_invoice(&mut wlt_1, invoice, None, None, None); + assert_eq!(consignment.bundles.len(), 2); + assert_eq!(consignment.terminals.len(), 0); println!("3rd transfer"); - wlt_1.send( + let (consignment, _) = wlt_1.send( &mut wlt_2, TransferType::Blinded, contract_id, @@ -775,7 +779,10 @@ fn tapret_wlt_receiving_opret() { 1000, None, ); + assert_eq!(consignment.bundles.len(), 0); + assert_eq!(consignment.terminals.len(), 0); + /* println!("4th transfer"); wlt_2.send( &mut wlt_1, @@ -797,4 +804,5 @@ fn tapret_wlt_receiving_opret() { 1000, None, ); + */ } From ced73212eb3ef3b01c28e1b2bd8374b1c9d915a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoe=20Faltib=C3=A0?= Date: Mon, 30 Sep 2024 11:41:39 +0200 Subject: [PATCH 4/4] CI: add test_tapret_wlt_receiving_opret job --- .github/workflows/checks.yml | 54 ++++-------------------------------- 1 file changed, 5 insertions(+), 49 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2d67a69..de40a64 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,61 +10,17 @@ env: CARGO_TERM_COLOR: always jobs: - lint: + test_tapret_wlt_receiving_opret: runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: clippy - - name: Lint - run: cargo clippy --all-targets -- -D warnings - - format: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: rustfmt - - name: Format - run: cargo fmt --all -- --check - - test_and_coverage: - runs-on: ubuntu-latest - + timeout-minutes: 100 steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: true - - name: Setup rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: llvm-tools-preview - toolchain: stable - - - name: Install llvm-cov - env: - LLVM_COV_RELEASES: https://github.com/taiki-e/cargo-llvm-cov/releases + - name: Run tapret_wlt_receiving_opret test 100 times run: | - host=$(rustc -Vv | grep host | sed 's/host: //') - curl -fsSL $LLVM_COV_RELEASES/latest/download/cargo-llvm-cov-$host.tar.gz | tar xzf - -C "$HOME/.cargo/bin" - - - name: Test and generate coverage report - run: | - INDEXER=esplora cargo llvm-cov --output-path coverage.lcov - INDEXER=electrum cargo llvm-cov --no-clean --output-path coverage.lcov - - - name: Upload coverage report - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - file: coverage.lcov - flags: rust - token: ${{ secrets.CODECOV_TOKEN }} + cargo test --test transfers tapret_wlt_receiving_opret + for i in $(seq 1 100); do echo "run $i"; SKIP_INIT=1 cargo test --test transfers tapret_wlt_receiving_opret || break; done