From f1c35d0d24b5409e0f915178ec8a9707c665c60d Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:17:15 -0700 Subject: [PATCH] Fix indexing rewards --- .../discovery-provider/src/tasks/index_rewards_manager.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/discovery-provider/src/tasks/index_rewards_manager.py b/packages/discovery-provider/src/tasks/index_rewards_manager.py index 4fed4648c09..12d05bf1da6 100644 --- a/packages/discovery-provider/src/tasks/index_rewards_manager.py +++ b/packages/discovery-provider/src/tasks/index_rewards_manager.py @@ -194,17 +194,11 @@ def get_valid_instruction( if not has_transfer_instruction: return None - if not any(REWARDS_MANAGER_ACCOUNT == str(key) for key in account_keys): - logger.error( - "index_rewards_manager.py | Rewards manager account missing from account keys" - ) - return None - instructions = tx_message.instructions rewards_manager_program_index = account_keys.index( Pubkey.from_string(REWARDS_MANAGER_PROGRAM) ) - for instruction in instructions: + for instruction in instructions[::-1]: if instruction.program_id_index == rewards_manager_program_index: return instruction