mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-15 18:08:05 +00:00
refactor(events): recent_blockhash as base58 string (same as signature)
- EventMetadata.recent_blockhash: Option<Vec<u8>> -> Option<String> - Add bs58 dependency; gRPC path: bs58::encode message bytes - VersionedTransaction path: use Hash::to_string() (base58) - parse_events_from_grpc_instruction/parse_events_from_instruction: accept Option<&str> Made-with: Cursor
This commit is contained in:
@@ -312,9 +312,9 @@ pub struct EventMetadata {
|
||||
pub swap_data: Option<SwapData>,
|
||||
pub outer_index: i64,
|
||||
pub inner_index: Option<i64>,
|
||||
/// Transaction message recent blockhash (32 bytes), when available.
|
||||
/// Transaction message recent blockhash as base58 string (same encoding as signature), when available.
|
||||
#[serde(default)]
|
||||
pub recent_blockhash: Option<Vec<u8>>,
|
||||
pub recent_blockhash: Option<String>,
|
||||
}
|
||||
|
||||
impl EventMetadata {
|
||||
@@ -331,7 +331,7 @@ impl EventMetadata {
|
||||
inner_index: Option<i64>,
|
||||
recv_us: i64,
|
||||
tx_index: Option<u64>,
|
||||
recent_blockhash: Option<Vec<u8>>,
|
||||
recent_blockhash: Option<String>,
|
||||
) -> Self {
|
||||
Self {
|
||||
signature,
|
||||
|
||||
Reference in New Issue
Block a user