From 60de0f6192812723fda2e4db36db24bc1c6b5042 Mon Sep 17 00:00:00 2001 From: karczuRF <88723742+karczuRF@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:43:24 +0200 Subject: [PATCH] fix(provider): list substates (#131) Description --- Fix `listSubstates` args. Should use bigint from number or null. Motivation and Context --- Error occurs if TU Provider calls `listSubstate` function with null for `limit` or `offset` How Has This Been Tested? --- Manually tested with TU templates. What process can a PR reviewer use to test or verify this change? --- Pull this branch, build and use locally with any template which uses `lisSubstates` Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify --- src/provider/TariUniverseProvider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/provider/TariUniverseProvider.ts b/src/provider/TariUniverseProvider.ts index 7873fa7..0f466e8 100644 --- a/src/provider/TariUniverseProvider.ts +++ b/src/provider/TariUniverseProvider.ts @@ -192,8 +192,8 @@ export class WalletDaemonTariProvider implements TariProvider { const res = await this.client.substatesList({ filter_by_template, filter_by_type, - limit: BigInt(limit ?? 0), - offset: BigInt(offset ?? 0), + limit: limit ? BigInt(limit) : null, + offset: offset ? BigInt(offset) : null, }) const substates = res.substates.map((s) => ({ substate_id: substateIdToString(s.substate_id),