mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-18 19:25:48 +00:00
Issue 2212. Improve NFToken.URI handling for empty and undefined values (#2218)
* Handle undefined and null values in transactions better.
This commit is contained in:
@@ -68,6 +68,26 @@ describe('NFTokenMint', function () {
|
||||
)
|
||||
})
|
||||
|
||||
it(`throws w/ URI being an empty string`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenMint',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
Sequence: 2470665,
|
||||
Flags: NFTokenMintFlags.tfTransferable,
|
||||
NFTokenTaxon: 0,
|
||||
Issuer: 'r9LqNeG6qHxjeUocjvVki2XR35weJ9mZgQ',
|
||||
TransferFee: 1,
|
||||
URI: '',
|
||||
} as any
|
||||
|
||||
assert.throws(
|
||||
() => validate(invalid),
|
||||
ValidationError,
|
||||
'NFTokenMint: URI must not be empty string',
|
||||
)
|
||||
})
|
||||
|
||||
it(`throws w/ URI not in hex format`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenMint',
|
||||
|
||||
Reference in New Issue
Block a user