Skip to content

Commit

Permalink
fix: remove redundant scripts and remove protocol version getter
Browse files Browse the repository at this point in the history
  • Loading branch information
jordaniza committed Mar 4, 2024
1 parent 06aab6a commit f298b7e
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 130 deletions.
2 changes: 0 additions & 2 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"lint:sol": "cd ../../ && yarn run lint:contracts:sol",
"lint:ts": "cd ../../ && yarn run lint:contracts:ts",
"test": "hardhat test",
"typechain:osx": "ts-node scripts/generate-typechain-osx.ts",
"typechain:osx-versions": "ts-node scripts/generate-typechain-osx-versions.ts",
"typechain": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat typechain",
"clean": "rimraf ./artifacts ./cache ./coverage ./typechain ./types ./coverage.json && yarn typechain"
},
Expand Down
33 changes: 0 additions & 33 deletions packages/contracts/scripts/generate-typechain-osx-versions.ts

This file was deleted.

66 changes: 0 additions & 66 deletions packages/contracts/scripts/generate-typechain-osx.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/contracts/scripts/osx-versions-aliases.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
MAJORITY_VOTING_BASE_INTERFACE,
VOTING_EVENTS,
} from '../../test-utils/majority-voting-constants';
import {osxContractsVersion} from '../../test-utils/protocol-version';
import {deployWithProxy} from '../../test-utils/proxy';
import {
TOKEN_VOTING_INTERFACE,
Expand Down Expand Up @@ -250,7 +249,7 @@ describe('TokenVoting', function () {
);
expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion);
expect(fromProtocolVersion).to.deep.equal([1, 0, 0]);
expect(toProtocolVersion).to.deep.equal(osxContractsVersion());
expect(toProtocolVersion).to.deep.equal([1, 4, 0]);
});

it('from v1.3.0', async () => {
Expand Down Expand Up @@ -278,7 +277,7 @@ describe('TokenVoting', function () {
);
expect(fromProtocolVersion).to.not.deep.equal(toProtocolVersion);
expect(fromProtocolVersion).to.deep.equal([1, 0, 0]);
expect(toProtocolVersion).to.deep.equal(osxContractsVersion());
expect(toProtocolVersion).to.deep.equal([1, 4, 0]);
});
});

Expand Down
11 changes: 0 additions & 11 deletions packages/contracts/test/test-utils/protocol-version.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
import {version} from '../../package.json';

// 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` package.json file
*/
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])];
}
6 changes: 3 additions & 3 deletions packages/contracts/test/test-utils/typechain-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
/// Import as needed in the test files, and use the correct version of the contract.

/* TokenVoting */
export {TokenVoting__factory as TokenVoting_V1_0_0__factory} from '../../typechain/factories/@aragon/osx-v1.0.1/plugins/governance/majority-voting/token/TokenVoting__factory';
export {TokenVoting__factory as TokenVoting_V1_0_0__factory} from '../../typechain/factories/@aragon/osx-v1.0.0/plugins/governance/majority-voting/token/TokenVoting__factory';
export {TokenVoting__factory as TokenVoting_V1_3_0__factory} from '../../typechain/factories/@aragon/osx-v1.3.0/plugins/governance/majority-voting/token/TokenVoting__factory';
export {TokenVoting__factory} from '../../typechain/factories/src/TokenVoting__factory';
export {TokenVoting} from '../../typechain/src/TokenVoting';

/* Governance ERC20 */
export {GovernanceERC20__factory as GovernanceERC20_V1_0_0__factory} from '../../typechain/factories/@aragon/osx-v1.0.1/token/ERC20/governance/GovernanceERC20__factory';
export {GovernanceERC20__factory as GovernanceERC20_V1_0_0__factory} from '../../typechain/factories/@aragon/osx-v1.0.0/token/ERC20/governance/GovernanceERC20__factory';
export {GovernanceERC20__factory as GovernanceERC20_V1_3_0__factory} from '../../typechain/factories/@aragon/osx-v1.3.0/token/ERC20/governance/GovernanceERC20__factory';
export {GovernanceERC20__factory} from '../../typechain/factories/src/ERC20/governance/GovernanceERC20__factory';
export {GovernanceERC20} from '../../typechain/src/ERC20/governance/GovernanceERC20';

/* Governance Wrapped ERC20 */
export {GovernanceWrappedERC20__factory as GovernanceWrappedERC20_V1_0_0__factory} from '../../typechain/factories/@aragon/osx-v1.0.1/token/ERC20/governance/GovernanceWrappedERC20__factory';
export {GovernanceWrappedERC20__factory as GovernanceWrappedERC20_V1_0_0__factory} from '../../typechain/factories/@aragon/osx-v1.0.0/token/ERC20/governance/GovernanceWrappedERC20__factory';
export {GovernanceWrappedERC20__factory as GovernanceWrappedERC20_V1_3_0__factory} from '../../typechain/factories/@aragon/osx-v1.3.0/token/ERC20/governance/GovernanceWrappedERC20__factory';
export {GovernanceWrappedERC20__factory} from '../../typechain/factories/src/ERC20/governance/GovernanceWrappedERC20__factory';
export {GovernanceWrappedERC20} from '../../typechain/src/ERC20/governance/GovernanceWrappedERC20';
2 changes: 1 addition & 1 deletion packages/contracts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
dependencies:
ethers "^5.6.2"

"@aragon/osx-v1.0.1@npm:@aragon/[email protected]":
"@aragon/osx-v1.0.0@npm:@aragon/[email protected]":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@aragon/osx/-/osx-1.0.1.tgz#b758ba87db93a46a8ddabfaefc99ac8e44c46c78"
integrity sha512-TiP5/1AGv/hth+V8PoDVFlwMzmLazYxzp//jiepAZ0WJkx9EnQNYafo+M7+pjAqRPG005liQjmFZNiK6ARLULg==
Expand Down

0 comments on commit f298b7e

Please sign in to comment.