v0.3.12-pre.004-fix.001
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/src/runtime_resources.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
#[cfg(test)]
|
||||
use sha2::Digest; // rust-rules: trait-import
|
||||
@@ -386,7 +386,7 @@ fn project_yellowstone_signal<T: RawTransactionIngestYellowstoneSignalView>(
|
||||
|
||||
#[cfg(test)]
|
||||
enum RawTransactionIngestHydrationOutcome {
|
||||
Available(crate::RawTransactionIngress),
|
||||
Available(std::boxed::Box<crate::RawTransactionIngress>),
|
||||
Missing(ksp_store_lib::RawTransactionReference),
|
||||
}
|
||||
|
||||
@@ -434,12 +434,11 @@ async fn hydrate_yellowstone_signal(
|
||||
if transaction.slot() != signal.slot {
|
||||
return std::result::Result::Err(crate::runtime_error("hydration.slot_mismatch"));
|
||||
}
|
||||
if let std::option::Option::Some(expected_index) = signal.transaction_index {
|
||||
if let ksp_onchain_transport_lib::SolanaWireField::Value(actual_index) = transaction.transaction_index() {
|
||||
if expected_index != u64::from(*actual_index) {
|
||||
return std::result::Result::Err(crate::runtime_error("hydration.transaction_index_mismatch"));
|
||||
}
|
||||
}
|
||||
if let std::option::Option::Some(expected_index) = signal.transaction_index
|
||||
&& let ksp_onchain_transport_lib::SolanaWireField::Value(actual_index) = transaction.transaction_index()
|
||||
&& expected_index != u64::from(*actual_index)
|
||||
{
|
||||
return std::result::Result::Err(crate::runtime_error("hydration.transaction_index_mismatch"));
|
||||
}
|
||||
let transaction_data = match transaction.transaction() {
|
||||
ksp_onchain_transport_lib::SolanaEncodedTransaction::Binary { data, encoding }
|
||||
@@ -482,12 +481,12 @@ async fn hydrate_yellowstone_signal(
|
||||
}),
|
||||
map_hydration_wire_field(transaction.transaction_index(), |value| return *value),
|
||||
);
|
||||
return std::result::Result::Ok(RawTransactionIngestHydrationOutcome::Available(crate::RawTransactionIngress {
|
||||
return std::result::Result::Ok(RawTransactionIngestHydrationOutcome::Available(std::boxed::Box::new(crate::RawTransactionIngress {
|
||||
material,
|
||||
network: signal.network,
|
||||
provenance,
|
||||
source_key,
|
||||
}));
|
||||
})));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime_resources.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
fn grpc_endpoint(cluster: &str) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneGrpcEndpointSettings> {
|
||||
return grpc_endpoint_with_identity(cluster, "yellowstone-fixture", "fixture-provider");
|
||||
@@ -749,7 +749,7 @@ async fn pre_004_observed_get_transaction_closes_signal_to_common_raw_ingress_wi
|
||||
assert_eq!(ingress.provenance.filter_id().map(ksp_store_lib::RawProvenanceCode::as_str), std::option::Option::Some("tx-fixture"));
|
||||
assert_eq!(ingress.provenance.observed_at().map(|value| return value.unix_millis()), std::option::Option::Some(1_760_000_123_456));
|
||||
let (mut admission, sender) = crate::RawTransactionAdmission::new(1);
|
||||
if sender.send(ingress).await.is_err() {
|
||||
if sender.send(*ingress).await.is_err() {
|
||||
return;
|
||||
}
|
||||
std::mem::drop(sender);
|
||||
@@ -896,7 +896,7 @@ async fn pre_004_v0_null_and_omitted_wire_fields_preserve_common_raw_semantics()
|
||||
assert!(filter_id.starts_with("sha256."));
|
||||
assert_eq!(filter_id.len(), 71);
|
||||
let (mut admission, sender) = crate::RawTransactionAdmission::new(1);
|
||||
if sender.send(ingress).await.is_err() {
|
||||
if sender.send(*ingress).await.is_err() {
|
||||
return;
|
||||
}
|
||||
std::mem::drop(sender);
|
||||
|
||||
Reference in New Issue
Block a user