Skip to content

Commit

Permalink
Fix near-workspaces tests issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsonevv committed Sep 27, 2024
1 parent aa35bcd commit 9d4ce32
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 8 additions & 4 deletions benchmark/__tests__/test-deploy-contract.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ test("JS promise batch deploy contract and call", async (t) => {
);
t.log(
"Gas used to refund unused gas: ",
formatGas(r.result.receipts_outcome[3].outcome.gas_burnt)
// TODO: fix after near-workspaces is updated
formatGas(r.result.receipts_outcome[3]?.outcome.gas_burnt || 0)
);
t.log(
"Total gas used: ",
Expand All @@ -87,7 +88,8 @@ test("JS promise batch deploy contract and call", async (t) => {
r.result.receipts_outcome[0].outcome.gas_burnt +
r.result.receipts_outcome[1].outcome.gas_burnt +
r.result.receipts_outcome[2].outcome.gas_burnt +
r.result.receipts_outcome[3].outcome.gas_burnt
// TODO: fix after near-workspaces is updated
(r.result.receipts_outcome[3]?.outcome.gas_burnt || 0)
)
);
});
Expand Down Expand Up @@ -129,7 +131,8 @@ test("RS promise batch deploy contract and call", async (t) => {
);
t.log(
"Gas used to refund unused gas: ",
formatGas(r.result.receipts_outcome[3].outcome.gas_burnt)
// TODO: fix after near-workspaces is updated
formatGas(r.result.receipts_outcome[3]?.outcome.gas_burnt || 0)
);
t.log(
"Total gas used: ",
Expand All @@ -138,7 +141,8 @@ test("RS promise batch deploy contract and call", async (t) => {
r.result.receipts_outcome[0].outcome.gas_burnt +
r.result.receipts_outcome[1].outcome.gas_burnt +
r.result.receipts_outcome[2].outcome.gas_burnt +
r.result.receipts_outcome[3].outcome.gas_burnt
// TODO: fix after near-workspaces is updated
(r.result.receipts_outcome[3]?.outcome.gas_burnt || 0)
)
);
});
2 changes: 1 addition & 1 deletion benchmark/__tests__/test-lowlevel-minimal.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test("JS lowlevel minimal contract", async (t) => {
test("RS lowlevel minimal contract", async (t) => {
const { bob, lowlevelContractRs } = t.context.accounts;
let r = await bob.callRaw(lowlevelContractRs, "empty", "");

t.is(r.result.status.SuccessValue, "");
logGasDetail(r, t);
});
6 changes: 4 additions & 2 deletions benchmark/__tests__/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ export function logGasDetail(r, t) {
logGasBreakdown(map, t);
t.log(
"Gas used to refund unused gas: ",
formatGas(r.result.receipts_outcome[1].outcome.gas_burnt)
// TODO: fix after near-workspaces is updated
formatGas(r.result.receipts_outcome[1]?.outcome.gas_burnt || 0)
);
t.log(
"Total gas used: ",
formatGas(
r.result.transaction_outcome.outcome.gas_burnt +
r.result.receipts_outcome[0].outcome.gas_burnt +
r.result.receipts_outcome[1].outcome.gas_burnt
// TODO: fix after near-workspaces is updated
(r.result.receipts_outcome[1]?.outcome.gas_burnt || 0)
)
);
}

0 comments on commit 9d4ce32

Please sign in to comment.