Skip to content

Commit

Permalink
fix: returning correct ledger id for localnode (#163)
Browse files Browse the repository at this point in the history
Signed-off-by: Mariusz Jasuwienas <[email protected]>
  • Loading branch information
arianejasuwienas committed Jan 29, 2025
1 parent 05905ed commit 8f0580f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/getHtsStorageAt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
},
Expand Down
3 changes: 3 additions & 0 deletions test/scripts/json-rpc-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/slotMapOf.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8f0580f

Please sign in to comment.