cowprotocol / cow-sdk

CoW protocol SDK
https://docs.cow.fi/cow-protocol/reference/sdks/cow-sdk
Other
31 stars 9 forks source link

fix: cabinet comparitor #172

Closed mfw78 closed 11 months ago

mfw78 commented 11 months ago

Problem Previously, the guard for an epoch of zero wasn't triggering as the return value of the cabinet was of type BigNumber and the number comparison to 0 would never trigger due to not being of type number.

Solution This PR correctly handles the bignumber to number marshalling and guards against out-of-range conditions. As there is an interface requirement for the cabinet to be set if the order is of start mining time type, any order that doesn't meet this is requirement is automatically removed from the watch-tower.

coveralls commented 11 months ago

Coverage Status

coverage: 79.051% (+0.6%) from 78.445% when pulling 9445824c4d1de0b5830cec0e0dc14b7a57844dc0 on enforce-interface into 8652d2f7d39127dc5bc7277f2ce6c2356dda3bd0 on main.