-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(utils): remove hash utils and ethers (#1783)
- Loading branch information
Showing
5 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
"@latticexyz/utils": major | ||
--- | ||
|
||
Removed `keccak256` and `keccak256Coord` hash utils in favor of [viem's `keccak256`](https://viem.sh/docs/utilities/keccak256.html#keccak256). | ||
|
||
```diff | ||
- import { keccak256 } from "@latticexyz/utils"; | ||
+ import { keccak256, toHex } from "viem"; | ||
|
||
- const hash = keccak256("some string"); | ||
+ const hash = keccak256(toHex("some string")); | ||
``` | ||
|
||
```diff | ||
- import { keccak256Coord } from "@latticexyz/utils"; | ||
+ import { encodeAbiParameters, keccak256, parseAbiParameters } from "viem"; | ||
|
||
const coord = { x: 1, y: 1 }; | ||
- const hash = keccak256Coord(coord); | ||
+ const hash = keccak256(encodeAbiParameters(parseAbiParameters("int32, int32"), [coord.x, coord.y])); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.