Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: interfaces and ERC-165 #40

Merged
merged 99 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
e0e976d
build: added version number to allow importing
heueristik Nov 13, 2023
e067fec
revert: remove osx dependency
heueristik Dec 18, 2023
2515b31
fix: use new IDAO
heueristik Dec 19, 2023
8ccdac3
feat: add former voting helpers
heueristik Dec 19, 2023
54c1cf6
feat: refactored helpers
heueristik Dec 19, 2023
e35d4e1
refactor: event function
heueristik Dec 19, 2023
f10fa89
refactor: improved naming
heueristik Dec 19, 2023
b6b3801
refactor: improve time helpers
heueristik Dec 19, 2023
d795116
refactor: removed hardhat time
heueristik Dec 19, 2023
c4dd9e9
fix: wrong import
heueristik Dec 19, 2023
0f8a228
refactor: improve time constants
heueristik Dec 20, 2023
2bd0734
docs: add todo comment
heueristik Dec 20, 2023
9c6aaee
refactor: move over plugin and plugin setups as well as permissions
heueristik Dec 20, 2023
140aa52
refactor: renaming and changed folder structure
heueristik Dec 20, 2023
7aab86e
feat: added bitmap
heueristik Dec 20, 2023
92c5596
refactor: moved metadata into separate file
heueristik Dec 20, 2023
1a2d52a
refactor: moved events
heueristik Dec 21, 2023
9667294
refactor: moved permissions
heueristik Dec 21, 2023
ea85255
revert: version bump of solhint
heueristik Dec 21, 2023
d1bab33
refactor: improve folder structure
heueristik Dec 21, 2023
69f6a14
refactor: folders structure, imports, yarn lock
heueristik Dec 21, 2023
f35ae17
ci: fix
heueristik Jan 3, 2024
cdaffb4
fix: version mismatch with sdk
heueristik Jan 3, 2024
7cdbe5d
revert: remove etherscan
heueristik Jan 4, 2024
8c9bda5
refactor: rename event constants
heueristik Jan 4, 2024
10eddaf
ci: make sdk an alpha version
heueristik Jan 4, 2024
e8ee0e1
feat: move permissions
heueristik Jan 4, 2024
2cc4ee6
build: rename package
heueristik Jan 4, 2024
2887dcc
refactor: structure
heueristik Jan 4, 2024
5888c15
build: save yarn lock
heueristik Jan 4, 2024
c8d4e36
build: use same typescript version
heueristik Jan 4, 2024
b09bd31
refactor: imports
heueristik Jan 4, 2024
6c080b0
build: contracts start with alpha version
heueristik Jan 4, 2024
59a674d
build: use commons-sdk
heueristik Jan 4, 2024
42f53b9
fix: imports
heueristik Jan 4, 2024
1e0082a
build: add files to index
heueristik Jan 4, 2024
aebf809
v0.0.1-alpha.1
heueristik Jan 4, 2024
ec82d63
fix: bump version and fix import
heueristik Jan 4, 2024
c07e979
fix: imports
heueristik Jan 4, 2024
b3eb6f9
fix: missing export
heueristik Jan 4, 2024
0600871
chore: bump version
heueristik Jan 4, 2024
b8aa7f2
chore: save lock file
heueristik Jan 4, 2024
6b5202f
chore: bump version
heueristik Jan 4, 2024
ad51422
build: no postinstall
heueristik Jan 4, 2024
8bc8cbf
chore: ignore DS_Store files
heueristik Jan 4, 2024
d45efdd
v0.0.1-alpha.3
heueristik Jan 4, 2024
40afffb
refactor: remove proxy helper
heueristik Jan 4, 2024
5baa633
build: add protocol version
heueristik Jan 4, 2024
211562a
v0.0.1-alpha.4
heueristik Jan 4, 2024
869e60b
feat: made ProtocolVersion non-abstract
heueristik Jan 4, 2024
2afff6c
refactor: protocol version number
heueristik Jan 4, 2024
62f0e98
revert: make ProtocolVersion abstract and use mock instead
heueristik Jan 4, 2024
88c5b49
v1.4.0-alpha.1
heueristik Jan 4, 2024
b0af22c
refactor: renamed function
heueristik Jan 4, 2024
6ce2b61
chore: maintain changelog
heueristik Jan 5, 2024
2aa1ce2
build: improve build
heueristik Jan 5, 2024
2959d4d
ci: added missing secret
heueristik Jan 5, 2024
a9257c5
revert: remove duplicate
heueristik Jan 5, 2024
f91ab39
build: remove osx-ethers dependencies
heueristik Jan 5, 2024
2c863b5
revert: remove TestPlugin
heueristik Jan 5, 2024
d919605
build: use files allowlist instead of .npmignore denylist
heueristik Jan 5, 2024
75e3df1
refactor: improved mocks
heueristik Jan 5, 2024
e1a05e0
refactor: improved mocks further
heueristik Jan 5, 2024
639aa7c
refactor: rename test
heueristik Jan 5, 2024
c64518a
refactor: remove placeholder setup
heueristik Jan 5, 2024
592ca62
feat: added test sekletons and todos
heueristik Jan 8, 2024
b0633de
revert: removed todo that has its own task already
heueristik Jan 9, 2024
9f7071d
build: bump version number
heueristik Jan 9, 2024
450e00a
docs: improved plugin setup mock data
heueristik Jan 9, 2024
b4dcf82
refactor: renamed PluginMockData to PluginSetupMockData
heueristik Jan 9, 2024
f63550c
refactor: setup mocks
heueristik Jan 9, 2024
340a40e
build: remove src folder
heueristik Jan 9, 2024
0004b87
refactor: move and added todo
heueristik Jan 9, 2024
47fca75
refactor: move auth into dao folder
heueristik Jan 9, 2024
ffd7cbb
build: adapt the hardhat solidity source path subtask
heueristik Jan 9, 2024
1f1426d
refactor: move auth
heueristik Jan 9, 2024
b71bf5c
revert: src removal
heueristik Jan 9, 2024
695c943
revert: delete storage
heueristik Jan 9, 2024
070a028
refactor: move governance into extensions
heueristik Jan 9, 2024
5967435
build: remove governance folder from package.json
heueristik Jan 9, 2024
e2808ec
fix: wrong path
heueristik Jan 10, 2024
d66bb05
refactor: harmonize mock contract naming and move CloneFactory
heueristik Jan 10, 2024
0cca2df
revert: author comment for mock
heueristik Jan 10, 2024
0e8297f
feat: use name aliases
heueristik Jan 10, 2024
99a7c36
feat: added interface related tests
heueristik Jan 10, 2024
a501011
fix: added missing await
heueristik Jan 10, 2024
55b7acb
style: improved linting
heueristik Jan 10, 2024
3ea6230
fix: contract linting errors
heueristik Jan 10, 2024
c877f39
style: improve linting
heueristik Jan 10, 2024
0e15fbd
fix: subgraph linter complaints
heueristik Jan 10, 2024
a7e7a6f
docs: remove todos and add test skeleton
heueristik Jan 10, 2024
d0fd87f
style: fix enum values
heueristik Jan 11, 2024
44edb05
feat: add custom event error
heueristik Jan 11, 2024
acc3622
chore: use new sdk
heueristik Jan 11, 2024
59c2c6d
docs: fix comments
heueristik Jan 11, 2024
c2b4fc3
Merge branch 'feature/contracts-and-sdk-refactor' into feature/OS-945…
heueristik Jan 11, 2024
17ed2b2
Merge branch 'develop' into feature/OS-945-erc-165-tests
heueristik Jan 11, 2024
e44212d
fix: linter
heueristik Jan 11, 2024
57b3e93
test: added missing interface test
heueristik Jan 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extends:

