diff --git a/airdrop/application/services/user_registration_services.py b/airdrop/application/services/user_registration_services.py index ca70727..d9f8432 100644 --- a/airdrop/application/services/user_registration_services.py +++ b/airdrop/application/services/user_registration_services.py @@ -223,8 +223,8 @@ def eligibility(inputs: dict) -> tuple: rewards_awarded = AirdropRepository().fetch_total_rewards_amount(airdrop_id, address) is_registered, user_registration = CommonLogicService.get_user_registration_details( - address, - airdrop_window_id + address=address, + airdrop_window_id=airdrop_window_id ) is_airdrop_window_claimed = False @@ -337,7 +337,7 @@ def check_trezor_registrations() -> None: registration_repo = UserRegistrationRepository() logger.info(f"Found tx {registration.tx_hash}: block={tx_data.block_height} index={tx_data.index}") - is_registered, _ = CommonLogicService.get_user_registration_details(registration.address) + is_registered, _ = CommonLogicService.get_user_registration_details(address=registration.address) if is_registered: logger.error("Address is already registered for this airdrop window") raise Exception("Address is already registered for this airdrop window") diff --git a/airdrop/job/rejuve_processes.py b/airdrop/job/rejuve_processes.py index 3ebba7a..7f70abf 100644 --- a/airdrop/job/rejuve_processes.py +++ b/airdrop/job/rejuve_processes.py @@ -33,7 +33,8 @@ def receive_all_registrations(self) -> list[UserRegistration]: logger.info("Processing the receiving all registrations for the " f"airdrop_id = {self._airdrop_id}, window_id = {self._window_id}") if self.address: - _, registration = CommonLogicService.get_user_registration_details(self.address, self._window_id) + _, registration = CommonLogicService.get_user_registration_details(address=self.address, + airdrop_window_id=self._window_id) registrations = [registration] else: _, registrations = UserRegistrationRepository().get_user_registration_details(airdrop_window_id=self._window_id) @@ -81,7 +82,8 @@ def receive_all_registrations(self) -> list[UserRegistration]: logger.info("Processing the receiving all registrations for the " f"airdrop_id = {self._airdrop_id}, window_id = {self._window_id}") if self.address: - _, registration = CommonLogicService.get_user_registration_details(self.address, self._window_id) + _, registration = CommonLogicService.get_user_registration_details(address=self.address, + airdrop_window_id=self._window_id) registrations = [registration] else: _, registrations = UserRegistrationRepository().get_user_registration_details(airdrop_window_id=self._window_id) diff --git a/airdrop/processor/default_airdrop.py b/airdrop/processor/default_airdrop.py index c7f0816..d1f0893 100644 --- a/airdrop/processor/default_airdrop.py +++ b/airdrop/processor/default_airdrop.py @@ -157,7 +157,7 @@ def register(self, data: dict) -> list | str: raise Exception("Address is not eligible for this airdrop") is_registered, _ = registration_repo. \ - get_user_registration_details(address, self.window_id) + get_user_registration_details(address=address, airdrop_window_id=self.window_id) if is_registered: logger.error("Address is already registered for this airdrop window") raise Exception("Address is already registered for this airdrop window") diff --git a/airdrop/processor/loyalty_airdrop.py b/airdrop/processor/loyalty_airdrop.py index 2cca967..c834cc5 100644 --- a/airdrop/processor/loyalty_airdrop.py +++ b/airdrop/processor/loyalty_airdrop.py @@ -111,7 +111,8 @@ def register(self, data: dict) -> list | str: raise Exception("Address is not eligible for this airdrop") is_registered, _ = registration_repo. \ - get_user_registration_details(address, self.window_id) + get_user_registration_details(address=address, + airdrop_window_id=self.window_id) if is_registered: logger.error("Address is already registered for this airdrop window") raise Exception("Address is already registered for this airdrop window") diff --git a/airdrop/processor/rejuve_airdrop.py b/airdrop/processor/rejuve_airdrop.py index ff4ba60..055bd69 100644 --- a/airdrop/processor/rejuve_airdrop.py +++ b/airdrop/processor/rejuve_airdrop.py @@ -233,7 +233,8 @@ def register_regular_wallet(self, data: dict) -> list | str: logger.error("Address is not eligible for this airdrop") raise Exception("Address is not eligible for this airdrop") - is_registered, _ = CommonLogicService.get_user_registration_details(address, self.window_id) + is_registered, _ = CommonLogicService.get_user_registration_details(address=address, + airdrop_window_id=self.window_id) if is_registered: logger.error("Address is already registered for this airdrop window") raise Exception("Address is already registered for this airdrop window") @@ -301,7 +302,8 @@ def register_trezor(self, data: dict) -> list | str: logger.error("Address is not eligible for this airdrop") raise Exception("Address is not eligible for this airdrop") - is_registered, _ = CommonLogicService.get_user_registration_details(address, self.window_id) + is_registered, _ = CommonLogicService.get_user_registration_details(address=address, + airdrop_window_id=self.window_id) if is_registered: logger.error("Address is already registered for this airdrop window") raise Exception("Address is already registered for this airdrop window") @@ -395,7 +397,8 @@ def update_registration(self, data: dict): claimable_airdrop_window = None airdrop_windows = airdrop_window_repo.get_airdrop_windows(self.id) for airdrop_window_ in airdrop_windows: - is_registered, _ = CommonLogicService.get_user_registration_details(address, airdrop_window_.id) + is_registered, _ = CommonLogicService.get_user_registration_details(address=address, + airdrop_window_id=airdrop_window_.id) claim_history_obj = claim_history_repo.get_claim_history(airdrop_window_.id, address, "ada_transfer") is_claimed = claim_history_obj is not None is_after_requested = airdrop_window_.airdrop_window_order > requested_airdrop_window.airdrop_window_order @@ -505,7 +508,8 @@ def validate_update_registration_trezor(self, window_id, address, reward_address # Transaction timestamp from metadata check is_transaction_newest = False - _, registration = CommonLogicService.get_user_registration_details(address, window_id) + _, registration = CommonLogicService.get_user_registration_details(address=address, + airdrop_window_id=window_id) if metadata["timestamp"] > registration.signature_details["timestamp"]: is_transaction_newest = True if not is_transaction_newest: