Skip to content

Commit

Permalink
chore: bump sor to 4.14.1 - add bytes32 non-null terminator logging (#…
Browse files Browse the repository at this point in the history
…798)

- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
chore

- **What is the current behavior?** (You can also link to an open issue here)
we don't know which token had non-null terminator runtime error

- **What is the new behavior (if this is a feature change)?**
log it so that we know

- **Other information**:
  • Loading branch information
jsy1218 authored Jan 15, 2025
1 parent 3e5baf4 commit 0661027
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uniswap/smart-order-router",
"version": "4.14.0",
"version": "4.14.1",
"description": "Uniswap Smart Order Router",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down
27 changes: 24 additions & 3 deletions src/providers/token-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -898,9 +898,30 @@ export class TokenProvider implements ITokenProvider {
continue;
}

const symbol = isBytes32
? parseBytes32String(symbolResult.result[0]!)
: symbolResult.result[0]!;
let symbol;

try {
symbol = isBytes32
? parseBytes32String(symbolResult.result[0]!)
: symbolResult.result[0]!;
} catch (error) {
if (
error instanceof Error &&
error.message.includes(
'invalid bytes32 string - no null terminator'
)
) {
log.error(
{
symbolResult,
error,
},
`invalid bytes32 string - no null terminator`
);
}

throw error;
}
const decimal = decimalResult.result[0]!;

addressToToken[address.toLowerCase()] = new Token(
Expand Down

0 comments on commit 0661027

Please sign in to comment.