fix(cowSwapper): don't convert orderDigest to Uint8Array / hex #5382
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Web counterpart of shapeshift/hdwallet#635 - open me after it is published
tl;dr is we're currently doing a triple conversion of the
orderDigest
which is useless, as it comes as an hex string already.While this is theoretically only useless back and forth conversions which wouldn't break the flow, unfortunately, we're doing one too much here, meaning this isn't only some benign perf. bottleneck, but an actual product bug.
The conversion is made:
executeEvmMessage
(see this PR's diff)ethSignMessage
. e.g WCV2 implementation from a Uint8Array to a Uint8Array (?), then an hex string out of thatshapeshift/hdwallet#635 lays the groundwork for not converting things, but web is the missing bit. This PR fixes things here, by making sure we pass an hexlified string all around.
Pull Request Type
Issue (if applicable)
closes N/A
Risk
Risk of CoW swaps / ETH messages signing all around. In effect, this means Wherever may be broken across all wallets, and CoW swaps may be broken in other wallets - test accordingly
Testing
Engineering
Operations
Screenshots (if applicable)
https://explorer.cow.fi/gc/orders/0xa476f5b1e4508ad48ad988628a1a68243c08d4a0b9f8a5fe24e68157f86ad1855daf465a9ccf64deb146eeae9e7bd40d6761c986651a9520?tab=overview