0.3.15-pre.013
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime_resources.rs
|
||||
// version: 38
|
||||
// version: 39
|
||||
|
||||
fn grpc_endpoint(cluster: &str) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneGrpcEndpointSettings> {
|
||||
return grpc_endpoint_with_identity(cluster, "yellowstone-fixture", "fixture-provider");
|
||||
@@ -879,7 +879,31 @@ async fn pre_009_yellowstone_block_mode_uses_get_block_without_transaction_hydra
|
||||
std::result::Result::Err(_) => return,
|
||||
};
|
||||
assert_eq!(source.mode, super::RawTransactionIngestYellowstoneMode::BlockHydration);
|
||||
assert!(!source.uses_transaction_hydration());
|
||||
assert!(super::RawTransactionIngestLiveSource::Yellowstone(source).uses_hydration());
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_15_pre_013_yellowstone_block_hydration_coordinator_is_bounded_before_http_work() {
|
||||
let (sender, receiver) = tokio::sync::watch::channel(crate::RawTransactionIngestProcessingFrontierProjection::empty());
|
||||
let mut processing_frontier = super::RawTransactionIngestProcessingFrontierReporter::new(sender);
|
||||
let mut coordinator = super::RawTransactionIngestYellowstoneBlockHydrationCoordinator::new(2, 1);
|
||||
assert!(coordinator.can_receive());
|
||||
assert!(coordinator.queue_slot(100, &mut processing_frontier).is_ok());
|
||||
assert!(coordinator.queue_slot(101, &mut processing_frontier).is_ok());
|
||||
assert!(!coordinator.can_receive());
|
||||
assert_eq!(receiver.borrow().hydration_pending(), 2);
|
||||
assert_eq!(receiver.borrow().oldest_pending_slot(), std::option::Option::Some(100));
|
||||
let saturated = coordinator.queue_slot(102, &mut processing_frontier);
|
||||
let error = match saturated {
|
||||
std::result::Result::Ok(()) => return,
|
||||
std::result::Result::Err(value) => value,
|
||||
};
|
||||
assert_eq!(error.code(), crate::ERROR_CODE_RAW_TRANSACTION_INGEST_RUNTIME_INVALID);
|
||||
assert_eq!(error.context()[0].value(), "source.yellowstone_block_hydration_pending_saturated");
|
||||
assert_eq!(coordinator.pending.len(), 2);
|
||||
assert_eq!(coordinator.tasks.len(), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "current_thread")]
|
||||
|
||||
Reference in New Issue
Block a user