diff --git a/src/monitoring_tests/cowamm_commitment_test.py b/src/monitoring_tests/cowamm_commitment_test.py index 805c321..a34e3ac 100644 --- a/src/monitoring_tests/cowamm_commitment_test.py +++ b/src/monitoring_tests/cowamm_commitment_test.py @@ -1,5 +1,5 @@ """ -Checks that surplus of CoW AMM jit orders equals nonlinear surplus. +Checks that commitments for custom CoW AMM of CoW AMM orders are reset. """ # pylint: disable=duplicate-code from typing import Any @@ -17,9 +17,11 @@ class CoWAMMCommitmentTest(BaseTest): - """ - This test checks whether the Uniform Directed Prices constraint, - as introduced in CIP-38, is satisfied. + """Checks that commitments for custom CoW AMM of CoW AMM orders are reset + + Whenever a preinteraction calling the commit functinon of the (old) CoW AMM smart contract is + called, the currently commit order on the corresponding CoW AMM is checked. If the commited + order is not equal to the default order, the commitment was not reset. """ def __init__(self) -> None: @@ -31,9 +33,15 @@ def __init__(self) -> None: ) def check_commitments(self, settlement: dict[str, Any]) -> bool: - """ - This function checks whether there are multiple orders in the same directed token pair, - and if so, checks whether UDP is satisfied. + """Checks the commitment of CoW AMM orders. + + If there is a preinteraction with a call to the commit function of the CoW AMM contant + product smart contract, the commitment of that AMM is checked at the current point in + time. + + This is not a check for including a commit in post interactions or within interactions. + It also does not check if the uncommit happened immediately, but just checks if the + current commitment is to the default order. """ # iterate over pre-interactions for interaction in settlement["interactions"][0]: @@ -80,8 +88,8 @@ def get_commitment(self, cowamm: str) -> str | None: def run(self, tx_hash: str) -> bool: """ - Wrapper function for the whole test. Checks if violation is more than - UDP_SENSITIVITY_THRESHOLD, in which case it generates an alert. + Wrapper function for the whole test. Checks that commitments for custom CoW AMM of CoW + AMM orders are reset """ transaction = self.web3_api.get_transaction(tx_hash)