Skip to content

Commit

Permalink
Revert "get rid of oz test helpers"
Browse files Browse the repository at this point in the history
This reverts commit 51ec003.
  • Loading branch information
talentlessguy committed Jun 27, 2024
1 parent b6a36c2 commit ebbe245
Show file tree
Hide file tree
Showing 4 changed files with 4,103 additions and 982 deletions.
8 changes: 7 additions & 1 deletion examples/basic-tsnode-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
"@ensdomains/ensjs": "workspace:*",
"ts-node": "^10.7.0",
"typescript": "^5.0.4",
"viem": "^1.2.9"
"viem": "^1.2.9",
"node-fetch": "2.6.7"
},
"pnpm": {
"overrides": {
"node-fetch": "2.6.7"
}
}
}
22 changes: 2 additions & 20 deletions packages/ensjs/deploy/00_deploy_bulk_renewal.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,14 @@
const { Interface } = require('ethers/lib/utils')
const { ethers } = require('hardhat')
const { namehash, labelhash } = require('viem/ens')
const { keccak256 } = require('viem')

function makeInterfaceId(functionSignatures = []) {
const INTERFACE_ID_LENGTH = 4

const interfaceIdBuffer = functionSignatures
.map((signature) => keccak256(signature)) // keccak256
.map(
(h) => Buffer.from(h.substring(2), 'hex').subarray(0, 4), // bytes4()
)
.reduce((memo, bytes) => {
// eslint-disable-next-line no-plusplus
for (let i = 0; i < INTERFACE_ID_LENGTH; i++) {
memo[i] ^= bytes[i] // xor
}
return memo
}, Buffer.alloc(INTERFACE_ID_LENGTH))

return `0x${interfaceIdBuffer.toString('hex')}`
}
const { makeInterfaceId } = require('@openzeppelin/test-helpers')

/**
* @param {import('ethers/lib/utils').Interface} iface
*/
function computeInterfaceId(iface) {
return makeInterfaceId(
return makeInterfaceId.ERC165(
Object.values(iface.functions).map((frag) => frag.format('sighash')),
)
}
Expand Down
8 changes: 3 additions & 5 deletions packages/ensjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,16 @@
"abitype": "^1.0.0",
"dns-packet": "^5.3.1",
"graphql": "^16.3.0",
"graphql-request": "7.1.0",
"graphql-request": "6.1.0",
"pako": "^2.1.0"
},
"devDependencies": {
"@ensdomains/buffer": "^0.1.1",
"@ensdomains/buffer": "^0.0.13",
"@ensdomains/ens-contracts": "1.0.0",
"@ensdomains/ens-test-env": "workspace:*",
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers",
"@openzeppelin/contracts": "^4.5.0",
"@openzeppelin/test-helpers": "^0.5.16",
"@swc/core": "^1.3.61",
"@types/bn.js": "^5.1.0",
"@types/jsonfile": "^6.1.4",
Expand Down Expand Up @@ -142,8 +143,5 @@
},
"peerDependencies": {
"viem": "^2.9.2"
},
"engines": {
"node": ">=18"
}
}
Loading

0 comments on commit ebbe245

Please sign in to comment.