Skip to content

Commit 84438c0

Browse files
committed
test: keep ckb config compatible in integration
1 parent a6c697e commit 84438c0

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

test/src/setup.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ impl Setup {
171171
spec.modify_ckb_toml(&mut ckb_toml);
172172

173173
let mut value = toml::Value::try_from(&ckb_toml).unwrap();
174+
if let Some(network) = value.get_mut("network").and_then(|v| v.as_table_mut()) {
175+
network.remove("onion");
176+
network.remove("proxy");
177+
}
178+
if let Some(tx_pool) = value.get_mut("tx_pool").and_then(|v| v.as_table_mut()) {
179+
tx_pool.remove("max_tx_verify_workers");
180+
}
174181
value["rpc"]["modules"]
175182
.as_array_mut()
176183
.unwrap()

test/src/spec/deploy_info_ordering.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ use tempfile::tempdir;
99

1010
pub struct DeployInfoOrdering;
1111

12+
fn h256_from_u64_be(value: u64) -> H256 {
13+
let mut bytes = [0u8; 32];
14+
bytes[24..32].copy_from_slice(&value.to_be_bytes());
15+
H256::from_slice(&bytes).expect("H256 from slice")
16+
}
17+
1218
impl Spec for DeployInfoOrdering {
1319
fn run(&self, setup: &mut Setup) {
1420
let temp_dir = tempdir().expect("create tempdir failed");
@@ -69,10 +75,10 @@ threshold = 1
6975
let sample_tx = used_input_txs.values().next().cloned().unwrap();
7076
let mut reordered_map = Map::new();
7177
let extra_keys = vec![
72-
H256::from_low_u64_be(3),
73-
H256::from_low_u64_be(1),
74-
H256::from_low_u64_be(4),
75-
H256::from_low_u64_be(2),
78+
h256_from_u64_be(3),
79+
h256_from_u64_be(1),
80+
h256_from_u64_be(4),
81+
h256_from_u64_be(2),
7682
];
7783
for key in &extra_keys {
7884
reordered_map.insert(format!("{:#x}", key), sample_tx.clone());

0 commit comments

Comments
 (0)