mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 04:35:49 +00:00
Add better error for trying to encode invalid transactions (#2001)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user