Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Minor fix for donos
Browse files Browse the repository at this point in the history
  • Loading branch information
FerranMarin committed Jun 18, 2022
1 parent a1b1d0b commit 4068c87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 5 additions & 3 deletions axie-scholar-utilities/source/axie/payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def verify(self):
validation_success = False

if not validation_success:
logging.critical("Please make sure your payments.json file looks like the payments one in the wiki or the sample files.\n"
logging.critical("Please make sure your payments.json file looks like the payments one in "
"the wiki or the sample files.\n"
"Find it here: https://ferranmarin.github.io/axie-scholar-utilities/ \n"
"Make sure you have configured all secrets too!")
sys.exit()
Expand Down Expand Up @@ -182,8 +183,9 @@ def prepare_new_payout(self):
total_payments = 0
acc_payments = {}
deductable_fees = 1
for dono in self.donations:
deductable_fees += dono['percentage']
if self.donations:
for dono in self.donations:
deductable_fees += dono['percentage']
# Split payments
for sacc in acc['splits']:
if sacc['persona'].lower() == 'manager':
Expand Down
11 changes: 7 additions & 4 deletions axie-scholar-utilities/source/trezor/trezor_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ def verify_inputs(self):
logging.critical(f"Unexpected error! Unrecognized payments mode")

if not validation_success:
logging.critical("There is a problem with your trezor_config.json, delete it and re-generate the file starting with an empty file.")
logging.critical("There is a problem with your trezor_config.json, delete it and re-generate "
"the file starting with an empty file.")
sys.exit()

if self.type == "legacy":
Expand Down Expand Up @@ -181,8 +182,9 @@ def prepare_new_payout(self):
total_payments = 0
acc_payments = {}
deductable_fees = 1
for dono in self.donations:
deductable_fees += dono['percentage']
if self.donations:
for dono in self.donations:
deductable_fees += dono['percentage']
# Split payments
for sacc in acc['splits']:
if sacc['persona'].lower() == 'manager':
Expand Down Expand Up @@ -261,7 +263,8 @@ def prepare_old_payout(self):
dono_amount = round(acc_balance * (dono["Percent"]/100))
if dono_amount > 1:
acc_payments[dono['AccountAddress']] = dono_amount
self.summary.increase_payout(amount=dono_amount, address=dono['AccountAddress'], payout_type='donation')
self.summary.increase_payout(amount=dono_amount, address=dono['AccountAddress'],
payout_type='donation')
manager_payout -= dono_amount
total_payments += dono_amount
# Fee Payments
Expand Down

0 comments on commit 4068c87

Please sign in to comment.