Skip to content

Commit

Permalink
refactor: vault pagination as string input
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinWoetzel committed Apr 22, 2024
1 parent a5984bb commit 3a9138b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/contracts/definitions/lend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ test('it tests the form of the vault info message', () => {
});

test('it tests the form of the multiple vaults info message', () => {
const inputStartingPageNumber = 1;
const inputStartingPageNumber = '1';

const output = {
vaults: {
starting_page: '1',
starting_page: inputStartingPageNumber,
},
};
expect(msgGetVaults(inputStartingPageNumber)).toStrictEqual(output);
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/definitions/lend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const msgGetVault = (vaultId: string) => ({
/**
* message for the getting multiple vaults info.
* @param startingPage The data is paginated and returned
* for the starting page and all pages after. Use 1 to query all vaults.
* for the starting page and all pages after. Use "1" to query all vaults.
*/
const msgGetVaults = (startingPage: number) => ({
const msgGetVaults = (startingPage: string) => ({
vaults: {
starting_page: startingPage.toString(),
starting_page: startingPage,
},
});

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/services/lend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function queryVaults$({
address: contract.address,
codeHash: contract.codeHash,
},
queryMsg: msgGetVaults(1), // starting page of 1, meaning that we will query all vaults
queryMsg: msgGetVaults('1'), // starting page of 1, meaning that we will query all vaults
}));

const vaultVersions = vaultRegistryContracts.map((contract) => contract.vaultVersion);
Expand Down

0 comments on commit 3a9138b

Please sign in to comment.