diff --git a/src/calc/calculate_phase4.py b/src/calc/calculate_phase4.py index 3470dc73..8ecaac12 100644 --- a/src/calc/calculate_phase4.py +++ b/src/calc/calculate_phase4.py @@ -18,7 +18,7 @@ class CalculatePhase4(CalculatePhaseBase): Sum of owner ratios equals to ratio of owners_parent record. """ - def __init__(self, founders_map, owners_map, reward_api=None) -> None: + def __init__(self, founders_map, reward_api=None) -> None: super().__init__() self.founders_map = founders_map @@ -51,21 +51,7 @@ def calculate(self, reward_data3, total_amount): new_rewards.append(rl3) elif rl3.type == TYPE_OWNERS_PARENT: - for addr, ratio in self.owners_map.items(): - rl4 = RewardLog(addr, TYPE_OWNER, ratio * rl3.delegating_balance, 0) - # new ratio is parent ratio * ratio of the owner - rl4.ratio = ratio * rl3.ratio - rl4.ratio4 = rl4.ratio - rl4.service_fee_ratio = 0 - rl4.service_fee_rate = 0 - rl4.parent = rl3 - if self.reward_api is not None: - self.reward_api.update_current_balances([rl4]) - new_rewards.append(rl4) - - # if no owners, add parent object to rewards list - if not self.owners_map.items(): - new_rewards.append(rl3) + new_rewards.append(rl3) else: rl3.ratio4 = rl3.ratio new_rewards.append(rl3) diff --git a/src/calc/phased_payment_calculator.py b/src/calc/phased_payment_calculator.py index a1d830de..2f6bd58d 100644 --- a/src/calc/phased_payment_calculator.py +++ b/src/calc/phased_payment_calculator.py @@ -32,7 +32,6 @@ class PhasedPaymentCalculator: def __init__( self, founders_map, - owners_map, service_fee_calculator, min_delegation_amount, min_payment_amount, @@ -40,7 +39,6 @@ def __init__( reward_api, ): self.rules_model = rules_model - self.owners_map = owners_map self.founders_map = founders_map self.fee_calc = service_fee_calculator self.min_delegation_amnt = min_delegation_amount @@ -50,9 +48,9 @@ def __init__( # # calculation details # - # total reward = delegators reward + owners reward = delegators payment + delegators fee + owners payment + # total reward = delegators reward + owner reward = delegators payment + delegators fee + owner payment # delegators reward = delegators payment + delegators fee - # owners reward = owners payment = total reward - delegators reward + # owner reward = owner payment = total reward - delegators reward # founders reward = delegators fee = total reward - delegators reward #### def calculate(self, reward_provider_model, adjustments=None, rerun=False): @@ -138,7 +136,7 @@ def calculate(self, reward_provider_model, adjustments=None, rerun=False): # ************* # ** phase 4 ** # ************* - phase4 = CalculatePhase4(self.founders_map, self.owners_map, self.reward_api) + phase4 = CalculatePhase4(self.founders_map, self.reward_api) rwrd_logs, total_rwrd_amnt = phase4.calculate(rwrd_logs, total_rwrd_amnt) # ***************** diff --git a/src/config/yaml_baking_conf_parser.py b/src/config/yaml_baking_conf_parser.py index 1c4387b0..7f16d32a 100644 --- a/src/config/yaml_baking_conf_parser.py +++ b/src/config/yaml_baking_conf_parser.py @@ -7,7 +7,6 @@ from log_config import main_logger from model.baking_conf import ( FOUNDERS_MAP, - OWNERS_MAP, BAKING_ADDRESS, SUPPORTERS_SET, SERVICE_FEE, @@ -75,7 +74,6 @@ def validate(self): self.validate_baking_address(conf_obj) self.validate_payment_address(conf_obj) self.validate_share_map(conf_obj, FOUNDERS_MAP) - self.validate_share_map(conf_obj, OWNERS_MAP) self.validate_service_fee(conf_obj) self.validate_min_delegation_amt(conf_obj) self.validate_min_payment_amt(conf_obj) @@ -97,7 +95,6 @@ def process(self): conf_obj[FULL_SUPPORTERS_SET] = set( conf_obj[SUPPORTERS_SET] | set(conf_obj[FOUNDERS_MAP].keys()) - | set(conf_obj[OWNERS_MAP].keys()) ) conf_obj[EXCLUDED_DELEGATORS_SET_TOE] = set( diff --git a/src/configure.py b/src/configure.py index 59cbab45..d27ced47 100644 --- a/src/configure.py +++ b/src/configure.py @@ -33,7 +33,6 @@ PAYMENT_ADDRESS, SERVICE_FEE, FOUNDERS_MAP, - OWNERS_MAP, MIN_DELEGATION_AMT, MIN_PAYMENT_AMT, RULES_MAP, @@ -63,7 +62,6 @@ "servicefee": "Specify bakery fee, valid range is between 0 and 100", "rewardstype": "Specify if baker pays 'ideal' or 'actual' rewards (Be sure to read the documentation to understand the difference). Press enter for 'actual'", "foundersmap": "Specify FOUNDERS in form 'tz-address':share1,'tz-address':share2,... (Mind quotes, sum must equal 1, e.g: 'tz1a...':0.3, 'tz1b..':0.7) Press enter to leave empty", - "ownersmap": "Specify OWNERS in form 'tz-address':share1,'tz-address':share2,... (Mind quotes, sum must equal 1, e.g: 'tz1a...':0.3, 'tz1b..':0.7) Press enter to leave empty", "mindelegation": "Specify minimum delegation amount in tez. Press enter for 0", "mindelegationtarget": "Specify where the reward for delegators failing to satisfy minimum delegation amount go. {}: leave at balance, {}: to founders, {}: to everybody, press enter for {}".format( TOB, TOF, TOE, TOB @@ -172,19 +170,6 @@ def onfoundersmap(input): fsm.go() -def onownersmap(input): - try: - global parser - dict = ast.literal_eval("{" + input + "}") - parser.set(OWNERS_MAP, dict) - parser.validate_share_map(parser.get_conf_obj(), OWNERS_MAP) - except Exception: - printe("Invalid owners input: " + traceback.format_exc()) - return - - fsm.go() - - def onmindelegation(input): try: if not input: @@ -371,7 +356,6 @@ def onprefinal(input): "servicefee": onservicefee, "rewardstype": onrewardstype, "foundersmap": onfoundersmap, - "ownersmap": onownersmap, "mindelegation": onmindelegation, "mindelegationtarget": onmindelegationtarget, "minpayment": onminpayment, @@ -396,8 +380,7 @@ def onprefinal(input): {"name": "go", "src": "paymentaddress", "dst": "servicefee"}, {"name": "go", "src": "servicefee", "dst": "rewardstype"}, {"name": "go", "src": "rewardstype", "dst": "foundersmap"}, - {"name": "go", "src": "foundersmap", "dst": "ownersmap"}, - {"name": "go", "src": "ownersmap", "dst": "mindelegation"}, + {"name": "go", "src": "foundersmap", "dst": "mindelegation"}, {"name": "go", "src": "mindelegation", "dst": "mindelegationtarget"}, {"name": "go", "src": "mindelegationtarget", "dst": "minpayment"}, {"name": "go", "src": "minpayment", "dst": "exclude"}, diff --git a/src/pay/payment_producer.py b/src/pay/payment_producer.py index 0e4f3ec8..18e7db2f 100644 --- a/src/pay/payment_producer.py +++ b/src/pay/payment_producer.py @@ -76,7 +76,6 @@ def __init__( baking_cfg.get_dest_map(), ) self.baking_address = baking_cfg.get_baking_address() - self.owners_map = baking_cfg.get_owners_map() self.founders_map = baking_cfg.get_founders_map() self.min_delegation_amt_in_mutez = int( baking_cfg.get_min_delegation_amount() * MUTEZ_PER_TEZ @@ -126,7 +125,6 @@ def __init__( self.payment_calc = PhasedPaymentCalculator( self.founders_map, - self.owners_map, self.fee_calc, self.min_delegation_amt_in_mutez, self.min_payment_amt_in_mutez, diff --git a/tests/integration/test_phase.py b/tests/integration/test_phase.py index 0b957619..a6e190c0 100644 --- a/tests/integration/test_phase.py +++ b/tests/integration/test_phase.py @@ -87,7 +87,6 @@ def test_process_payouts(self): ) payment_calc = PhasedPaymentCalculator( founders_map=baking_cfg.get_founders_map(), - owners_map=baking_cfg.get_owners_map(), service_fee_calculator=srvc_fee_calc, min_delegation_amount=int( baking_cfg.get_min_delegation_amount() * MUTEZ_PER_TEZ