mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-15 18:08:05 +00:00
refactor: simplify event API method names for better ergonomics
- Rename verbose method names to shorter, clearer alternatives - program_received_time_us() → recv_us() - program_handle_time_consuming_us() → handle_us() - instruction_outer_index() → outer_index() - instruction_inner_index() → inner_index() - Update all implementations across event parsers and processors Improves developer experience while maintaining semantic clarity.
This commit is contained in:
@@ -118,7 +118,7 @@ impl PooledAccountPretty {
|
||||
self.account.data = new_data;
|
||||
}
|
||||
|
||||
self.account.program_received_time_us = get_high_perf_clock();
|
||||
self.account.recv_us = get_high_perf_clock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ impl PooledBlockMetaPretty {
|
||||
self.block_meta.slot = block_update.slot;
|
||||
self.block_meta.block_hash = block_update.blockhash;
|
||||
self.block_meta.block_time = block_time;
|
||||
self.block_meta.program_received_time_us = get_high_perf_clock();
|
||||
self.block_meta.recv_us = get_high_perf_clock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ impl PooledTransactionPretty {
|
||||
self.transaction.signature =
|
||||
Signature::try_from(tx.signature.as_slice()).expect("valid signature");
|
||||
self.transaction.is_vote = tx.is_vote;
|
||||
self.transaction.program_received_time_us = get_high_perf_clock();
|
||||
self.transaction.recv_us = get_high_perf_clock();
|
||||
self.transaction.grpc_tx = tx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ pub struct AccountPretty {
|
||||
pub owner: Pubkey,
|
||||
pub rent_epoch: u64,
|
||||
pub data: Vec<u8>,
|
||||
pub program_received_time_us: i64,
|
||||
pub recv_us: i64,
|
||||
}
|
||||
|
||||
impl fmt::Debug for AccountPretty {
|
||||
@@ -52,7 +52,7 @@ pub struct BlockMetaPretty {
|
||||
pub slot: u64,
|
||||
pub block_hash: String,
|
||||
pub block_time: Option<Timestamp>,
|
||||
pub program_received_time_us: i64,
|
||||
pub recv_us: i64,
|
||||
}
|
||||
|
||||
impl fmt::Debug for BlockMetaPretty {
|
||||
@@ -61,7 +61,7 @@ impl fmt::Debug for BlockMetaPretty {
|
||||
.field("slot", &self.slot)
|
||||
.field("block_hash", &self.block_hash)
|
||||
.field("block_time", &self.block_time)
|
||||
.field("program_received_time_us", &self.program_received_time_us)
|
||||
.field("recv_us", &self.recv_us)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ pub struct TransactionPretty {
|
||||
pub block_time: Option<Timestamp>,
|
||||
pub signature: Signature,
|
||||
pub is_vote: bool,
|
||||
pub program_received_time_us: i64,
|
||||
pub recv_us: i64,
|
||||
pub grpc_tx: SubscribeUpdateTransactionInfo,
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ impl fmt::Debug for TransactionPretty {
|
||||
.field("transaction_index", &self.transaction_index)
|
||||
.field("signature", &self.signature)
|
||||
.field("is_vote", &self.is_vote)
|
||||
.field("program_received_time_us", &self.program_received_time_us)
|
||||
.field("recv_us", &self.recv_us)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ impl Default for TransactionPretty {
|
||||
signature: Signature::default(),
|
||||
is_vote: false,
|
||||
grpc_tx: SubscribeUpdateTransactionInfo::default(),
|
||||
program_received_time_us: 0,
|
||||
recv_us: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ impl Default for TransactionPretty {
|
||||
// owner: Pubkey::try_from(account_info.owner.as_slice()).expect("valid pubkey"),
|
||||
// rent_epoch: account_info.rent_epoch,
|
||||
// data: account_info.data,
|
||||
// program_received_time_us: get_high_perf_clock(),
|
||||
// recv_us: get_high_perf_clock(),
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -137,7 +137,7 @@ impl Default for TransactionPretty {
|
||||
// block_hash: blockhash,
|
||||
// block_time,
|
||||
// slot,
|
||||
// program_received_time_us: get_high_perf_clock(),
|
||||
// recv_us: get_high_perf_clock(),
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -161,7 +161,7 @@ impl Default for TransactionPretty {
|
||||
// is_vote: tx.is_vote,
|
||||
// tx: yellowstone_grpc_proto::convert_from::create_tx_with_meta(tx)
|
||||
// .expect("valid tx with meta"),
|
||||
// program_received_time_us: get_high_perf_clock(),
|
||||
// recv_us: get_high_perf_clock(),
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user