Skip to content

Commit

Permalink
ens-test-env stops when error is thrown in script
Browse files Browse the repository at this point in the history
  • Loading branch information
storywithoutend committed Oct 15, 2024
1 parent 13179f2 commit f401985
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/ens-test-env/src/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ const awaitCommand = async (name, command) => {
deploy.stdout.pipe(outPrepender).pipe(process.stdout)
}
deploy.stderr.pipe(errPrepender).pipe(process.stderr)
deploy.stderr.on('data', cleanup.bind(null, { exit: true }))
return new Promise((resolve) => deploy.on('exit', () => resolve()))
}

Expand Down
10 changes: 7 additions & 3 deletions packages/ensjs/deploy/01_delete_names.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ const func = async function (hre) {
const label = labelhash(labels.shift())
const node = namehash(labels.join('.'))

console.log("--------------- DELETE NAME ---------------")


const tx = await registry.setSubnodeRecord(
node,
label,
Expand All @@ -58,6 +55,13 @@ const func = async function (hre) {
await deleteName(name1)
await deleteName(name2)

for (const name of [name1, name2]) {
const owner = await registry.owner(namehash(name))
if (owner !== EMPTY_ADDRESS) {
throw new Error(`Failed to delete name ${name}`)
}
}

return true
}

Expand Down

0 comments on commit f401985

Please sign in to comment.