Skip to content

Commit

Permalink
improve: syntax revisions (across-protocol#349)
Browse files Browse the repository at this point in the history
* improve: syntax revisions

Signed-off-by: james-a-morris <[email protected]>

* chore: bump version

Signed-off-by: james-a-morris <[email protected]>

---------

Signed-off-by: james-a-morris <[email protected]>
  • Loading branch information
james-a-morris authored Aug 15, 2023
1 parent 8f57bb5 commit d02c4a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@across-protocol/contracts-v2",
"version": "2.4.2",
"version": "2.4.3",
"author": "UMA Team",
"license": "AGPL-3.0-only",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions src/DeploymentUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ export function getDeployedBlockNumber(contractName: string, networkId: number):

// Returns the chainId and contract name for a given contract address.
export function getContractInfoFromAddress(contractAddress: string): { chainId: Number; contractName: string } {
let returnValue: { chainId: number; contractName: string }[] = [];
const returnValue: { chainId: number; contractName: string }[] = [];

Object.keys(deployments).forEach((_chainId) =>
Object.keys(deployments[_chainId]).forEach((_contractName) => {
if (deployments[_chainId][_contractName].address == contractAddress)
if (deployments[_chainId][_contractName].address === contractAddress)
returnValue.push({ chainId: Number(_chainId), contractName: _contractName });
})
);
if (returnValue.length == 0) throw new Error(`Contract ${contractAddress} not found in deployments.json`);
if (returnValue.length === 0) throw new Error(`Contract ${contractAddress} not found in deployments.json`);
if (returnValue.length > 1) throw new Error(`Multiple deployments found for ${contractAddress}`);
return returnValue[0];
}

0 comments on commit d02c4a9

Please sign in to comment.