Skip to content

Commit fbdc909

Browse files
committed
finished debugging staging in chain_generic darkside
1 parent 98851eb commit fbdc909

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

darkside-tests/src/chain_generics.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,20 @@ pub(crate) mod conduct_chain {
125125
.unwrap();
126126

127127
self.darkside_connector
128-
.stage_blocks_create(height_before as i32 + 1, blocks_to_add - 1, 0)
128+
.stage_blocks_create(height_before as i32 + 1, blocks_to_add, 0)
129129
.await
130130
.unwrap();
131131

132+
let new_height = (height_before as i32 + blocks_to_add) as u64;
133+
132134
loop {
133135
let maybe_raw_tx = streamed_raw_txns.message().await.unwrap();
134136
match maybe_raw_tx {
135137
None => break,
136138
Some(raw_tx) => {
137139
// increase chain height
138140
self.darkside_connector
139-
.stage_transactions_stream(vec![(
140-
raw_tx.data.clone(),
141-
u64::from(self.staged_blockheight),
142-
)])
141+
.stage_transactions_stream(vec![(raw_tx.data.clone(), new_height)])
143142
.await
144143
.unwrap();
145144

@@ -171,8 +170,6 @@ pub(crate) mod conduct_chain {
171170
}
172171
}
173172

174-
let new_height = height_before + 1;
175-
176173
//trees
177174
let mut sapling_tree_bytes = vec![];
178175
zcash_primitives::merkle_tree::write_commitment_tree(
@@ -187,7 +184,7 @@ pub(crate) mod conduct_chain {
187184
)
188185
.unwrap();
189186
let new_tree_state = TreeState {
190-
height: new_height,
187+
height: new_height as u64,
191188
sapling_tree: hex::encode(sapling_tree_bytes),
192189
orchard_tree: hex::encode(orchard_tree_bytes),
193190
network: crate::constants::first_tree_state().network,
@@ -200,7 +197,7 @@ pub(crate) mod conduct_chain {
200197
.unwrap();
201198

202199
self.darkside_connector
203-
.apply_staged(height_before as i32 + blocks_to_add)
200+
.apply_staged(new_height as i32)
204201
.await
205202
.unwrap();
206203
}

0 commit comments

Comments
 (0)