Update CoordinatorAgent and MockCoordinatorAgent initiateRitual calls to include fee model contract.

pull/3554/head
derekpierre 2024-06-28 11:07:40 -04:00
parent b8e0fac04e
commit 7f636613f1
No known key found for this signature in database
2 changed files with 3 additions and 15 deletions

View File

@ -722,6 +722,7 @@ class CoordinatorAgent(EthereumContractAgent):
@contract_api(TRANSACTION)
def initiate_ritual(
self,
fee_model: ChecksumAddress,
providers: List[ChecksumAddress],
authority: ChecksumAddress,
duration: int,
@ -729,7 +730,7 @@ class CoordinatorAgent(EthereumContractAgent):
transacting_power: TransactingPower,
) -> TxReceipt:
contract_function: ContractFunction = self.contract.functions.initiateRitual(
providers, authority, duration, access_controller
fee_model, providers, authority, duration, access_controller
)
receipt = self.blockchain.send_transaction(
contract_function=contract_function, transacting_power=transacting_power
@ -780,15 +781,6 @@ class CoordinatorAgent(EthereumContractAgent):
)
return async_tx
@contract_api(CONTRACT_CALL)
def get_ritual_initiation_cost(
self, providers: List[ChecksumAddress], duration: int
) -> Wei:
result = self.contract.functions.getRitualInitiationCost(
providers, duration
).call()
return Wei(result)
@contract_api(CONTRACT_CALL)
def get_ritual_id_from_public_key(self, public_key: DkgPublicKey) -> int:
g1_point = Ferveo.G1Point.from_dkg_public_key(public_key)

View File

@ -86,6 +86,7 @@ class MockCoordinatorAgent(MockContractAgent):
def initiate_ritual(
self,
fee_model: ChecksumAddress,
providers: List[ChecksumAddress],
authority: ChecksumAddress,
duration: int,
@ -317,8 +318,3 @@ class MockCoordinatorAgent(MockContractAgent):
) -> bool:
# always allow
return True
def get_ritual_initiation_cost(
self, providers: List[ChecksumAddress], duration: int
):
return len(providers) * duration