Skip to content

Commit

Permalink
Import only the functions from ethersjs we need
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Jul 17, 2023
1 parent f09039f commit efa1dfa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/app-data",
"version": "1.0.0-rc.3",
"version": "1.0.0-rc.4",
"description": "CowProtocol AppData schema definitions",
"type": "module",
"source": "src/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/api/appDataToCid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ export async function _appDataToCidAux(
* @returns the IPFS CID v0 of the content
*/
async function _appDataToCid(fullAppDataJson: string): Promise<string> {
const { utils } = await import('ethers')
const { keccak256, toUtf8Bytes } = await import('ethers/lib/utils')

const appDataHex = await utils.keccak256(utils.toUtf8Bytes(fullAppDataJson))
const appDataHex = await keccak256(toUtf8Bytes(fullAppDataJson))
return appDataHexToCid(appDataHex)
}

Expand Down

0 comments on commit efa1dfa

Please sign in to comment.