Compare commits

...

3 Commits

Author SHA1 Message Date
tequ
6467d7806c 4.1.1 2026-07-03 15:47:17 +09:00
tequ
919315ef69 Fix length validation error on HookName deletion (#71) 2026-07-03 14:50:05 +09:00
tequ
94751fc4bc 4.1.0 (#70) 2026-06-23 22:44:24 +09:00
9 changed files with 80 additions and 12 deletions

View File

@@ -4,7 +4,7 @@
name: Node.js CI
env:
XAHAUD_VERSION: 2026.6.16-dev+3330
XAHAUD_VERSION: 2026.6.21-release+3350
on:
push:

6
package-lock.json generated
View File

@@ -16048,7 +16048,7 @@
}
},
"packages/xahau": {
"version": "4.1.0-alpha.0",
"version": "4.1.1",
"license": "ISC",
"dependencies": {
"@scure/bip32": "^1.3.1",
@@ -16058,7 +16058,7 @@
"bignumber.js": "^9.0.0",
"eventemitter3": "^5.0.1",
"xahau-address-codec": "^5.0.0",
"xahau-binary-codec": "^2.2.0-alpha.0",
"xahau-binary-codec": "^2.2.0",
"xahau-keypairs": "^2.0.0"
},
"devDependencies": {
@@ -16091,7 +16091,7 @@
}
},
"packages/xahau-binary-codec": {
"version": "2.2.0-alpha.0",
"version": "2.2.0",
"license": "ISC",
"dependencies": {
"@xrplf/isomorphic": "^1.0.1",

View File

@@ -2,6 +2,8 @@
## Unreleased
## 2.1.0 (2026-06-23)
### Added
* Support for the Price Oracles amendment (XLS-47).

View File

@@ -1,6 +1,6 @@
{
"name": "xahau-binary-codec",
"version": "2.2.0-alpha.0",
"version": "2.2.0",
"description": "Xahau Network binary codec",
"files": [
"dist/*",

View File

@@ -1,9 +1,14 @@
# xrpl.js Release History
Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xrpl-announce) for release announcements. We recommend that xrpl.js (ripple-lib) users stay up-to-date with the latest stable release.
# xahau.js Release History
## Unreleased Changes
### 4.1.1 (2026-07-03)
### Fixed
* Fix HookName validation on HookName deletion
## 4.1.0 (2026-06-23)
### Added
* Support for HookOnV2 Amendment
* Support for IOUClaimReward Amendment

View File

@@ -1,6 +1,6 @@
{
"name": "xahau",
"version": "4.1.0-alpha.0",
"version": "4.1.1",
"license": "ISC",
"description": "A TypeScript/JavaScript API for interacting with the Xahau Network in Node.js and the browser",
"files": [
@@ -29,7 +29,7 @@
"bignumber.js": "^9.0.0",
"eventemitter3": "^5.0.1",
"xahau-address-codec": "^5.0.0",
"xahau-binary-codec": "^2.2.0-alpha.0",
"xahau-binary-codec": "^2.2.0",
"xahau-keypairs": "^2.0.0"
},
"devDependencies": {

View File

@@ -79,7 +79,11 @@ export function validateSetHook(tx: Record<string, unknown>): void {
`SetHook: HookNamespace in Hook must be a 256-bit (32-byte) hexadecimal value`,
)
}
if (HookName !== undefined && !HOOKNAME_REGEX.test(HookName)) {
if (
HookName !== undefined &&
HookName.length !== 0 &&
!HOOKNAME_REGEX.test(HookName)
) {
throw new ValidationError(
`SetHook: HookName in Hook must be a hex string of 8-32 hex characters`,
)

View File

@@ -135,4 +135,49 @@ describe('SetHook', function () {
},
TIMEOUT,
)
it('hook name update', async () => {
let setHookTx: SetHook = {
TransactionType: 'SetHook',
Account: wallet.classicAddress,
Hooks: [
{
Hook: {
CreateCode: acceptHook,
HookApiVersion: 0,
HookName: '484F4F4B',
HookOn: '00'.repeat(32),
HookNamespace: '00'.repeat(32),
},
},
],
}
await testTransaction(testContext.client, setHookTx, wallet)
{
const ledgerEntryResponse = await testContext.client.request({
command: 'ledger_entry',
hook: { account: wallet.classicAddress },
})
const node = ledgerEntryResponse.result.node as Hook
const hook = node.Hooks[0].Hook
expect(hook.HookName).toEqual('484F4F4B')
}
// delete HookName
setHookTx = {
TransactionType: 'SetHook',
Account: wallet.classicAddress,
Hooks: [{ Hook: { HookName: '' } }],
}
await testTransaction(testContext.client, setHookTx, wallet)
{
const ledgerEntryResponse = await testContext.client.request({
command: 'ledger_entry',
hook: { account: wallet.classicAddress },
})
const node = ledgerEntryResponse.result.node as Hook
const hook = node.Hooks[0].Hook
expect(hook.HookName).toBeUndefined()
}
})
})

View File

@@ -175,7 +175,7 @@ describe('SetHook', function () {
assert.throws(() => validate(setHookTx), ValidationError, errorMessage)
})
it.each(['', '0'.repeat(7), '0'.repeat(33), 'ZZZZZZZZ'])(
it.each(['00', '0000', '000000', '0'.repeat(7), '0'.repeat(33), 'ZZZZZZZZ'])(
`throws w/ invalid HookName in Hooks: %s`,
function (value: string) {
setHookTx.Hooks = [
@@ -195,4 +195,16 @@ describe('SetHook', function () {
assert.throws(() => validate(setHookTx), ValidationError, errorMessage)
},
)
it(`valid HookName "" (deletion) in Hooks`, function () {
setHookTx.Hooks = [
{
Hook: {
HookName: '',
},
},
]
assert.doesNotThrow(() => validateSetHook(setHookTx))
assert.doesNotThrow(() => validate(setHookTx))
})
})