plugins:
- '@typescript-eslint'
- 'unused-imports'

rules:
'@typescript-eslint/no-floating-promises':
Expand All @@ -21,6 +22,8 @@ rules:
- argsIgnorePattern: '_'
varsIgnorePattern: '_'

'unused-imports/no-unused-imports': 'error'

ignorePatterns:
- '*.log'
- '*.env'
Expand Down
1 change: 1 addition & 0 deletions contracts/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ignorePatterns:
- cache
- coverage
- dist
- docs
- typechain
# files
- coverage.json
2 changes: 2 additions & 0 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
},
"devDependencies": {
"@aragon/osx-commons-sdk": "0.0.1-alpha.3",
"@aragon/osx-ethers-v1.0.0": "npm:@aragon/[email protected]",
"@aragon/osx-ethers-v1.3.0": "npm:@aragon/[email protected]",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/bignumber": "^5.7.0",
Expand Down
12 changes: 12 additions & 0 deletions contracts/test/dao/dao.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {IDAO__factory} from '../../typechain';
import {getInterfaceId} from '@aragon/osx-commons-sdk';
import {IDAO__factory as IDAO_V1_0_0__factory} from '@aragon/osx-ethers-v1.0.0';
import {expect} from 'chai';

describe('IDAO', function () {
it('has the same interface ID as its initial version introduced in v1.0.0', async () => {
const current = getInterfaceId(IDAO__factory.createInterface());
const initial = getInterfaceId(IDAO_V1_0_0__factory.createInterface());
expect(current).to.equal(initial);
});
});
17 changes: 17 additions & 0 deletions contracts/test/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {IERC165__factory} from '../typechain';
import {getInterfaceId} from '@aragon/osx-commons-sdk';
import {SignerWithAddress} from '@nomiclabs/hardhat-ethers/signers';
import {expect} from 'chai';
import {Contract} from 'ethers';

export async function erc165ComplianceTests(
contract: Contract,
signer: SignerWithAddress
) {
const erc165Contract = IERC165__factory.connect(contract.address, signer);
const erc165InterfaceId = getInterfaceId(IERC165__factory.createInterface());
const emptyInterfaceId = '0xffffffff';

expect(await erc165Contract.supportsInterface(erc165InterfaceId)).to.be.true;
expect(await erc165Contract.supportsInterface(emptyInterfaceId)).to.be.false;
}
2 changes: 0 additions & 2 deletions contracts/test/permission/auth/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {expect} from 'chai';

// TODO

describe.skip('auth', async () => {
it('reverts with an error if the permission is not granted', async () => {
expect(true).to.equal(false);
Expand Down
2 changes: 0 additions & 2 deletions contracts/test/permission/auth/dao-authorizable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {expect} from 'chai';

// TODO

describe.skip('DaoAuthorizable', async () => {
// TODO abstract these common tests that also apply to `DaoAuthorizableUpgradeable`
it('initializes the DAO', async () => {
Expand Down
18 changes: 6 additions & 12 deletions contracts/test/permission/permission-condition.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import {
IERC165__factory,
IPermissionCondition__factory,
IProtocolVersion__factory,
PermissionConditionMock,
PermissionConditionMock__factory,
} from '../../typechain';
import {erc165ComplianceTests} from '../helpers';
import {getInterfaceId} from '@aragon/osx-commons-sdk';
import {SignerWithAddress} from '@nomiclabs/hardhat-ethers/signers';
import {expect} from 'chai';
import {ethers} from 'hardhat';

// TODO

describe('PermissionCondition', async () => {
let condition: PermissionConditionMock;
let deployer: SignerWithAddress;

before(async () => {
const deployer = (await ethers.getSigners())[0];
[deployer] = await ethers.getSigners();
condition = await new PermissionConditionMock__factory(deployer).deploy();
});

Expand All @@ -29,14 +29,8 @@ describe('PermissionCondition', async () => {
});

describe('ERC-165', async () => {
it('does not support the empty interface', async () => {
expect(await condition.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165` interface', async () => {
const iface = IERC165__factory.createInterface();
expect(await condition.supportsInterface(getInterfaceId(iface))).to.be
.true;
it('supports the `ERC-165` standard', async () => {
await erc165ComplianceTests(condition, deployer);
});

it('supports the `IPermissionCondition` interface', async () => {
Expand Down
Loading