v0.2.9-pre.004-fix.001

This commit is contained in:
2026-08-24 12:09:48 +02:00
parent e4bbc78a41
commit 20320dba7b
5 changed files with 104 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-onchain-transport-lib/src/grpc_subscribe.rs
// version: 1
// version: 2
const MAX_GRPC_SUBSCRIBE_DATA_SLICE_COUNT: usize = 128;
const MAX_GRPC_SUBSCRIBE_DATA_SLICE_LENGTH_BYTES: u64 = 64 * 1024 * 1024;
@@ -72,6 +72,7 @@ impl YellowstoneAccountsDataSlice {
return self.length;
}
#[cfg(test)]
fn to_wire(self) -> yellowstone_grpc_proto::geyser::SubscribeRequestAccountsDataSlice {
return yellowstone_grpc_proto::geyser::SubscribeRequestAccountsDataSlice { offset: self.offset, length: self.length };
}
@@ -96,6 +97,7 @@ impl YellowstoneSubscribePing {
return self.id;
}
#[cfg(test)]
fn to_wire(self) -> yellowstone_grpc_proto::geyser::SubscribeRequestPing {
return yellowstone_grpc_proto::geyser::SubscribeRequestPing { id: self.id };
}
@@ -116,6 +118,7 @@ impl YellowstoneSubscribeAccountFilter {
return Self { _private: () };
}
#[cfg(test)]
fn to_wire(&self) -> yellowstone_grpc_proto::geyser::SubscribeRequestFilterAccounts {
return yellowstone_grpc_proto::geyser::SubscribeRequestFilterAccounts::default();
}
@@ -136,6 +139,7 @@ impl YellowstoneSubscribeSlotFilter {
return Self { _private: () };
}
#[cfg(test)]
fn to_wire(&self) -> yellowstone_grpc_proto::geyser::SubscribeRequestFilterSlots {
return yellowstone_grpc_proto::geyser::SubscribeRequestFilterSlots::default();
}
@@ -156,6 +160,7 @@ impl YellowstoneSubscribeTransactionFilter {
return Self { _private: () };
}
#[cfg(test)]
fn to_wire(&self) -> yellowstone_grpc_proto::geyser::SubscribeRequestFilterTransactions {
return yellowstone_grpc_proto::geyser::SubscribeRequestFilterTransactions::default();
}
@@ -176,6 +181,7 @@ impl YellowstoneSubscribeBlockFilter {
return Self { _private: () };
}
#[cfg(test)]
fn to_wire(&self) -> yellowstone_grpc_proto::geyser::SubscribeRequestFilterBlocks {
return yellowstone_grpc_proto::geyser::SubscribeRequestFilterBlocks::default();
}
@@ -194,6 +200,7 @@ impl YellowstoneSubscribeBlocksMetaFilter {
return Self { _private: () };
}
#[cfg(test)]
fn to_wire(self) -> yellowstone_grpc_proto::geyser::SubscribeRequestFilterBlocksMeta {
return yellowstone_grpc_proto::geyser::SubscribeRequestFilterBlocksMeta::default();
}
@@ -212,6 +219,7 @@ impl YellowstoneSubscribeEntryFilter {
return Self { _private: () };
}
#[cfg(test)]
fn to_wire(self) -> yellowstone_grpc_proto::geyser::SubscribeRequestFilterEntry {
return yellowstone_grpc_proto::geyser::SubscribeRequestFilterEntry::default();
}
@@ -465,6 +473,7 @@ impl YellowstoneSubscribeRequest {
return std::result::Result::Ok(());
}
#[cfg(test)]
fn to_wire(&self) -> ksp_core_lib::Result<yellowstone_grpc_proto::geyser::SubscribeRequest> {
let validation = self.validate();
if let std::result::Result::Err(error) = validation {
@@ -522,6 +531,7 @@ impl YellowstoneSubscribeRequest {
}
}
#[cfg(test)]
fn commitment_to_wire(commitment: std::option::Option<crate::SolanaCommitment>) -> std::option::Option<i32> {
return commitment.map(|value| {
return match value {