Skip to content

Commit

Permalink
fix: deprecate createNewDAO for createDAOProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
jordaniza committed Mar 4, 2024
1 parent 0502e92 commit 06aab6a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
IERC20Upgradeable__factory,
IVotesUpgradeable__factory,
} from '../../../typechain';
import {deployNewDAO} from '../../test-utils/dao';
import {EMPTY_DATA, createDaoProxy} from '../../test-utils/dao';
import {
GovernanceERC20__factory,
GovernanceERC20,
Expand Down Expand Up @@ -42,7 +42,7 @@ describe('GovernanceERC20', function () {

before(async () => {
signers = await ethers.getSigners();
dao = await deployNewDAO(signers[0]);
dao = await createDaoProxy(signers[0], EMPTY_DATA);
GovernanceERC20 = new GovernanceERC20__factory(signers[0]);

from = signers[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MajorityVotingMock__factory,
IProtocolVersion__factory,
} from '../../../typechain';
import {deployNewDAO} from '../../test-utils/dao';
import {EMPTY_DATA, createDaoProxy} from '../../test-utils/dao';
import {MAJORITY_VOTING_BASE_INTERFACE} from '../../test-utils/majority-voting-constants';
import {deployWithProxy} from '../../test-utils/proxy';
import {VotingSettings, VotingMode} from '../../test-utils/voting-helpers';
Expand All @@ -30,7 +30,7 @@ describe('MajorityVotingMock', function () {
signers = await ethers.getSigners();
ownerAddress = await signers[0].getAddress();

dao = await deployNewDAO(signers[0]);
dao = await createDaoProxy(signers[0], EMPTY_DATA);
});

beforeEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '../../../typechain/src/TokenVoting';
import {ExecutedEvent} from '../../../typechain/src/mocks/DAOMock';
import {VITALIK} from '../../test-utils/address';
import {deployNewDAO} from '../../test-utils/dao';
import {EMPTY_DATA, createDaoProxy} from '../../test-utils/dao';
import {
MAJORITY_VOTING_BASE_INTERFACE,
VOTING_EVENTS,
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('TokenVoting', function () {
ethers.utils.toUtf8Bytes('0x123456789')
);

dao = await deployNewDAO(signers[0]);
dao = await createDaoProxy(signers[0], EMPTY_DATA);
});

beforeEach(async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TokenVotingSetup__factory,
TokenVoting__factory,
} from '../../../typechain';
import {deployNewDAO} from '../../test-utils/dao';
import {createDaoProxy, EMPTY_DATA} from '../../test-utils/dao';
import {TOKEN_VOTING_INTERFACE} from '../../test-utils/token-voting-constants';
import {VotingMode, VotingSettings} from '../../test-utils/voting-helpers';
import {Operation} from '@aragon/osx-commons-sdk';
Expand All @@ -29,7 +29,6 @@ let defaultMintSettings: {receivers: string[]; amounts: number[]};

const abiCoder = ethers.utils.defaultAbiCoder;
const AddressZero = ethers.constants.AddressZero;
const EMPTY_DATA = '0x';

const prepareInstallationDataTypes = getNamedTypesFromMetadata(
metadata.pluginSetup.prepareInstallation.inputs
Expand Down Expand Up @@ -59,7 +58,7 @@ describe('TokenVotingSetup', function () {

before(async () => {
signers = await ethers.getSigners();
targetDao = await deployNewDAO(signers[0]);
targetDao = await createDaoProxy(signers[0], EMPTY_DATA);

defaultVotingSettings = {
votingMode: VotingMode.EarlyExecution,
Expand Down
12 changes: 1 addition & 11 deletions packages/contracts/test/test-utils/dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {ethers} from 'hardhat';
export const ZERO_BYTES32 =
'0x0000000000000000000000000000000000000000000000000000000000000000';
export const daoExampleURI = 'https://example.com';
export const EMPTY_DATA = '0x';

export const TOKEN_INTERFACE_IDS = {
erc721ReceivedId: '0x150b7a02',
Expand Down Expand Up @@ -45,17 +46,6 @@ export async function createDaoProxy(
return dao;
}

const dummyMetadata = ethers.utils.hexlify(
ethers.utils.toUtf8Bytes('0x123456789')
);

export async function deployNewDAO(
signer: SignerWithAddress,
metadata = dummyMetadata
): Promise<DAO> {
return await createDaoProxy(signer, metadata);
}

export function getERC20TransferAction(
tokenAddress: string,
to: string,
Expand Down

0 comments on commit 06aab6a

Please sign in to comment.