cowprotocol / cow-sdk

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

Misc and close SDK version #170

Closed anxolin closed 11 months ago

anxolin commented 12 months ago

This PR tries to close the SDK release v3.0.0

For that, I'm ensuring the Tenderly Watch Tower project works great with this version.

This PR does some small MISC in order to consider 3.0.0 ready!

Fix compute UID

The compute UID was not working. The struct needs be converted into an order (mapping some fields).

From struct to order + Tests

Created some util to convert order structs to orders.

Additionally, I did some unit test for it.

Improves the toString

toString is traditionally used to ready in the logs the details of the object. I felt it was a bit hard to read the older version, plus logging tools have a harder time parsing the values to make it easier to search

Also, the toString was not including some fields, like the receiver or the appData.

For this reason, I modified the implementation to serialise a JSON describing the TWAP:

Before: image

After: image

Added more tests for the TWAP toString

It tests the basic default, and setting custom start time, and limiting the duration.

Close version v3.0.0

This PR version will be tagged as v3.0.0

Test

I tried this PR against watch tower (this is how i found so many issues!

Now all looks SOLID ✅!

image
github-actions[bot] commented 12 months ago

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

coveralls commented 12 months ago

Coverage Status

coverage: 78.445% (-0.7%) from 79.121% when pulling 7192140b193db29cc774161606dcc2d306dab58c on release/v3.0 into f5c5d40913aedb8cc2072debab75190668aa9745 on main.

socket-security[bot] commented 12 months ago

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: add@2.0.6

mfw78 commented 11 months ago

@anxolin Kindly please sign CLA :pray: :sweat_smile: