Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions airdrop/application/services/user_registration_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions airdrop/job/rejuve_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion airdrop/processor/default_airdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion airdrop/processor/loyalty_airdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 8 additions & 4 deletions airdrop/processor/rejuve_airdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading