|
18 | 18 | rdkafka::util::get_rdkafka_version, |
19 | 19 | simple_error::simple_error, |
20 | 20 | solana_geyser_plugin_interface::geyser_plugin_interface::{ |
21 | | - GeyserPlugin, GeyserPluginError as PluginError, ReplicaAccountInfo, |
| 21 | + GeyserPlugin, GeyserPluginError as PluginError, ReplicaAccountInfoV2, |
22 | 22 | ReplicaAccountInfoVersions, ReplicaTransactionInfoVersions, Result as PluginResult, |
23 | 23 | SlotStatus as PluginSlotStatus, |
24 | 24 | }, |
@@ -103,6 +103,7 @@ impl GeyserPlugin for KafkaPlugin { |
103 | 103 | rent_epoch: info.rent_epoch, |
104 | 104 | data: info.data.to_vec(), |
105 | 105 | write_version: info.write_version, |
| 106 | + txn_signature: info.txn_signature.map(|sig| sig.as_ref().to_owned()), |
106 | 107 | }; |
107 | 108 |
|
108 | 109 | let publisher = self.unwrap_publisher(); |
@@ -172,9 +173,12 @@ impl KafkaPlugin { |
172 | 173 | self.filter.as_ref().expect("filter is unavailable") |
173 | 174 | } |
174 | 175 |
|
175 | | - fn unwrap_update_account(account: ReplicaAccountInfoVersions) -> &ReplicaAccountInfo { |
| 176 | + fn unwrap_update_account(account: ReplicaAccountInfoVersions) -> &ReplicaAccountInfoV2 { |
176 | 177 | match account { |
177 | | - ReplicaAccountInfoVersions::V0_0_1(info) => info, |
| 178 | + ReplicaAccountInfoVersions::V0_0_1(_info) => { |
| 179 | + panic!("ReplicaAccountInfoVersions::V0_0_1 unsupported, please upgrade your Solana node."); |
| 180 | + } |
| 181 | + ReplicaAccountInfoVersions::V0_0_2(info) => info, |
178 | 182 | } |
179 | 183 | } |
180 | 184 |
|
@@ -218,7 +222,11 @@ impl KafkaPlugin { |
218 | 222 | slot: u64, |
219 | 223 | transaction: ReplicaTransactionInfoVersions, |
220 | 224 | ) -> TransactionEvent { |
221 | | - let ReplicaTransactionInfoVersions::V0_0_1(transaction) = transaction; |
| 225 | + let transaction = if let ReplicaTransactionInfoVersions::V0_0_2(transaction) = transaction { |
| 226 | + transaction |
| 227 | + } else { |
| 228 | + panic!("Unsupported ReplicaTransactionInfoVersions::V0_0_2, please upgrade your Solana node.") |
| 229 | + }; |
222 | 230 | let transaction_status_meta = transaction.transaction_status_meta; |
223 | 231 | let signature = transaction.signature; |
224 | 232 | let is_vote = transaction.is_vote; |
|
0 commit comments