fix isKnownContract validation

This commit is contained in:
smart_ex 2022-04-18 17:18:57 +10:00 committed by Danil Kovtonyuk
parent ed9f003d50
commit ecdcb545fc
4 changed files with 26 additions and 12 deletions

View file

@ -15,7 +15,13 @@ describe('Validator', () => {
'.proof should match pattern "^0x[a-fA-F0-9]{512}$"',
)
})
it('should throw if unknown contract', () => {
const malformedData = { ...withdrawData }
malformedData.contract = '0xf17f52151ebef6c7334fad080c5704d77216b732'
getTornadoWithdrawInputError(malformedData).should.be.equal(
'.contract should pass "isKnownContract" keyword validation',
)
})
it('should throw something is missing', () => {
const malformedData = { ...withdrawData }
delete malformedData.proof