Skip to content

Commit

Permalink
better rejectedWith strings (#108)
Browse files Browse the repository at this point in the history
Co-authored-by: kbrav <>
  • Loading branch information
kbrav authored Apr 30, 2022
1 parent 100c8c5 commit e563bce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions test/dmap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,21 +291,22 @@ describe('dmap', ()=>{
const calldata = pair_i.encodeFunctionData("pair", [ALI, name])
await want(ali.sendTransaction(
{to: dmap.address, data: calldata.slice(0, calldata.length)}
)).rejectedWith('revert')
)).rejectedWith('reverted without a reason string')
await want(ali.sendTransaction(
{to: dmap.address, data: calldata + '00'}
)).rejectedWith('revert')
await want(ali.sendTransaction({to: dmap.address, data: calldata})).rejectedWith('revert')
)).rejectedWith('reverted without a reason string')
await want(ali.sendTransaction({to: dmap.address, data: calldata}))
.rejectedWith('reverted without a reason string')
})

it('set', async () => {
const calldata = dmap_i.encodeFunctionData("set", [name, name, name])
await want(ali.sendTransaction(
{to: dmap.address, data: calldata.slice(0, calldata.length - 2)}
)).rejectedWith('revert')
)).rejectedWith('reverted without a reason string')
await want(ali.sendTransaction(
{to: dmap.address, data: calldata + '00'}
)).rejectedWith('revert')
)).rejectedWith('reverted without a reason string')
await ali.sendTransaction({to: dmap.address, data: calldata})
})

Expand All @@ -321,7 +322,7 @@ describe('dmap', ()=>{
const calldata = dmap_i.encodeFunctionData("get", [name])
await want(ali.sendTransaction(
{to: dmap.address, data: calldata.slice(0, calldata.length - 2)}
)).rejectedWith('revert')
)).rejectedWith('reverted without a reason string')
await ali.sendTransaction({to: dmap.address, data: calldata.slice(0, calldata.length)})
})
})
Expand Down
2 changes: 1 addition & 1 deletion test/root-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('rootzone', ()=>{
await wait(hh, delay_period)
const commitment = getCommitment(b32('free'), zone1)
await send(rootzone.hark, commitment, { value: ethers.utils.parseEther('1') })
await fail('revert', rootzone.etch, b32('salt'), b32('free'), zone1)
await fail('LOCK', rootzone.etch, b32('salt'), b32('free'), zone1)
await check_entry(dmap, rootzone.address, b32('zone1'), constants.HashZero, constants.HashZero)
})

Expand Down

0 comments on commit e563bce

Please sign in to comment.