Skip to content

Commit

Permalink
Fix incentives type param to be optionally none
Browse files Browse the repository at this point in the history
  • Loading branch information
brkagithub committed Dec 5, 2024
1 parent 4c00a7c commit 5cbb2e9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dkg/paranet.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class NeuroWebIncentivesPoolParams(BaseIncentivesPoolParams):
operator_percentage: float
voters_percentage: float

def to_contract_args(self, incentive_type: ParanetIncentivizationType) -> dict:
def to_contract_args(self, incentive_type: ParanetIncentivizationType | None) -> dict:
return {
"tracToNeuroEmissionMultiplier": int(
self.neuro_emission_multiplier
Expand Down Expand Up @@ -98,7 +98,7 @@ def deploy_incentives_contract(
self,
ual: UAL,
incentives_pool_parameters: NeuroWebIncentivesPoolParams,
incentives_type: ParanetIncentivizationType,
incentives_type: ParanetIncentivizationType | None = None,
) -> dict[str, str | HexStr | TxReceipt]:
deploy_incentives_pool_fn = self.incentives_pools_deployment_functions.get(
incentives_type,
Expand Down Expand Up @@ -145,7 +145,7 @@ def deploy_incentives_contract(
_get_incentives_pool_address = Method(BlockchainRequest.get_incentives_pool_address)

def get_incentives_pool_address(
self, ual: UAL, incentives_type: ParanetIncentivizationType
self, ual: UAL, incentives_type: ParanetIncentivizationType | None = None
) -> Address:
parsed_ual = parse_ual(ual)
knowledge_asset_storage, knowledge_asset_token_id = (
Expand Down Expand Up @@ -265,7 +265,7 @@ def is_voter(
self,
ual: UAL,
address: Address | None = None,
incentives_type: ParanetIncentivizationType = None,
incentives_type: ParanetIncentivizationType | None = None,
) -> bool:
incentives_type = incentives_type or (
ParanetIncentivizationType.NEUROWEB.value
Expand All @@ -285,7 +285,7 @@ def is_voter(
def calculate_claimable_miner_reward_amount(
self,
ual: UAL,
incentives_type: ParanetIncentivizationType = None,
incentives_type: ParanetIncentivizationType | None = None,
) -> int:
incentives_type = incentives_type or (
ParanetIncentivizationType.NEUROWEB.value
Expand All @@ -304,7 +304,7 @@ def calculate_claimable_miner_reward_amount(
def calculate_all_claimable_miner_rewards_amount(
self,
ual: UAL,
incentives_type: ParanetIncentivizationType = None,
incentives_type: ParanetIncentivizationType | None = None,
) -> int:
incentives_type = incentives_type or (
ParanetIncentivizationType.NEUROWEB.value
Expand Down Expand Up @@ -359,7 +359,7 @@ def claim_miner_reward(
def calculate_claimable_operator_reward_amount(
self,
ual: UAL,
incentives_type: ParanetIncentivizationType = None,
incentives_type: ParanetIncentivizationType | None = None,
) -> int:
incentives_type = incentives_type or (
ParanetIncentivizationType.NEUROWEB.value
Expand All @@ -378,7 +378,7 @@ def calculate_claimable_operator_reward_amount(
def claim_operator_reward(
self,
ual: UAL,
incentives_type: ParanetIncentivizationType = None,
incentives_type: ParanetIncentivizationType | None = None,
) -> dict[str, str | HexStr | TxReceipt]:
incentives_type = incentives_type or (
ParanetIncentivizationType.NEUROWEB.value
Expand Down

0 comments on commit 5cbb2e9

Please sign in to comment.