From 6c0ec699aa37eae412a8dd48d54cb740ae726d3b Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Mon, 4 Mar 2024 15:42:15 +0800 Subject: [PATCH] debug Signed-off-by: Eval EXEC --- .github/workflows/ci.yaml | 2 +- Makefile | 2 +- test/src/miner.rs | 13 ++++++++++++- test/src/spec/dao.rs | 6 +++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b54c1ff2..f200aec7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, macos-11 ] + os: [ ubuntu-latest ] steps: - uses: actions/checkout@v2 - name: Integration_Test diff --git a/Makefile b/Makefile index 7d2f86dd..7287bb67 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ ci: fmt clippy test security-audit check-crates check-licenses git diff --exit-code Cargo.lock integration: - bash devtools/ci/integration.sh v0.113.0 + bash devtools/ci/integration.sh v0.114.0-rc3 prod: ## Build binary with release profile. cargo build --release diff --git a/test/src/miner.rs b/test/src/miner.rs index c0bce25b..57cbd829 100644 --- a/test/src/miner.rs +++ b/test/src/miner.rs @@ -1,7 +1,8 @@ use crate::util::temp_dir; use ckb_app_config::BlockAssemblerConfig; -use ckb_jsonrpc_types::{BlockTemplate, ProposalShortId}; +use ckb_jsonrpc_types::{BlockTemplate, EpochNumberWithFraction, ProposalShortId}; use ckb_sdk::{Address, AddressPayload, CkbRpcClient, NetworkType}; +use ckb_types::core::EpochNumber; use ckb_types::{ core::BlockNumber, packed::{self}, @@ -48,6 +49,16 @@ impl Miner { .expect("RPC generate_block") } + pub fn generate_epochs(&self, num_epochs: u64, epoch_length: u64) -> EpochNumberWithFraction { + let epoch_number_with_fraction = + ckb_types::core::EpochNumberWithFraction::new(num_epochs, 0, epoch_length); + self.rpc + .lock() + .unwrap() + .generate_epochs(epoch_number_with_fraction.into()) + .expect("RPC generate_epoch") + } + pub fn generate_blocks(&self, count: u64) { log::info!("generating {} blocks...", count); (0..count).for_each(|_| { diff --git a/test/src/spec/dao.rs b/test/src/spec/dao.rs index a2717da5..180802ee 100644 --- a/test/src/spec/dao.rs +++ b/test/src/spec/dao.rs @@ -39,7 +39,7 @@ impl Spec for DaoPrepareOne { // Drive the chain until since mature and then withdraw setup .miner() - .generate_blocks(LOCK_PERIOD_EPOCHES * EPOCH_LENGTH); + .generate_epochs(LOCK_PERIOD_EPOCHES, EPOCH_LENGTH); let out_points = vec![new_out_point(prepare_tx_hash, 0)]; let _withdraw_tx_hash = withdraw(setup, &out_points); assert_eq!(deposited_capacity(setup), 0); @@ -89,7 +89,7 @@ impl Spec for DaoPrepareMultiple { // Drive the chain until since mature and then withdraw setup .miner() - .generate_blocks(LOCK_PERIOD_EPOCHES * EPOCH_LENGTH); + .generate_epochs(LOCK_PERIOD_EPOCHES, EPOCH_LENGTH); let out_points = (0..shannons.len()) .map(|i| new_out_point(&prepare_tx_hash, i)) .collect::>(); @@ -135,7 +135,7 @@ impl Spec for DaoWithdrawMultiple { // Drive the chain until since mature and then withdraw setup .miner() - .generate_blocks(LOCK_PERIOD_EPOCHES * EPOCH_LENGTH); + .generate_epochs(LOCK_PERIOD_EPOCHES, EPOCH_LENGTH); let out_points = prepare_tx_hashes .into_iter() .map(|hash| new_out_point(hash, 0))