Skip to content

Commit

Permalink
fix(chain)!: use on-chain balance in dry-run
Browse files Browse the repository at this point in the history
BREAKING CHANGE: On-chain balance used for accounts in dry-run
Before it was an on-chain balance plus 1e+35.
  • Loading branch information
davidyuk committed Sep 11, 2023
1 parent 120cdcc commit 337090c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ async function txDryRunHandler(key: string, onNode: Node): Promise<void> {
top,
txEvents: rs[0].txEvents,
txs: rs.map((req) => ({ tx: req.tx })),
accounts: Array.from(new Set(rs.map((req) => req.accountAddress)))
.map((pubKey) => ({ pubKey, amount: DRY_RUN_ACCOUNT.amount })),
...rs.map((req) => req.accountAddress).includes(DRY_RUN_ACCOUNT.pub)
&& { accounts: [{ pubKey: DRY_RUN_ACCOUNT.pub, amount: DRY_RUN_ACCOUNT.amount }] },
});
} catch (error) {
rs.forEach(({ reject }) => reject(error));
Expand Down

0 comments on commit 337090c

Please sign in to comment.