From ee49080d9883342c313505c419bc2f726155a3b9 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Mon, 8 Jul 2024 18:23:34 -0300 Subject: [PATCH] Re-adjusting query limits --- packages/account/src/account.test.ts | 12 ++++++------ packages/account/src/account.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/account/src/account.test.ts b/packages/account/src/account.test.ts index e447c4a70c..98ce2e8896 100644 --- a/packages/account/src/account.test.ts +++ b/packages/account/src/account.test.ts @@ -73,7 +73,7 @@ describe('Account', () => { expect(assetC?.amount.gt(1)).toBeTruthy(); }); - it('should throw if coins length is higher than 100', async () => { + it('should throw if coins length is higher than 512', async () => { const dummyCoins: Coin[] = new Array(10000); vi.spyOn(Provider.prototype, 'getCoins').mockImplementation(async () => @@ -96,7 +96,7 @@ describe('Account', () => { expect(result).toBeUndefined(); expect((error).message).toEqual( - 'Wallets containing more than 100 coins exceed the current supported limit.' + 'Wallets containing more than 512 coins exceed the current supported limit.' ); }); @@ -139,7 +139,7 @@ describe('Account', () => { expect(messages.length).toEqual(1); }); - it('should throw if messages length is higher than 100', async () => { + it('should throw if messages length is higher than 512', async () => { const dummyMessages: Message[] = new Array(10000); vi.spyOn(Provider.prototype, 'getMessages').mockImplementation(async () => @@ -162,7 +162,7 @@ describe('Account', () => { expect(result).toBeUndefined(); expect((error).message).toEqual( - 'Wallets containing more than 100 messages exceed the current supported limit.' + 'Wallets containing more than 512 messages exceed the current supported limit.' ); }); @@ -186,7 +186,7 @@ describe('Account', () => { expect(balances.length).toBeGreaterThanOrEqual(1); }); - it('should throw if balances length is higher than 100', async () => { + it('should throw if balances length is higher than 9999', async () => { const dummyBalances: CoinQuantity[] = new Array(10000); vi.spyOn(Provider.prototype, 'getBalances').mockImplementation(async () => @@ -208,7 +208,7 @@ describe('Account', () => { expect(result).toBeUndefined(); expect((error).message).toEqual( - 'Wallets containing more than 100 balances exceed the current supported limit.' + 'Wallets containing more than 9999 balances exceed the current supported limit.' ); }); diff --git a/packages/account/src/account.ts b/packages/account/src/account.ts index 6cb2cf7b53..6e4117da77 100644 --- a/packages/account/src/account.ts +++ b/packages/account/src/account.ts @@ -151,7 +151,7 @@ export class Account extends AbstractAccount { async getCoins(assetId?: BytesLike): Promise { const coins = []; - const pageSize = 100; + const pageSize = 512; let cursor; // eslint-disable-next-line no-unreachable-loop for (;;) { @@ -185,7 +185,7 @@ export class Account extends AbstractAccount { async getMessages(): Promise { const messages = []; - const pageSize = 100; + const pageSize = 512; let cursor; // eslint-disable-next-line no-unreachable-loop for (;;) { @@ -231,7 +231,7 @@ export class Account extends AbstractAccount { async getBalances(): Promise { const balances = []; - const pageSize = 100; + const pageSize = 9999; let cursor; // eslint-disable-next-line no-unreachable-loop for (;;) {