fix: renames verify... methods to validate... (#1624)

* rename verify -> validate

* fix imports

* run eslint --fix on test/
This commit is contained in:
Mayukha Vadari
2021-09-16 21:14:22 -04:00
parent eb0445817e
commit 13c52859eb
51 changed files with 423 additions and 461 deletions

View File

@@ -1,10 +1,8 @@
import { assert } from 'chai'
import { validate, validateSetRegularKey } from 'xrpl-local'
import { ValidationError } from 'xrpl-local/common/errors'
import { verify } from '../../src/models/transactions'
import { verifySetRegularKey } from '../../src/models/transactions/setRegularKey'
/**
* SetRegularKey Transaction Verification Testing.
*
@@ -24,26 +22,26 @@ describe('SetRegularKey', function () {
})
it(`verifies valid SetRegularKey`, function () {
assert.doesNotThrow(() => verifySetRegularKey(account))
assert.doesNotThrow(() => verify(account))
assert.doesNotThrow(() => validateSetRegularKey(account))
assert.doesNotThrow(() => validate(account))
})
it(`verifies w/o SetRegularKey`, function () {
account.RegularKey = undefined
assert.doesNotThrow(() => verifySetRegularKey(account))
assert.doesNotThrow(() => verify(account))
assert.doesNotThrow(() => validateSetRegularKey(account))
assert.doesNotThrow(() => validate(account))
})
it(`throws w/ invalid RegularKey`, function () {
account.RegularKey = 12369846963
assert.throws(
() => verifySetRegularKey(account),
() => validateSetRegularKey(account),
ValidationError,
'SetRegularKey: RegularKey must be a string',
)
assert.throws(
() => verify(account),
() => validate(account),
ValidationError,
'SetRegularKey: RegularKey must be a string',
)