fix: a V4 swap action not in the deployed shape is shown as not decoded (closes #358)
The four V4 swap actions are read only as the parameter structs deployed on mainnet and Sepolia. ethers decoded the newer v4-periphery structs, which add minHopPriceX36, as the deployed ones without an error, and the newer multi-hop exact-in struct showed the offset of its hop-price array as the swap amount. A decode now counts only when encoding it again gives back the same bytes. When a swap action fails that, its step is listed as "V4 Swap (could not be decoded)", and a token line left without a currency reads "Unknown (could not be decoded)" rather than "not named in the calldata". The README records both. Model: opus-5-5
This commit is contained in:
@@ -97,7 +97,11 @@ describe("an execute() whose input currency never decoded", () => {
|
||||
]);
|
||||
|
||||
test("says the input token is unknown instead of naming ETH", () => {
|
||||
expect(detail(data(), "Token In").value).toBe(REFUSAL);
|
||||
// The swap action that would name it could not be read, so the line
|
||||
// says that rather than REFUSAL's "not named in the calldata".
|
||||
expect(detail(data(), "Token In").value).toBe(
|
||||
"Unknown (could not be decoded)",
|
||||
);
|
||||
});
|
||||
|
||||
test("keeps a Token In line, so the screen never omits what is paid", () => {
|
||||
|
||||
Reference in New Issue
Block a user