diff --git a/packages/contracts/test/core/dao/dao.ts b/packages/contracts/test/core/dao/dao.ts index ce4ddcab2..896b90105 100644 --- a/packages/contracts/test/core/dao/dao.ts +++ b/packages/contracts/test/core/dao/dao.ts @@ -30,7 +30,7 @@ import { } from '../../test-utils/dao'; import {ZERO_BYTES32, daoExampleURI} from '../../test-utils/dao'; import { - CURRENT_PROTOCOL_VERSION, + osxContractsVersion, IMPLICIT_INITIAL_PROTOCOL_VERSION, } from '../../test-utils/protocol-version'; import {deployWithProxy} from '../../test-utils/proxy'; @@ -359,7 +359,7 @@ describe('DAO', function () { expect(fromProtocolVersion).to.deep.equal( IMPLICIT_INITIAL_PROTOCOL_VERSION ); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); it('from v1.3.0', async () => { @@ -386,7 +386,7 @@ describe('DAO', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 3, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); }); @@ -436,9 +436,7 @@ describe('DAO', function () { describe('Protocol version', async () => { it('returns the current protocol version', async () => { - expect(await dao.protocolVersion()).to.deep.equal( - CURRENT_PROTOCOL_VERSION - ); + expect(await dao.protocolVersion()).to.deep.equal(osxContractsVersion()); }); }); diff --git a/packages/contracts/test/framework/dao/dao-factory.ts b/packages/contracts/test/framework/dao/dao-factory.ts index 9b3868a59..0c65dd70c 100644 --- a/packages/contracts/test/framework/dao/dao-factory.ts +++ b/packages/contracts/test/framework/dao/dao-factory.ts @@ -30,7 +30,7 @@ import {InstallationPreparedEvent} from '../../../typechain/PluginSetupProcessor import {daoExampleURI, deployNewDAO} from '../../test-utils/dao'; import {deployENSSubdomainRegistrar} from '../../test-utils/ens'; import {deployPluginSetupProcessor} from '../../test-utils/plugin-setup-processor'; -import {CURRENT_PROTOCOL_VERSION} from '../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../test-utils/protocol-version'; import {deployWithProxy} from '../../test-utils/proxy'; import { createApplyInstallationParams, @@ -281,7 +281,7 @@ describe('DAOFactory: ', function () { context('Protocol version', async () => { it('returns the current protocol version', async () => { expect(await daoFactory.protocolVersion()).to.deep.equal( - CURRENT_PROTOCOL_VERSION + osxContractsVersion() ); }); }); diff --git a/packages/contracts/test/framework/dao/dao-registry.ts b/packages/contracts/test/framework/dao/dao-registry.ts index 917d0dafe..552a063e1 100644 --- a/packages/contracts/test/framework/dao/dao-registry.ts +++ b/packages/contracts/test/framework/dao/dao-registry.ts @@ -9,10 +9,7 @@ import {DAORegistry__factory as DAORegistry_V1_3_0__factory} from '../../../type import {ensDomainHash, ensLabelHash} from '../../../utils/ens'; import {deployNewDAO} from '../../test-utils/dao'; import {deployENSSubdomainRegistrar} from '../../test-utils/ens'; -import { - CURRENT_PROTOCOL_VERSION, - IMPLICIT_INITIAL_PROTOCOL_VERSION, -} from '../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../test-utils/protocol-version'; import {deployWithProxy} from '../../test-utils/proxy'; import { getProtocolVersion, @@ -253,7 +250,7 @@ describe('DAORegistry', function () { describe('Protocol version', async () => { it('returns the current protocol version', async () => { expect(await daoRegistry.protocolVersion()).to.deep.equal( - CURRENT_PROTOCOL_VERSION + osxContractsVersion() ); }); }); @@ -311,7 +308,7 @@ describe('DAORegistry', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); it('from v1.3.0', async () => { @@ -339,7 +336,7 @@ describe('DAORegistry', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); }); }); diff --git a/packages/contracts/test/framework/plugin/plugin-repo-factory.ts b/packages/contracts/test/framework/plugin/plugin-repo-factory.ts index e7ccad210..de985f09c 100644 --- a/packages/contracts/test/framework/plugin/plugin-repo-factory.ts +++ b/packages/contracts/test/framework/plugin/plugin-repo-factory.ts @@ -9,7 +9,7 @@ import { } from '../../../typechain'; import {deployNewDAO} from '../../test-utils/dao'; import {deployENSSubdomainRegistrar} from '../../test-utils/ens'; -import {CURRENT_PROTOCOL_VERSION} from '../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../test-utils/protocol-version'; import { deployMockPluginSetup, deployPluginRepoRegistry, @@ -115,7 +115,7 @@ describe('PluginRepoFactory: ', function () { describe('Protocol version', async () => { it('returns the current protocol version', async () => { expect(await pluginRepoFactory.protocolVersion()).to.deep.equal( - CURRENT_PROTOCOL_VERSION + osxContractsVersion() ); }); }); diff --git a/packages/contracts/test/framework/plugin/plugin-repo-registry.ts b/packages/contracts/test/framework/plugin/plugin-repo-registry.ts index dd534ec85..e3cdd7e5d 100644 --- a/packages/contracts/test/framework/plugin/plugin-repo-registry.ts +++ b/packages/contracts/test/framework/plugin/plugin-repo-registry.ts @@ -10,10 +10,7 @@ import {PluginRepoRegistry__factory as PluginRepoRegistry_V1_3_0__factory} from import {ensDomainHash} from '../../../utils/ens'; import {deployNewDAO} from '../../test-utils/dao'; import {deployENSSubdomainRegistrar} from '../../test-utils/ens'; -import { - CURRENT_PROTOCOL_VERSION, - IMPLICIT_INITIAL_PROTOCOL_VERSION, -} from '../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../test-utils/protocol-version'; import {deployWithProxy} from '../../test-utils/proxy'; import {deployNewPluginRepo} from '../../test-utils/repo'; import { @@ -257,7 +254,7 @@ describe('PluginRepoRegistry', function () { describe('Protocol version', async () => { it('returns the current protocol version', async () => { expect(await pluginRepoRegistry.protocolVersion()).to.deep.equal( - CURRENT_PROTOCOL_VERSION + osxContractsVersion() ); }); }); @@ -317,7 +314,7 @@ describe('PluginRepoRegistry', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); it('from v1.3.0', async () => { @@ -347,7 +344,7 @@ describe('PluginRepoRegistry', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); }); }); diff --git a/packages/contracts/test/framework/plugin/plugin-repo.ts b/packages/contracts/test/framework/plugin/plugin-repo.ts index ab19c210c..94758470a 100644 --- a/packages/contracts/test/framework/plugin/plugin-repo.ts +++ b/packages/contracts/test/framework/plugin/plugin-repo.ts @@ -13,10 +13,7 @@ import { import {PluginRepo__factory as PluginRepo_V1_0_0__factory} from '../../../typechain/@aragon/osx-v1.0.1/framework/plugin/repo/PluginRepo.sol'; import {PluginRepo__factory as PluginRepo_V1_3_0__factory} from '../../../typechain/@aragon/osx-v1.3.0/framework/plugin/repo/PluginRepo.sol'; import {ZERO_BYTES32} from '../../test-utils/dao'; -import { - CURRENT_PROTOCOL_VERSION, - IMPLICIT_INITIAL_PROTOCOL_VERSION, -} from '../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../test-utils/protocol-version'; import {tagHash} from '../../test-utils/psp/hash-helpers'; import { deployMockPluginSetup, @@ -125,7 +122,7 @@ describe('PluginRepo', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); it('from v1.3.0', async () => { @@ -152,7 +149,7 @@ describe('PluginRepo', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 3, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); }); @@ -184,7 +181,7 @@ describe('PluginRepo', function () { describe('Protocol version', async () => { it('returns the current protocol version', async () => { expect(await pluginRepo.protocolVersion()).to.deep.equal( - CURRENT_PROTOCOL_VERSION + osxContractsVersion() ); }); }); diff --git a/packages/contracts/test/framework/plugin/plugin-setup-processor.ts b/packages/contracts/test/framework/plugin/plugin-setup-processor.ts index d90207bc0..5fc027f4f 100644 --- a/packages/contracts/test/framework/plugin/plugin-setup-processor.ts +++ b/packages/contracts/test/framework/plugin/plugin-setup-processor.ts @@ -31,7 +31,7 @@ import {PluginRepoRegisteredEvent} from '../../../typechain/PluginRepoRegistry'; import {deployNewDAO, ZERO_BYTES32} from '../../test-utils/dao'; import {deployENSSubdomainRegistrar} from '../../test-utils/ens'; import {deployPluginSetupProcessor} from '../../test-utils/plugin-setup-processor'; -import {CURRENT_PROTOCOL_VERSION} from '../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../test-utils/protocol-version'; import { installPlugin, updatePlugin, @@ -315,9 +315,7 @@ describe('PluginSetupProcessor', function () { describe('Protocol version', async () => { it('returns the current protocol version', async () => { - expect(await psp.protocolVersion()).to.deep.equal( - CURRENT_PROTOCOL_VERSION - ); + expect(await psp.protocolVersion()).to.deep.equal(osxContractsVersion()); }); }); diff --git a/packages/contracts/test/framework/plugin/plugin-setup.ts b/packages/contracts/test/framework/plugin/plugin-setup.ts index 1aa521316..ebf5392d5 100644 --- a/packages/contracts/test/framework/plugin/plugin-setup.ts +++ b/packages/contracts/test/framework/plugin/plugin-setup.ts @@ -5,7 +5,7 @@ import { PluginCloneableSetupV1Mock, PluginCloneableSetupV1Mock__factory, } from '../../../typechain'; -import {CURRENT_PROTOCOL_VERSION} from '../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../test-utils/protocol-version'; import {getInterfaceId} from '@aragon/osx-commons-sdk'; import {expect} from 'chai'; import {ethers} from 'hardhat'; @@ -47,7 +47,7 @@ describe('PluginSetup', function () { describe('Protocol version', async () => { it('returns the current protocol version', async () => { expect(await setupMock.protocolVersion()).to.deep.equal( - CURRENT_PROTOCOL_VERSION + osxContractsVersion() ); }); }); diff --git a/packages/contracts/test/framework/utils/ens/ens-subdomain-registry.ts b/packages/contracts/test/framework/utils/ens/ens-subdomain-registry.ts index 1015b9c83..490c32ebc 100644 --- a/packages/contracts/test/framework/utils/ens/ens-subdomain-registry.ts +++ b/packages/contracts/test/framework/utils/ens/ens-subdomain-registry.ts @@ -12,7 +12,7 @@ import {ENSSubdomainRegistrar__factory as ENSSubdomainRegistrar_V1_3_0__factory} import {ensDomainHash, ensLabelHash} from '../../../../utils/ens'; import {deployNewDAO} from '../../../test-utils/dao'; import {setupResolver} from '../../../test-utils/ens'; -import {CURRENT_PROTOCOL_VERSION} from '../../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../../test-utils/protocol-version'; import {deployWithProxy} from '../../../test-utils/proxy'; import { getProtocolVersion, @@ -338,7 +338,7 @@ describe('ENSSubdomainRegistrar', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); it('from v1.3.0', async () => { @@ -368,7 +368,7 @@ describe('ENSSubdomainRegistrar', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); }); diff --git a/packages/contracts/test/plugins/governance/majority-voting/addresslist/addresslist-voting.ts b/packages/contracts/test/plugins/governance/majority-voting/addresslist/addresslist-voting.ts index 14104e234..48fe5a64b 100644 --- a/packages/contracts/test/plugins/governance/majority-voting/addresslist/addresslist-voting.ts +++ b/packages/contracts/test/plugins/governance/majority-voting/addresslist/addresslist-voting.ts @@ -20,10 +20,7 @@ import { } from '../../../../../typechain/AddresslistVoting'; import {ExecutedEvent} from '../../../../../typechain/DAO'; import {deployNewDAO} from '../../../../test-utils/dao'; -import { - CURRENT_PROTOCOL_VERSION, - IMPLICIT_INITIAL_PROTOCOL_VERSION, -} from '../../../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../../../test-utils/protocol-version'; import {deployWithProxy} from '../../../../test-utils/proxy'; import { getProtocolVersion, @@ -180,7 +177,7 @@ describe('AddresslistVoting', function () { ); expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); it('from v1.3.0', async () => { @@ -208,7 +205,7 @@ describe('AddresslistVoting', function () { ); expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); }); diff --git a/packages/contracts/test/plugins/governance/majority-voting/token/token-voting.ts b/packages/contracts/test/plugins/governance/majority-voting/token/token-voting.ts index c88bc310e..04403a728 100644 --- a/packages/contracts/test/plugins/governance/majority-voting/token/token-voting.ts +++ b/packages/contracts/test/plugins/governance/majority-voting/token/token-voting.ts @@ -21,10 +21,7 @@ import { ProposalExecutedEvent, } from '../../../../../typechain/TokenVoting'; import {deployNewDAO} from '../../../../test-utils/dao'; -import { - CURRENT_PROTOCOL_VERSION, - IMPLICIT_INITIAL_PROTOCOL_VERSION, -} from '../../../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../../../test-utils/protocol-version'; import {deployWithProxy} from '../../../../test-utils/proxy'; import { getProtocolVersion, @@ -249,7 +246,7 @@ describe('TokenVoting', function () { ); expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); it('from v1.3.0', async () => { @@ -277,7 +274,7 @@ describe('TokenVoting', function () { ); expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); }); diff --git a/packages/contracts/test/plugins/governance/multisig/multisig.ts b/packages/contracts/test/plugins/governance/multisig/multisig.ts index bcdcc8eb8..af01ee830 100644 --- a/packages/contracts/test/plugins/governance/multisig/multisig.ts +++ b/packages/contracts/test/plugins/governance/multisig/multisig.ts @@ -21,17 +21,18 @@ import { ProposalExecutedEvent, } from '../../../../typechain/Multisig'; import {deployNewDAO} from '../../../test-utils/dao'; -import { - CURRENT_PROTOCOL_VERSION, - IMPLICIT_INITIAL_PROTOCOL_VERSION, -} from '../../../test-utils/protocol-version'; +import {osxContractsVersion} from '../../../test-utils/protocol-version'; import {deployWithProxy} from '../../../test-utils/proxy'; import { getProtocolVersion, deployAndUpgradeFromToCheck, deployAndUpgradeSelfCheck, } from '../../../test-utils/uups-upgradeable'; -import {MULTISIG_EVENTS, MULTISIG_INTERFACE} from './multisig-constants'; +import { + MULTISIG_EVENTS, + MULTISIG_INTERFACE, + MultisigSettings, +} from './multisig-constants'; import { getInterfaceId, proposalIdToBytes32, @@ -242,7 +243,7 @@ describe('Multisig', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); it('from v1.3.0', async () => { @@ -270,7 +271,7 @@ describe('Multisig', function () { expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion); expect(fromProtocolVersion).to.deep.equal([1, 0, 0]); - expect(toProtocolVersion).to.deep.equal(CURRENT_PROTOCOL_VERSION); + expect(toProtocolVersion).to.deep.equal(osxContractsVersion()); }); }); diff --git a/packages/contracts/test/protocol-version.ts b/packages/contracts/test/protocol-version.ts index 8afb8898a..dc7314204 100644 --- a/packages/contracts/test/protocol-version.ts +++ b/packages/contracts/test/protocol-version.ts @@ -1,5 +1,5 @@ import {ProtocolVersionMock__factory} from '../typechain'; -import {osxCommonsContractsNPMVersion} from './test-utils/protocol-version'; +import {osxContractsVersion} from './test-utils/protocol-version'; import {SignerWithAddress} from '@nomiclabs/hardhat-ethers/signers'; import {expect} from 'chai'; import {ethers} from 'hardhat'; @@ -15,7 +15,7 @@ describe('ProtocolVersion', function () { signers[0] ).deploy(); expect(await versionedContract.protocolVersion()).to.deep.equal( - osxCommonsContractsNPMVersion() + osxContractsVersion() ); }); }); diff --git a/packages/contracts/test/test-utils/protocol-version.ts b/packages/contracts/test/test-utils/protocol-version.ts index 03eb70a49..45dfe2820 100644 --- a/packages/contracts/test/test-utils/protocol-version.ts +++ b/packages/contracts/test/test-utils/protocol-version.ts @@ -1,17 +1,14 @@ import {version} from '../../package.json'; -// The current protocol version number as specified by the `getProtocolVersion()` function in `ProtocolVersion.sol`. -export const CURRENT_PROTOCOL_VERSION: [number, number, number] = [1, 4, 0]; - // The protocol version number of contracts not having a `getProtocolVersion()` function because they don't inherit from `ProtocolVersion.sol` yet. export const IMPLICIT_INITIAL_PROTOCOL_VERSION: [number, number, number] = [ 1, 0, 0, ]; /** - * Returns the NPM version number from the `osx-commons-contracts` package.json file + * Returns the NPM version number from the `osx` package.json file */ -export function osxCommonsContractsNPMVersion(): [number, number, number] { +export function osxContractsVersion(): [number, number, number] { const trimmedVersion = version.split('-')[0]; const semver = trimmedVersion.split('.'); return [Number(semver[0]), Number(semver[1]), Number(semver[2])];