Files
xahau.js/test/models/checkCancel.ts
Mayukha Vadari 6eec7b0b77 refactor: move everything out of the common folder (#1629)
* remove common/constants (all in models now)

* remove common/txFlags (all in models now)

* move ecdsa from src/common to src

* move errors from src/common to src, export at top level
2021-10-04 14:10:13 -04:00

42 lines
1.2 KiB
TypeScript

import { assert } from 'chai'
import { validateCheckCancel, validate, ValidationError } from 'xrpl-local'
/**
* CheckCancel Transaction Verification Testing.
*
* Providing runtime verification testing for each specific transaction type.
*/
describe('CheckCancel', function () {
it(`verifies valid CheckCancel`, function () {
const validCheckCancel = {
Account: 'rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo',
TransactionType: 'CheckCancel',
CheckID:
'49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0',
} as any
assert.doesNotThrow(() => validateCheckCancel(validCheckCancel))
assert.doesNotThrow(() => validate(validCheckCancel))
})
it(`throws w/ invalid CheckCancel`, function () {
const invalidCheckID = {
Account: 'rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo',
TransactionType: 'CheckCancel',
CheckID: 4964734566545678,
} as any
assert.throws(
() => validateCheckCancel(invalidCheckID),
ValidationError,
'CheckCancel: invalid CheckID',
)
assert.throws(
() => validate(invalidCheckID),
ValidationError,
'CheckCancel: invalid CheckID',
)
})
})