mirror of
				https://github.com/Xahau/xahau.js.git
				synced 2025-11-04 04:55:48 +00:00 
			
		
		
		
	Add more unit test for DynamicNFT (#2892)
* Add more unit test for DynamicNFT * resolve comment
This commit is contained in:
		@@ -11,7 +11,7 @@
 | 
			
		||||
 | 
			
		||||
### Added
 | 
			
		||||
* Support for the Price Oracles amendment (XLS-47).
 | 
			
		||||
* Add `NFTokenModify` transaction and add `tfMutable` flag in `NFTokenMint`
 | 
			
		||||
* Support for the `DynamicNFT` amendment (XLS-46)
 | 
			
		||||
 | 
			
		||||
### Fixed
 | 
			
		||||
* Better error handling/error messages for serialization/deserialization errors.
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
 | 
			
		||||
* New `MPTAmount` type support for `Payment` and `Clawback` transactions
 | 
			
		||||
* `parseTransactionFlags` as a utility function in the xrpl package to streamline transactions flags-to-map conversion
 | 
			
		||||
* Support for XLS-70d (Credentials)
 | 
			
		||||
* Add `NFTokenModify` transaction and add `tfMutable` flag in `NFTokenMint`
 | 
			
		||||
* Support for the `DynamicNFT` amendment (XLS-46)
 | 
			
		||||
 | 
			
		||||
### Fixed
 | 
			
		||||
* `TransactionStream` model supports APIv2
 | 
			
		||||
 
 | 
			
		||||
@@ -38,7 +38,7 @@ export interface NFTokenModify extends BaseTransaction {
 | 
			
		||||
   * convert this field to the proper encoding.
 | 
			
		||||
   *
 | 
			
		||||
   * This field must not be an empty string. Omit it from the transaction or
 | 
			
		||||
   * set to `undefined` value if you do not use it.
 | 
			
		||||
   * set to `null` if you do not use it.
 | 
			
		||||
   */
 | 
			
		||||
  URI?: string | null
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -38,4 +38,38 @@ describe('NFTokenModify', function () {
 | 
			
		||||
      'NFTokenModify: missing field NFTokenID',
 | 
			
		||||
    )
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it(`throws w/ URI being an empty string`, function () {
 | 
			
		||||
    const invalid = {
 | 
			
		||||
      TransactionType: 'NFTokenModify',
 | 
			
		||||
      Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
 | 
			
		||||
      NFTokenID: TOKEN_ID,
 | 
			
		||||
      Fee: '5000000',
 | 
			
		||||
      Sequence: 2470665,
 | 
			
		||||
      URI: '',
 | 
			
		||||
    } as any
 | 
			
		||||
 | 
			
		||||
    assert.throws(
 | 
			
		||||
      () => validate(invalid),
 | 
			
		||||
      ValidationError,
 | 
			
		||||
      'NFTokenModify: URI must not be empty string',
 | 
			
		||||
    )
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it(`throws w/ URI not in hex format`, function () {
 | 
			
		||||
    const invalid = {
 | 
			
		||||
      TransactionType: 'NFTokenModify',
 | 
			
		||||
      Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
 | 
			
		||||
      NFTokenID: TOKEN_ID,
 | 
			
		||||
      Fee: '5000000',
 | 
			
		||||
      Sequence: 2470665,
 | 
			
		||||
      URI: '--',
 | 
			
		||||
    } as any
 | 
			
		||||
 | 
			
		||||
    assert.throws(
 | 
			
		||||
      () => validate(invalid),
 | 
			
		||||
      ValidationError,
 | 
			
		||||
      'NFTokenModify: URI must be in hex format',
 | 
			
		||||
    )
 | 
			
		||||
  })
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user