Skip to content

Commit

Permalink
Remove unnecessary try-catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
BowTiedRadone committed Feb 9, 2025
1 parent 719d6a6 commit 7057401
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
12 changes: 4 additions & 8 deletions citizen.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,10 @@ describe("Simnet deployment plan operations", () => {
// Verify
const balancesMap = new Map(
Array.from([...firstClassSimnet.getAccounts().values()], (address) => {
try {
const balanceHex = firstClassSimnet.runSnippet(
`(stx-get-balance '${address})`
);
return [address, cvToValue(hexToCV(balanceHex))];
} catch (error) {
return [address, BigInt(0)];
}
const balanceHex = firstClassSimnet.runSnippet(
`(stx-get-balance '${address})`
);
return [address, cvToValue(hexToCV(balanceHex))];
})
);

Expand Down
8 changes: 2 additions & 6 deletions citizen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,8 @@ export const issueFirstClassCitizenship = async (

const balancesMap = new Map(
Array.from(simnetAddresses, (address) => {
try {
const balanceHex = simnet.runSnippet(`(stx-get-balance '${address})`);
return [address, cvToValue(hexToCV(balanceHex))];
} catch (error) {
return [address, BigInt(0)];
}
const balanceHex = simnet.runSnippet(`(stx-get-balance '${address})`);
return [address, cvToValue(hexToCV(balanceHex))];
})
);

Expand Down

0 comments on commit 7057401

Please sign in to comment.