feat(event_parser): add requires_inner_instruction field to skip incomplete events

- Add requires_inner_instruction field to GenericEventParseConfig
  - Skip events that require but lack inner instruction data during processing
  - Set PumpFun migrate events to require inner instructions (prevents parsing failed migrations)
This commit is contained in:
ioxde
2025-09-08 20:19:13 -07:00
parent d219433466
commit 8ec1457858
7 changed files with 50 additions and 0 deletions
@@ -41,6 +41,7 @@ impl PumpSwapEventParser {
event_type: EventType::PumpSwapBuy,
inner_instruction_parser: Some(Self::parse_buy_inner_instruction),
instruction_parser: Some(Self::parse_buy_instruction),
requires_inner_instruction: false,
},
GenericEventParseConfig {
program_id: PUMPSWAP_PROGRAM_ID,
@@ -50,6 +51,7 @@ impl PumpSwapEventParser {
event_type: EventType::PumpSwapSell,
inner_instruction_parser: Some(Self::parse_sell_inner_instruction),
instruction_parser: Some(Self::parse_sell_instruction),
requires_inner_instruction: false,
},
GenericEventParseConfig {
program_id: PUMPSWAP_PROGRAM_ID,
@@ -59,6 +61,7 @@ impl PumpSwapEventParser {
event_type: EventType::PumpSwapCreatePool,
inner_instruction_parser: Some(Self::parse_create_pool_inner_instruction),
instruction_parser: Some(Self::parse_create_pool_instruction),
requires_inner_instruction: false,
},
GenericEventParseConfig {
program_id: PUMPSWAP_PROGRAM_ID,
@@ -68,6 +71,7 @@ impl PumpSwapEventParser {
event_type: EventType::PumpSwapDeposit,
inner_instruction_parser: Some(Self::parse_deposit_inner_instruction),
instruction_parser: Some(Self::parse_deposit_instruction),
requires_inner_instruction: false,
},
GenericEventParseConfig {
program_id: PUMPSWAP_PROGRAM_ID,
@@ -77,6 +81,7 @@ impl PumpSwapEventParser {
event_type: EventType::PumpSwapWithdraw,
inner_instruction_parser: Some(Self::parse_withdraw_inner_instruction),
instruction_parser: Some(Self::parse_withdraw_instruction),
requires_inner_instruction: false,
},
];