Skip to content

Commit

Permalink
Merge pull request #114 from santteegt/fix/custom-fixture-tags
Browse files Browse the repository at this point in the history
enable additional fixture tags on baalSetup
  • Loading branch information
santteegt authored Aug 23, 2023
2 parents 069286c + a2619dc commit 76597b1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ You can `yarn add @daohaus/baal-contracts` on your own project and get access to

```js
type BaalSetupOpts = {
fixtureTags?: Array<string>; // additional deployment tags
daoSettings?: Partial<DAOSettings>;
summonSetupOpts?: Partial<SummonSetup>;
safeAddress?: `0x${string}`;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/baal-contracts",
"version": "1.2.11",
"version": "1.2.12",
"description": "Lo, also it is the time of His rain.",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
30 changes: 13 additions & 17 deletions test/utils/baal.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ethers } from 'hardhat';
import { expect } from 'chai';
import { BigNumber, BigNumberish, Contract, ContractTransaction } from 'ethers';
import { ethers } from 'hardhat';

import { Baal, BaalSummoner, MultiSend, Poster } from '../../src/types';
import { encodeMultiAction } from '../../src/util';
import { moveForwardPeriods } from './evm';
import { expect } from 'chai';

export type DAOSettings = {
PROPOSAL_OFFERING: any;
Expand Down Expand Up @@ -306,22 +306,18 @@ export const submitAndProcessProposal = async ({
encodedAction,
proposal,
proposalId,
}: {
baal: Baal,
encodedAction: string,
proposal: ProposalType,
proposalId: BigNumberish
}) => {
await baal.submitProposal(
encodedAction,
proposal.expiration,
proposal.baalGas,
ethers.utils.id(proposal.details)
);
await baal.submitVote(proposalId, true);
}: {
baal: Baal;
encodedAction: string;
proposal: ProposalType;
proposalId?: BigNumberish;
}) => {
await baal.submitProposal(encodedAction, proposal.expiration, proposal.baalGas, ethers.utils.id(proposal.details));
const id = proposalId ? proposalId : await baal.proposalCount();
await baal.submitVote(id, true);
await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2);
return await baal.processProposal(proposalId, encodedAction);
};
return await baal.processProposal(id, encodedAction);
};

export const setShamanProposal = async (
baal: Baal,
Expand Down
5 changes: 3 additions & 2 deletions test/utils/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export type UsersSetup = {
}

type BaalSetupOpts = {
fixtureTags?: Array<string>;
daoSettings?: Partial<DAOSettings>;
summonSetupOpts?: Partial<SummonSetup>;
safeAddress?: `0x${string}`;
Expand All @@ -68,7 +69,7 @@ type BaalSetupOpts = {
setupUsersOverride?: (params: SetupUsersParams) => Promise<UsersSetup>;
}

const setupUsersDefault = async ({
export const setupUsersDefault = async ({
// addresses,
baal,
hre,
Expand Down Expand Up @@ -190,7 +191,7 @@ export const baalSetup = deployments.createFixture<BaalSetupType, BaalSetupOpts>
const { deployer } = await getNamedAccounts();
const [summoner, applicant, shaman, s1, s2, s3, s4, s5, s6] = await getUnnamedAccounts();

await deployments.fixture(['Infra', 'TributeMinion', 'BaalSummoner']); // Deployment Tags
await deployments.fixture(['Infra', 'TributeMinion', 'BaalSummoner', ...(options?.fixtureTags || [])]); // Deployment Tags

console.log('baalSetup fixture', options);
// console.log('deployments', Object.keys(await deployments.all()));
Expand Down

0 comments on commit 76597b1

Please sign in to comment.