You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let query = "SELECT tenure_change, proposed_time, validation_time_ms FROM blocks WHERE consensus_hash = ?1 AND state = ?2 ORDER BY stacks_height DESC";
@@ -1191,6 +1170,29 @@ impl FromRow<PendingBlockValidation> for PendingBlockValidation {
1191
1170
}
1192
1171
}
1193
1172
1173
+
#[cfg(any(test, feature = "testing"))]
1174
+
implSignerDb{
1175
+
/// For tests, fetch all pending block validations
1176
+
pubfnget_all_pending_block_validations(
1177
+
&self,
1178
+
) -> Result<Vec<PendingBlockValidation>,DBError>{
1179
+
let qry = "SELECT signer_signature_hash, added_time FROM block_validations_pending ORDER BY added_time ASC";
1180
+
query_rows(&self.db, qry,params![])
1181
+
}
1182
+
1183
+
/// For tests, check if a pending block validation exists
1184
+
pubfnhas_pending_block_validation(
1185
+
&self,
1186
+
sighash:&Sha512Trunc256Sum,
1187
+
) -> Result<bool,DBError>{
1188
+
let qry = "SELECT signer_signature_hash FROM block_validations_pending WHERE signer_signature_hash = ?1";
1189
+
let args = params![sighash.to_string()];
1190
+
let sighash_opt:Option<String> = query_row(&self.db, qry, args)?;
0 commit comments