Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
Signed-off-by: Eval EXEC <execvy@gmail.com>
  • Loading branch information
eval-exec committed Mar 4, 2024
1 parent e8786eb commit 6c0ec69
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion test/src/miner.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down Expand Up @@ -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(|_| {
Expand Down
6 changes: 3 additions & 3 deletions test/src/spec/dao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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::<Vec<_>>();
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 6c0ec69

Please sign in to comment.