Skip to content

Commit

Permalink
refactor: Remove UMA interfaces lookup (#959)
Browse files Browse the repository at this point in the history
These names change very rarely, and we only have need for a small number
of the complete set.
  • Loading branch information
pxrl authored Sep 29, 2023
1 parent 937e6e1 commit 2da16b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
5 changes: 2 additions & 3 deletions test/TokenClient.Approval.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { interfaceName } from "@uma/common";
import { HubPoolClient, SpokePoolClient, TokenClient } from "../src/clients";
import {
Contract,
Expand Down Expand Up @@ -49,8 +48,8 @@ describe("TokenClient: Origin token approval", async function () {
const store = await (
await getContractFactory("Store", owner)
).deploy({ rawValue: "0" }, { rawValue: "0" }, zeroAddress);
await finder.changeImplementationAddress(utf8ToHex(interfaceName.CollateralWhitelist), collateralWhitelist.address);
await finder.changeImplementationAddress(utf8ToHex(interfaceName.Store), store.address);
await finder.changeImplementationAddress(utf8ToHex("CollateralWhitelist"), collateralWhitelist.address);
await finder.changeImplementationAddress(utf8ToHex("Store"), store.address);
({ hubPool, l1Token_1 } = await deployAndConfigureHubPool(owner, [], finder.address, zeroAddress));
await collateralWhitelist.addToWhitelist(l1Token_1.address);
await hubPool.setBond(l1Token_1.address, toBNWei("5"));
Expand Down
11 changes: 5 additions & 6 deletions test/fixtures/UmaEcosystemFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as utils from "@across-protocol/contracts-v2/dist/test-utils";
import { Contract } from "ethers";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { utf8ToHex, identifier, refundProposalLiveness } from "@across-protocol/contracts-v2/dist/test-utils";
import { interfaceName } from "@uma/common";

export async function setupUmaEcosystem(owner: SignerWithAddress): Promise<{
timer: Contract;
Expand All @@ -25,11 +24,11 @@ export async function setupUmaEcosystem(owner: SignerWithAddress): Promise<{
const store = await (
await utils.getContractFactory("Store", owner)
).deploy({ rawValue: "0" }, { rawValue: "0" }, timer.address);
await finder.changeImplementationAddress(utf8ToHex(interfaceName.CollateralWhitelist), collateralWhitelist.address);
await finder.changeImplementationAddress(utf8ToHex(interfaceName.IdentifierWhitelist), identifierWhitelist.address);
await finder.changeImplementationAddress(utf8ToHex(interfaceName.SkinnyOptimisticOracle), optimisticOracle.address);
await finder.changeImplementationAddress(utf8ToHex(interfaceName.Store), store.address);
await finder.changeImplementationAddress(utf8ToHex(interfaceName.Oracle), mockOracle.address);
await finder.changeImplementationAddress(utf8ToHex("CollateralWhitelist"), collateralWhitelist.address);
await finder.changeImplementationAddress(utf8ToHex("IdentifierWhitelist"), identifierWhitelist.address);
await finder.changeImplementationAddress(utf8ToHex("SkinnyOptimisticOracle"), optimisticOracle.address);
await finder.changeImplementationAddress(utf8ToHex("Store"), store.address);
await finder.changeImplementationAddress(utf8ToHex("Oracle"), mockOracle.address);
await identifierWhitelist.addSupportedIdentifier(identifier);
return {
timer,
Expand Down

0 comments on commit 2da16b5

Please sign in to comment.