Skip to content
Closed
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
60 changes: 28 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ tera = "1"
thiserror = "1.0.22"
time = "0.3.36"
tiny-keccak = "2.0"
tokio = "1.35.0"
tokio = "1.49.0"
tokio-util = "0.7.8"
toml = "0.5"
torut = "0.2.1"
Expand Down
14 changes: 8 additions & 6 deletions test/src/specs/tx_pool/orphan_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ use ckb_types::{
const ALWAYS_SUCCESS_SCRIPT_CYCLE: u64 = 537;
// always_failure, as the name implies, so it doesn't matter what the cycles are
const ALWAYS_FAILURE_SCRIPT_CYCLE: u64 = 1000;
// Timeout in seconds for waiting for transactions to be processed into tx pool
const ORPHAN_TX_WAIT_TIMEOUT: u64 = 10;

pub struct OrphanTxAccepted;

Expand All @@ -38,7 +40,7 @@ impl Spec for OrphanTxAccepted {
let child_tx = node0.new_transaction(parent_tx.hash());

relay_tx(&net, node0, child_tx, ALWAYS_SUCCESS_SCRIPT_CYCLE);
let result = wait_until(5, || {
let result = wait_until(ORPHAN_TX_WAIT_TIMEOUT, || {
let tx_pool_info = node0.get_tip_tx_pool_info();
tx_pool_info.orphan.value() == 1 && tx_pool_info.pending.value() == 0
});
Expand All @@ -48,7 +50,7 @@ impl Spec for OrphanTxAccepted {
);

relay_tx(&net, node0, parent_tx, ALWAYS_SUCCESS_SCRIPT_CYCLE);
let result = wait_until(5, || {
let result = wait_until(ORPHAN_TX_WAIT_TIMEOUT, || {
let tx_pool_info = node0.get_tip_tx_pool_info();
tx_pool_info.orphan.value() == 0 && tx_pool_info.pending.value() == 2
});
Expand Down Expand Up @@ -80,7 +82,7 @@ impl Spec for OrphanTxRejected {
let child_hash = child_tx.hash();

relay_tx(&net, node0, child_tx, ALWAYS_FAILURE_SCRIPT_CYCLE);
let result = wait_until(5, || {
let result = wait_until(ORPHAN_TX_WAIT_TIMEOUT, || {
let tx_pool_info = node0.get_tip_tx_pool_info();
tx_pool_info.orphan.value() == 1 && tx_pool_info.pending.value() == 0
});
Expand All @@ -90,7 +92,7 @@ impl Spec for OrphanTxRejected {
);

relay_tx(&net, node0, parent_tx, ALWAYS_SUCCESS_SCRIPT_CYCLE);
let result = wait_until(5, || {
let result = wait_until(ORPHAN_TX_WAIT_TIMEOUT, || {
let tx_pool_info = node0.get_tip_tx_pool_info();
tx_pool_info.orphan.value() == 0 && tx_pool_info.pending.value() == 1
});
Expand Down Expand Up @@ -191,7 +193,7 @@ fn run_replay_tx(
) -> bool {
relay_tx(net, node0, tx, ALWAYS_SUCCESS_SCRIPT_CYCLE);

wait_until(5, || {
wait_until(ORPHAN_TX_WAIT_TIMEOUT, || {
let tx_pool_info = node0.get_tip_tx_pool_info();
tx_pool_info.orphan.value() == orphan_tx_cnt && tx_pool_info.pending.value() == pending_cnt
})
Expand All @@ -206,7 +208,7 @@ fn run_send_tx(
) -> bool {
send_tx(net, node0, tx, ALWAYS_SUCCESS_SCRIPT_CYCLE);

wait_until(5, || {
wait_until(ORPHAN_TX_WAIT_TIMEOUT, || {
let tx_pool_info = node0.get_tip_tx_pool_info();
tx_pool_info.orphan.value() == orphan_tx_cnt && tx_pool_info.pending.value() == pending_cnt
})
Expand Down
Loading