From 9c420bd7f438cd803e7d7e420c3402cf6e1327a0 Mon Sep 17 00:00:00 2001 From: Fantomasa Date: Thu, 13 Aug 2026 11:03:19 +0300 Subject: [PATCH] fix: accept omitted liveHashes field in AccountInfoQuery test Signed-off-by: Fantomasa --- .../crypto-service/AccountInfoQuery.md | 4 ++-- src/tests/crypto-service/test-account-info-query.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/test-specifications/crypto-service/AccountInfoQuery.md b/docs/test-specifications/crypto-service/AccountInfoQuery.md index 5b3099dd..f86bf232 100644 --- a/docs/test-specifications/crypto-service/AccountInfoQuery.md +++ b/docs/test-specifications/crypto-service/AccountInfoQuery.md @@ -54,7 +54,7 @@ https://github.com/hashgraph/hedera-protobufs/blob/main/services/response_code.p | isReceiverSignatureRequired | boolean | If true, no transaction can transfer to this account unless signed by this account's key. | | expirationTime | string | The time at which this account is set to expire. | | autoRenewPeriod | string | The duration for expiration time will extend every this many seconds. | -| liveHashes | array | All of the livehashes attached to the account (each livehash contains accountId, hash, keys, duration). | +| liveHashes | array | All of the livehashes attached to the account (each livehash contains accountId, hash, keys, duration). Live hashes are a retired network feature; SDKs that removed the deprecated API omit this field. | | tokenRelationships | map | All tokens related to this account (map of token IDs to token relationship info including balance, KYC status, freeze status, etc.). | | accountMemo | string | The memo associated with the account. | | ownedNfts | string | The number of NFTs owned by this account. | @@ -93,7 +93,7 @@ https://github.com/hashgraph/hedera-protobufs/blob/main/services/response_code.p | 16 | Query account info and verify isReceiverSignatureRequired is true | accountId= | The account info query succeeds and returns isReceiverSignatureRequired=true | Y | | 17 | Query account info and verify expirationTime is returned | accountId= | The account info query succeeds and returns the account expiration timestamp | Y | | 18 | Query account info and verify autoRenewPeriod is returned | accountId= | The account info query succeeds and returns the account autoRenewPeriod in seconds | Y | -| 19 | Query account info and verify liveHashes is returned | accountId= | The account info query succeeds and returns liveHashes array (empty if none) | Y | +| 19 | Query account info and verify liveHashes is returned | accountId= | The account info query succeeds; SDKs still exposing the retired live hash API return a liveHashes array (empty if none), other SDKs omit the field | Y | | 20 | Query account info and verify tokenRelationships is returned | accountId= | The account info query succeeds and returns tokenRelationships map (empty if none) | Y | | 21 | Query account info and verify tokenRelationships with tokens | accountId= | The account info query succeeds and returns tokenRelationships with token data | Y | | 22 | Query account info and verify accountMemo is returned | accountId= | The account info query succeeds and returns accountMemo (empty if not set) | Y | diff --git a/src/tests/crypto-service/test-account-info-query.ts b/src/tests/crypto-service/test-account-info-query.ts index 65228773..62188c9c 100644 --- a/src/tests/crypto-service/test-account-info-query.ts +++ b/src/tests/crypto-service/test-account-info-query.ts @@ -339,6 +339,9 @@ describe("AccountInfoQuery", function () { }); it("(#19) Query account info and verify liveHashes is returned", async function () { + // Live hashes are a retired network feature. SDKs that removed the + // deprecated live hash API (e.g. JS SDK >= 2.87.0) omit the field from + // the response; SDKs that still expose it must return an array. const accountPrivateKey = await generateEd25519PrivateKey(this); const accountResponse = await JSONRPCRequest(this, "createAccount", { key: accountPrivateKey, @@ -349,8 +352,9 @@ describe("AccountInfoQuery", function () { accountId: accountId, }); - expect(response).to.have.property("liveHashes"); - expect(response.liveHashes).to.be.an("array"); + if ("liveHashes" in response) { + expect(response.liveHashes).to.be.an("array"); + } }); it("(#20) Query account info and verify tokenRelationships is returned", async function () {