Skip to content

Commit 4bb16bb

Browse files
committed
Adds @api3/promise-utils devDependency
1 parent 5b64095 commit 4bb16bb

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

deploy/003_deploy_ProductApi3ReaderProxyV1.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { HardhatRuntimeEnvironment } from 'hardhat/types';
22
import type { DeploymentsExtension } from 'hardhat-deploy/types';
33

4+
import { go } from '@api3/promise-utils';
5+
46
import { getDeploymentName } from '../src';
57
import { IApi3ReaderProxyV1__factory } from '../typechain-types';
68

@@ -67,17 +69,19 @@ module.exports = async (hre: HardhatRuntimeEnvironment) => {
6769
const proxy1 = IApi3ReaderProxyV1__factory.connect(proxy1Address, ethers.provider);
6870
const proxy2 = IApi3ReaderProxyV1__factory.connect(proxy2Address, ethers.provider);
6971

70-
try {
71-
dappId1 = await proxy1.dappId();
72+
const goDappId1 = await go(() => proxy1.dappId());
73+
if (goDappId1.success) {
74+
dappId1 = goDappId1.data;
7275
log(`Proxy 1 dappId: ${dappId1}`);
73-
} catch {
76+
} else {
7477
log('Proxy 1 does not have a dappId');
7578
}
7679

77-
try {
78-
dappId2 = await proxy2.dappId();
80+
const goDappId2 = await go(() => proxy2.dappId());
81+
if (goDappId2.success) {
82+
dappId2 = goDappId2.data;
7983
log(`Proxy 2 dappId: ${dappId2}`);
80-
} catch {
84+
} else {
8185
log('Proxy 2 does not have a dappId');
8286
}
8387

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"devDependencies": {
4141
"@api3/contracts": "^28.0.0",
4242
"@api3/eslint-plugin-commons": "^3.0.0",
43+
"@api3/promise-utils": "^0.4.0",
4344
"@eslint/js": "^9.30.0",
4445
"@nomicfoundation/hardhat-ethers": "^3.0.9",
4546
"@nomicfoundation/hardhat-network-helpers": "^1.0.13",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)