Skip to content

Commit

Permalink
fix(platform-test-suite): data contract history and withdrawal test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pshenmic committed Feb 5, 2025
1 parent 14ea045 commit 099bc62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GetDataContractHistoryResponse extends AbstractResponse {
return new GetDataContractHistoryResponse(
dataContractHistory ? dataContractHistory.getDataContractEntriesList()
.map((dataContractHistoryEntry) => new DataContractHistoryEntry(
dataContractHistoryEntry.getDate(),
BigInt(dataContractHistoryEntry.getDate()),
dataContractHistoryEntry.getValue(),
)) : null,
metadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ export async function history(
throw e;
}

const rawContractHistory = dataContractHistoryResponse.getDataContractHistory();
const dataContractHistory = dataContractHistoryResponse.getDataContractHistory();
const contractHistory: { [key: number]: DataContract } = {};

// eslint-disable-next-line no-restricted-syntax
for (const [date, contractBytes] of Object.entries(rawContractHistory)) {
contractHistory[date] = await this.dpp.dataContract
.createFromBuffer(contractBytes as Uint8Array);
for (const dataContractHistoryEntry of dataContractHistory) {
contractHistory[Number(dataContractHistoryEntry.getDate().toString())] = await this.dpp
.dataContract.createFromBuffer(dataContractHistoryEntry.getValue() as Uint8Array);
}

this.logger.debug(`[Contracts#history] Obtained Data Contract history for "${identifier}"`);
Expand Down
4 changes: 2 additions & 2 deletions packages/platform-test-suite/test/e2e/withdrawals.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ describe('Withdrawals', function withdrawalsTest() {
);

let withdrawalBroadcasted = false;
let blocksPassed = 0;
let blocksPassed = BigInt(0);

// Wait for first withdrawal to broadcast
while (!withdrawalBroadcasted && blocksPassed === 0) {
while (!withdrawalBroadcasted && blocksPassed === BigInt(0)) {
await waitForSTPropagated();

const withdrawals = await client.platform
Expand Down

0 comments on commit 099bc62

Please sign in to comment.