-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support paying burn fee to reactivate zeroed tz1 address (tezos-rewar…
…d-distributor-organization#181) * Fixes tezos-reward-distributor-organization#178 * fixed unit tests * fix example yaml * resolve float/int issue * added burn fees to total amount for display * don't show disclaimer when running command line tools * add support for tzstats, checking 0 balance of receiver * added sleeps for tzstats api
- Loading branch information
Showing
30 changed files
with
408 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from log_config import main_logger | ||
from model import reward_log | ||
from calc.calculate_phase_base import CalculatePhaseBase, BY_ZERO_BALANCE | ||
|
||
logger = main_logger | ||
|
||
class CalculatePhase7(CalculatePhaseBase): | ||
""" | ||
-- Phase7 : Check if current delegator balance is 0 -- | ||
At stage 7, check each delegate's current balance. If 0, and baker is not reactivating, | ||
then mark payment as not-payable | ||
""" | ||
|
||
def __init__(self, reactivate_zeroed) -> None: | ||
super().__init__() | ||
self.reactivate_zeroed = reactivate_zeroed | ||
self.phase = 7 | ||
|
||
def calculate(self, reward_logs): | ||
|
||
reward_data7 = [] | ||
|
||
for delegate in reward_logs: | ||
|
||
# If delegate's current balance is 0, and we are NOT reactivating it, | ||
# then mark address as being skipped with a description to be included | ||
# in the CSV payment report | ||
|
||
if (delegate.type == reward_log.TYPE_DELEGATOR and delegate.current_balance == 0): | ||
|
||
if self.reactivate_zeroed: | ||
delegate.needs_activation = True | ||
else: | ||
delegate.skip(BY_ZERO_BALANCE, self.phase) | ||
|
||
reward_data7.append(delegate) | ||
|
||
return reward_data7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.