Skip to content

Commit

Permalink
fixing config names
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbronco committed Oct 18, 2023
1 parent 1410581 commit b463feb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions modules/vebal/debug-voting-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { VotingGaugesRepository } from './voting-gauges.repository';
import { VeBalVotingListService } from './vebal-voting-list.service';
import { initRequestScopedContext, setRequestScopedContextValue } from '../context/request-scoped-context';
import { AllNetworkConfigs } from '../network/network-config';
import { mainnetNetworkConfig } from '../network/mainnet';
import { MainnetNetworkConfig } from '../network/mainnet';

const defaultAnvilRpcUrl = 'http://127.0.0.1:8555';
setMainnetRpcProviderForTesting(defaultAnvilRpcUrl);

// TODO: understand why mainnetConfig is undefined in test context
AllNetworkConfigs['1'] = mainnetNetworkConfig;
AllNetworkConfigs['1'] = MainnetNetworkConfig;

beforeEach(() => {
initRequestScopedContext();
Expand Down
8 changes: 4 additions & 4 deletions modules/vebal/voting-gauges.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { keyBy, mapValues } from 'lodash';
import { formatFixed } from '@ethersproject/bignumber';
import { BigNumber, Contract } from 'ethers';
import { formatEther } from 'ethers/lib/utils';
import { mainnetNetworkConfig } from '../network/mainnet';
import { MainnetNetworkConfig } from '../network/mainnet';
import gaugeControllerAbi from './abi/gaugeController.json';
import gaugeControllerHelperAbi from './abi/gaugeControllerHelper.json';
import rootGaugeAbi from './abi/rootGauge.json';
Expand All @@ -15,9 +15,9 @@ import { v1RootGaugeRecipients } from './special-pools/streamer-v1-gauges';
import { Multicaller3 } from '../web3/multicaller3';
import { networkContext } from '../network/network-context.service';

const gaugeControllerAddress = mainnetNetworkConfig.data.gaugeControllerAddress!;
const gaugeControllerAddress = MainnetNetworkConfig.data.gaugeControllerAddress!;
// Helper contract that wraps gaugeControllerAddress contract to allow checkpointing and getting the updated relative weight
const gaugeControllerHelperAddress = mainnetNetworkConfig.data.gaugeControllerHelperAddress!;
const gaugeControllerHelperAddress = MainnetNetworkConfig.data.gaugeControllerHelperAddress!;

export type VotingGauge = {
gaugeAddress: string;
Expand Down Expand Up @@ -236,7 +236,7 @@ export class VotingGaugesRepository {
}

getGaugeControllerContract() {
return new Contract(gaugeControllerAddress, gaugeControllerAbi, mainnetNetworkConfig.provider);
return new Contract(gaugeControllerAddress, gaugeControllerAbi, MainnetNetworkConfig.provider);
}

async fetchGaugeAddresses(totalGauges: number) {
Expand Down
4 changes: 2 additions & 2 deletions test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { providers } from 'ethers';
import { mainnetNetworkConfig } from '../modules/network/mainnet';
import { MainnetNetworkConfig } from '../modules/network/mainnet';

// anvil --fork-url https://eth-mainnet.alchemyapi.io/v2/7gYoDJEw6-QyVP5hd2UfZyelzDIDemGz --port 8555 --fork-block-number=17878719

Expand All @@ -9,7 +9,7 @@ const defaultAnvilRpcUrl = 'http://127.0.0.1:8555';

export function setMainnetRpcProviderForTesting(httpRpc = defaultAnvilRpcUrl) {
console.log(`🤖 Integration tests using ${httpRpc} as rpc url`);
mainnetNetworkConfig.provider = getRpcProvider(httpRpc);
MainnetNetworkConfig.provider = getRpcProvider(httpRpc);
}

export function getRpcProvider(httpRpc = defaultAnvilRpcUrl) {
Expand Down

0 comments on commit b463feb

Please sign in to comment.