Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ jobs:
- nightly-2025-12-11
steps:
- uses: actions/checkout@v5
- name: Install Ziren toolchain
run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ProjectZKM/toolchain/refs/heads/main/setup.sh | sh
- name: Install Dependencies
run: sudo apt update && sudo apt install protobuf-compiler
- name: Launch the Regtest
run: cd scripts && docker compose up -d
- name: Run all unit tests
run: cargo test -r --features tests --all-targets
run: |
set -e
source ~/.zkm-toolchain/env
cargo test -r --all --all-targets
6 changes: 2 additions & 4 deletions .github/workflows/ci_time_consuming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Time-consuming test

on:
push:
branches: ["main"]
branches: ["main", "dev"]
workflow_dispatch:

env:
Expand All @@ -18,6 +18,4 @@ jobs:
- run: |
set -e
export PATH=$HOME/.cargo/bin:$PATH
cargo test -r e2e_take_1 --features tests --features e2e-tests
cargo test -r e2e_take_2 --features tests --features e2e-tests
cargo test -r e2e_disprove --features tests --features e2e-tests
cargo test -r --all --features ci-tests -- --nocapture
4 changes: 4 additions & 0 deletions crates/bitvm2-ga/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ esplora-client = { workspace = true }
tokio = { workspace = true, features = ["full"] }
bitcoincore-rpc = "0.19"
bitcoin-old = { version = "0.31.2", package = "bitcoin" }

[features]
default = []
ci-tests = []
4 changes: 3 additions & 1 deletion crates/bitvm2-ga/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![allow(dead_code)]

#[cfg(test)]
#[cfg(feature = "ci-tests")]
mod tests {
use crate::{challenger::*, committee::*, keys::*, operator::*, types::*, watchtower::*};
use bitcoin::{
Expand Down Expand Up @@ -746,8 +747,9 @@ mod tests {

async fn merge_bank_utxo(esplora: &EsploraClient) {
// get_address_utxo may fail if there are too many UTXOs (e.g. 500), so we merge them before its too late
println!("merging bank UTXOs");
println!("merging bank UTXOs, network: {}", network());
let bank_address = node_p2wsh_address(network(), &bank_keypair().public_key().into());
println!("bank_address: {bank_address}");
let utxos = esplora.get_address_utxo(bank_address.clone()).await.unwrap();
if utxos.len() < 300 {
println!("bank UTXOs are not too many {}, no need to merge", utxos.len());
Expand Down
2 changes: 1 addition & 1 deletion crates/header-chain/src/mmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl MMRHost {
panic!("MMR is empty");
}
if self.nodes[0].len() <= index as usize {
panic!("Index {index} out of bounds {}", self.nodes[0].len());
panic!("Index out of bounds {}, index: {index}", self.nodes[0].len());
}
let mut proof: Vec<[u8; 32]> = vec![];
let mut current_index = index;
Expand Down
1 change: 1 addition & 0 deletions crates/store/src/ipfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ pub mod tests {
use super::*;

#[tokio::test]
#[ignore = "IPFS deprecated"]
async fn test_ipfs_add_and_get() {
println!("connecting to localhost:5001...");
let client = IPFS::new("http://44.229.236.82:5001");
Expand Down
6 changes: 1 addition & 5 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,4 @@ store = { workspace = true }
client = { workspace = true }
bitcoin-light-client-circuit = { workspace = true }
commit-chain = { workspace = true }
cbft-rpc = { workspace = true }
[features]
default = []
tests = []
e2e-tests = []
cbft-rpc = { workspace = true }
7 changes: 5 additions & 2 deletions scripts/bitcoin-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ $BTC loadwallet $WALLET_NAME

$BTC --rpcwallet=$WALLET_NAME walletpassphrase $WALLET_PASSPHRASE 600

address="bcrt1q7tr8sl50zanztcrps35hakqpe7gmfzedhhnxcspj7n0ks5lyrnhs6m8ewg"
#address="bcrt1q7tr8sl50zanztcrps35hakqpe7gmfzedhhnxcspj7n0ks5lyrnhs6m8ewg"
## For bitvm2-ga tests
address_bitvm2="bcrt1qhnmlpxyxdntekge4u24m4a7yk6elc3zs4v89e7fqja8vagfnrs8sq28cwd"
## fund the address
#$BTC --rpcwallet=$WALLET_NAME -generate 101
$BTC --rpcwallet=$WALLET_NAME sendtoaddress $address 20
#$BTC --rpcwallet=$WALLET_NAME sendtoaddress $address 20
$BTC --rpcwallet=$WALLET_NAME -regtest sendtoaddress $address_bitvm2 20

# Install watch
apt-get update
Expand Down
Loading