mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 13:05:49 +00:00
Merge branch 'main' into export-AccountOffer
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# ripple-binary-codec Release History
|
||||
|
||||
## Unreleased
|
||||
- Added a clearer error message for trying to encode an invalid transaction. (Ex. With an incorrect TransactionType)
|
||||
|
||||
## 1.4.0 (2022-04-18)
|
||||
- Updated NFT definitions to match 1.9.0's breaking naming changes
|
||||
|
||||
|
||||
@@ -127,6 +127,15 @@ class STObject extends SerializedType {
|
||||
const associatedValue = field.associatedType.from(
|
||||
xAddressDecoded[field.name],
|
||||
)
|
||||
|
||||
if (associatedValue == undefined) {
|
||||
throw new TypeError(
|
||||
`Unable to interpret "${field.name}: ${
|
||||
xAddressDecoded[field.name]
|
||||
}".`,
|
||||
)
|
||||
}
|
||||
|
||||
if ((associatedValue as unknown as Bytes).name === 'UNLModify') {
|
||||
// triggered when the TransactionType field has a value of 'UNLModify'
|
||||
isUnlModify = true
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
const { throws } = require('assert')
|
||||
const {
|
||||
encodeForSigning,
|
||||
encodeForSigningClaim,
|
||||
@@ -65,6 +66,16 @@ describe('Signing data', function () {
|
||||
].join(''),
|
||||
)
|
||||
})
|
||||
|
||||
test('can fail gracefully for invalid TransactionType', function () {
|
||||
const invalidTransactionType = {
|
||||
...tx_json,
|
||||
TransactionType: 'NotAPayment',
|
||||
}
|
||||
|
||||
throws(() => encodeForSigning(invalidTransactionType), /NotAPayment/u)
|
||||
})
|
||||
|
||||
test('can create multi signing blobs', function () {
|
||||
const signingAccount = 'rJZdUusLDtY9NEsGea7ijqhVrXv98rYBYN'
|
||||
const signingJson = Object.assign({}, tx_json, { SigningPubKey: '' })
|
||||
|
||||
Reference in New Issue
Block a user