mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Add parseNFTokenID and tests (#1961)
* Add parseNFTokenID and tests * Lint * Move parseNFTokenID to utils * Lint * Move the NFTokenID into models * Move NFTokenID type out of models * Lint * Remove extra type and lint
This commit is contained in:
27
packages/xrpl/test/utils/parseNFTokenID.ts
Normal file
27
packages/xrpl/test/utils/parseNFTokenID.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { assert } from 'chai'
|
||||
import { parseNFTokenID } from 'xrpl-local'
|
||||
|
||||
import { assertResultMatch } from '../testUtils'
|
||||
|
||||
describe('parseNFTokenID', function () {
|
||||
it('decode a valid NFTokenID', function () {
|
||||
const tokenID =
|
||||
'000B0539C35B55AA096BA6D87A6E6C965A6534150DC56E5E12C5D09E0000000C'
|
||||
const result = parseNFTokenID(tokenID)
|
||||
const expected = {
|
||||
TokenID: tokenID,
|
||||
Flags: 11,
|
||||
TransferFee: 1337,
|
||||
Issuer: 'rJoxBSzpXhPtAuqFmqxQtGKjA13jUJWthE',
|
||||
Taxon: 1337,
|
||||
Sequence: 12,
|
||||
}
|
||||
assertResultMatch(result, expected)
|
||||
})
|
||||
|
||||
it('fail when given invalid NFTokenID', function () {
|
||||
assert.throws(() => {
|
||||
parseNFTokenID('ABCD')
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user