Commit cc0594cf authored by Luca Donno's avatar Luca Donno Committed by GitHub

cleanup: Remove setProxyTarget function (#2516)

Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 8c9ac5f5
...@@ -6,7 +6,6 @@ import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' ...@@ -6,7 +6,6 @@ import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { expect } from '../../../setup' import { expect } from '../../../setup'
import { import {
setProxyTarget,
NON_NULL_BYTES32, NON_NULL_BYTES32,
NON_ZERO_ADDRESS, NON_ZERO_ADDRESS,
DUMMY_BATCH_HEADERS, DUMMY_BATCH_HEADERS,
...@@ -57,10 +56,9 @@ describe('L1CrossDomainMessenger', () => { ...@@ -57,10 +56,9 @@ describe('L1CrossDomainMessenger', () => {
Fake__L2CrossDomainMessenger.address Fake__L2CrossDomainMessenger.address
) )
await setProxyTarget( await AddressManager.setAddress(
AddressManager,
'StateCommitmentChain', 'StateCommitmentChain',
Fake__StateCommitmentChain Fake__StateCommitmentChain.address
) )
CanonicalTransactionChain = await deploy('CanonicalTransactionChain', { CanonicalTransactionChain = await deploy('CanonicalTransactionChain', {
......
...@@ -13,7 +13,6 @@ import { TransactionResponse } from '@ethersproject/abstract-provider' ...@@ -13,7 +13,6 @@ import { TransactionResponse } from '@ethersproject/abstract-provider'
/* Internal Imports */ /* Internal Imports */
import { import {
deploy, deploy,
setProxyTarget,
L2_GAS_DISCOUNT_DIVISOR, L2_GAS_DISCOUNT_DIVISOR,
ENQUEUE_GAS_COST, ENQUEUE_GAS_COST,
getEthTime, getEthTime,
...@@ -59,10 +58,9 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain [ @skip-on-coverage ]', () = ...@@ -59,10 +58,9 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain [ @skip-on-coverage ]', () =
'StateCommitmentChain' 'StateCommitmentChain'
) )
await setProxyTarget( await AddressManager.setAddress(
AddressManager,
'StateCommitmentChain', 'StateCommitmentChain',
Fake__StateCommitmentChain Fake__StateCommitmentChain.address
) )
CanonicalTransactionChain = await deploy('CanonicalTransactionChain', { CanonicalTransactionChain = await deploy('CanonicalTransactionChain', {
......
...@@ -12,7 +12,6 @@ import _ from 'lodash' ...@@ -12,7 +12,6 @@ import _ from 'lodash'
import { expect } from '../../../setup' import { expect } from '../../../setup'
import { import {
deploy, deploy,
setProxyTarget,
L2_GAS_DISCOUNT_DIVISOR, L2_GAS_DISCOUNT_DIVISOR,
ENQUEUE_GAS_COST, ENQUEUE_GAS_COST,
setEthTime, setEthTime,
...@@ -67,10 +66,9 @@ describe('CanonicalTransactionChain', () => { ...@@ -67,10 +66,9 @@ describe('CanonicalTransactionChain', () => {
'StateCommitmentChain' 'StateCommitmentChain'
) )
await setProxyTarget( await AddressManager.setAddress(
AddressManager,
'StateCommitmentChain', 'StateCommitmentChain',
Fake__StateCommitmentChain Fake__StateCommitmentChain.address
) )
CanonicalTransactionChain = await deploy('CanonicalTransactionChain', { CanonicalTransactionChain = await deploy('CanonicalTransactionChain', {
......
...@@ -6,7 +6,6 @@ import { smock, FakeContract } from '@defi-wonderland/smock' ...@@ -6,7 +6,6 @@ import { smock, FakeContract } from '@defi-wonderland/smock'
import { expect } from '../../../setup' import { expect } from '../../../setup'
import { import {
deploy, deploy,
setProxyTarget,
NON_NULL_BYTES32, NON_NULL_BYTES32,
getEthTime, getEthTime,
increaseEthTime, increaseEthTime,
...@@ -30,15 +29,14 @@ describe('StateCommitmentChain', () => { ...@@ -30,15 +29,14 @@ describe('StateCommitmentChain', () => {
'CanonicalTransactionChain' 'CanonicalTransactionChain'
) )
await setProxyTarget( await AddressManager.setAddress(
AddressManager,
'CanonicalTransactionChain', 'CanonicalTransactionChain',
Fake__CanonicalTransactionChain Fake__CanonicalTransactionChain.address
) )
Fake__BondManager = await smock.fake<Contract>('BondManager') Fake__BondManager = await smock.fake<Contract>('BondManager')
await setProxyTarget(AddressManager, 'BondManager', Fake__BondManager) await AddressManager.setAddress('BondManager', Fake__BondManager.address)
Fake__BondManager.isCollateralized.returns(true) Fake__BondManager.isCollateralized.returns(true)
......
export * from './dummy' export * from './dummy'
export * from './constants' export * from './constants'
export * from './resolver'
export * from './utils' export * from './utils'
export * from './codec' export * from './codec'
export * from './test-runner' export * from './test-runner'
......
/* External Imports */
import { ethers } from 'hardhat'
import { Contract } from 'ethers'
import { FakeContract } from '@defi-wonderland/smock'
export const setProxyTarget = async (
AddressManager: Contract,
name: string,
target: FakeContract
): Promise<void> => {
const SimpleProxy: Contract = await (
await ethers.getContractFactory('Helper_SimpleProxy')
).deploy()
await SimpleProxy.setTarget(target.address)
await AddressManager.setAddress(name, SimpleProxy.address)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment