From 8f0580f68330335880dd14fa7289baa39698f6fa Mon Sep 17 00:00:00 2001 From: Mariusz Jasuwienas Date: Wed, 29 Jan 2025 14:37:53 +0100 Subject: [PATCH] fix: returning correct ledger id for localnode (#163) Signed-off-by: Mariusz Jasuwienas --- test/getHtsStorageAt.test.js | 3 +++ test/scripts/json-rpc-mock.js | 3 +++ test/slotMapOf.test.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/getHtsStorageAt.test.js b/test/getHtsStorageAt.test.js index bf5cc316..6417e5d6 100644 --- a/test/getHtsStorageAt.test.js +++ b/test/getHtsStorageAt.test.js @@ -42,6 +42,9 @@ describe('::getHtsStorageAt', function () { /** @type {IMirrorNodeClient} */ const mirrorNodeClientStub = { + getLedgerId() { + return '0x00'; // Keep it mocked with default value. + }, async getTokenById(_tokenId) { throw Error('Not implemented'); }, diff --git a/test/scripts/json-rpc-mock.js b/test/scripts/json-rpc-mock.js index 2142ac44..8727f080 100755 --- a/test/scripts/json-rpc-mock.js +++ b/test/scripts/json-rpc-mock.js @@ -94,6 +94,9 @@ const mirrorNodeClient = { append(method, ...args) { this.requests.push(`${method}:${args.join(',')}`); }, + getLedgerId() { + return '0x00'; + }, async getTokenById(tokenId) { this.append('getTokenById', tokenId); if (tokens[tokenId] === undefined) return null; diff --git a/test/slotMapOf.test.js b/test/slotMapOf.test.js index be04ee23..4eec346b 100644 --- a/test/slotMapOf.test.js +++ b/test/slotMapOf.test.js @@ -31,7 +31,7 @@ describe('::slotmap', function () { ['MFCT', 'USDC'].forEach(symbol => { describe(symbol, function () { it(`should have valid slot fields`, async function () { - const map = slotMapOf(require(`../test/data/${symbol}/getToken.json`)); + const map = slotMapOf(require(`../test/data/${symbol}/getToken.json`), '0x00'); [...map._map.entries()].forEach(([slot, values]) => { expect(slot).to.be.not.undefined;