Skip to content

Commit

Permalink
add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Flores committed Feb 8, 2020
1 parent 486d4d4 commit 5b53bfb
Show file tree
Hide file tree
Showing 17 changed files with 17,849 additions and 17,786 deletions.
18 changes: 9 additions & 9 deletions scripts/test/ci.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// import tests
const deployMockExternal = require('./deployMockExternal.js');
const deploy = require('./deploy');
const test = require('./test');
const deployMockExternal = require("./deployMockExternal.js");
const deploy = require("./deploy");
const test = require("./test");

// run tests
async function runTests() {
const context = process.env.TESTING_CONTEXT;
const context = process.env.TESTING_CONTEXT;

await deployMockExternal.test(context);
await deploy.test(context);
await test.test(context);
process.exit(0)
await deployMockExternal.test(context);
await deploy.test(context);
await test.test(context);
process.exit(0);
}

runTests();
runTests();
1,256 changes: 591 additions & 665 deletions scripts/test/constants.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
const constants = require("../../constants");
const { newContractAndSwapMetadataHash } = require("../../testHelpers");

const IndestructibleRegistryArtifact = require('../../../../build/contracts/IndestructibleRegistry.json');
const IndestructibleRegistryArtifact = require("../../../../build/contracts/IndestructibleRegistry.json");

async function testIndestructibleRegistry(tester, contracts) {
const {
DharmaSmartWalletImplementationV6,
DharmaSmartWalletImplementationV7,
DharmaKeyRingImplementationV1,
DharmaKeyRingImplementationV1
} = contracts;

const IndestructibleRegistryDeployer = newContractAndSwapMetadataHash(
const IndestructibleRegistryDeployer = newContractAndSwapMetadataHash(
IndestructibleRegistryArtifact
);

const IndestructibleRegistry = await tester.runTest(
`IndestructibleRegistry contract deployment`,
IndestructibleRegistryDeployer,
'',
'deploy'
)
"",
"deploy"
);

await tester.runTest(
'IndestructibleRegistry can register itself as indestructible',
"IndestructibleRegistry can register itself as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[IndestructibleRegistry.options.address]
)
);

await tester.runTest(
'IndestructibleRegistry can register the upgrade beacon as indestructible',
"IndestructibleRegistry can register the upgrade beacon as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.UPGRADE_BEACON_ADDRESS]
)
);

await tester.runTest(
'IndestructibleRegistry can register the upgrade beacon controller as indestructible',
"IndestructibleRegistry can register the upgrade beacon controller as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.UPGRADE_BEACON_CONTROLLER_ADDRESS]
)
);

await tester.runTest(
'IndestructibleRegistry can register the key ring upgrade beacon as indestructible',
"IndestructibleRegistry can register the key ring upgrade beacon as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.KEY_RING_UPGRADE_BEACON_ADDRESS]
)
);

await tester.runTest(
'IndestructibleRegistry can register the key ring upgrade beacon controller as indestructible',
"IndestructibleRegistry can register the key ring upgrade beacon controller as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.KEY_RING_UPGRADE_BEACON_CONTROLLER_ADDRESS]
)
);

await tester.runTest(
'IndestructibleRegistry can register the upgrade beacon envoy as indestructible',
"IndestructibleRegistry can register the upgrade beacon envoy as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.UPGRADE_BEACON_ENVOY_ADDRESS]
)
);

await tester.runTest(
'IndestructibleRegistry can register the account recovery manager V2 as indestructible',
"IndestructibleRegistry can register the account recovery manager V2 as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.ACCOUNT_RECOVERY_MANAGER_V2_ADDRESS]
)
);

/*
await tester.runTest(
Expand All @@ -88,45 +88,45 @@ async function testIndestructibleRegistry(tester, contracts) {
*/

await tester.runTest(
'IndestructibleRegistry can register DharmaKeyRegistryV2 as indestructible',
"IndestructibleRegistry can register DharmaKeyRegistryV2 as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.KEY_REGISTRY_V2_ADDRESS]
)
);

await tester.runTest(
'IndestructibleRegistry can register DharmaEscapeHatchRegistry as indestructible',
"IndestructibleRegistry can register DharmaEscapeHatchRegistry as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.ESCAPE_HATCH_REGISTRY_ADDRESS]
)
);

await tester.runTest(
'WARNING: IndestructibleRegistry CANNOT register the smart wallet factory as indestructible (even though it is in fact NOT destructible)',
"WARNING: IndestructibleRegistry CANNOT register the smart wallet factory as indestructible (even though it is in fact NOT destructible)",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.FACTORY_ADDRESS],
false
)
);

await tester.runTest(
'IndestructibleRegistry can register the Adharma smart wallet implementation as indestructible',
"IndestructibleRegistry can register the Adharma smart wallet implementation as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.ADHARMA_SMART_WALLET_IMPLEMENTATION_ADDRESS]
)
);

await tester.runTest(
'IndestructibleRegistry can register the Adharma key ring implementation as indestructible',
"IndestructibleRegistry can register the Adharma key ring implementation as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.ADHARMA_KEY_RING_IMPLEMENTATION_ADDRESS]
)
);

/*
await tester.runTest(
Expand Down Expand Up @@ -156,7 +156,7 @@ async function testIndestructibleRegistry(tester, contracts) {
)
*/

if (tester.context !== 'coverage') {
if (tester.context !== "coverage") {
/*
await tester.runTest(
'IndestructibleRegistry can register V2 implementation as indestructible',
Expand Down Expand Up @@ -193,28 +193,28 @@ async function testIndestructibleRegistry(tester, contracts) {
*/

await tester.runTest(
'IndestructibleRegistry can register V6 implementation as indestructible',
"IndestructibleRegistry can register V6 implementation as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[DharmaSmartWalletImplementationV6.options.address]
)
);

await tester.runTest(
'IndestructibleRegistry can register V7 implementation as indestructible',
"IndestructibleRegistry can register V7 implementation as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[DharmaSmartWalletImplementationV7.options.address]
)
);

await tester.runTest(
'IndestructibleRegistry can register V1 key ring implementation as indestructible',
"IndestructibleRegistry can register V1 key ring implementation as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[DharmaKeyRingImplementationV1.options.address]
)
);
}

/*
Expand All @@ -228,15 +228,14 @@ async function testIndestructibleRegistry(tester, contracts) {
*/

await tester.runTest(
'IndestructibleRegistry can register the upgrade beacon controller manager as indestructible',
"IndestructibleRegistry can register the upgrade beacon controller manager as indestructible",
IndestructibleRegistry,
'registerAsIndestructible',
'send',
"registerAsIndestructible",
"send",
[constants.UPGRADE_BEACON_CONTROLLER_MANAGER_ADDRESS]
)
);
}

module.exports = {
testIndestructibleRegistry,
}

testIndestructibleRegistry
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,68 @@ async function testDharmaAccountRecoveryMultisigDeployer(tester, contract) {
await tester.runTest(
`DharmaAccountRecoveryMultisig contract deployment fails if threshold is not met`,
contract,
'',
'deploy',
[[
'0x0000000000000000000000000000000000000001'
]],
"",
"deploy",
[["0x0000000000000000000000000000000000000001"]],
false
)
);

await tester.runTest(
`DharmaAccountRecoveryMultisig contract deployment fails if sigs are out of order`,
contract,
'',
'deploy',
[[
'0x0000000000000000000000000000000000000005',
'0x0000000000000000000000000000000000000002',
'0x0000000000000000000000000000000000000003',
'0x0000000000000000000000000000000000000004',
'0x0000000000000000000000000000000000000001'
]],
"",
"deploy",
[
[
"0x0000000000000000000000000000000000000005",
"0x0000000000000000000000000000000000000002",
"0x0000000000000000000000000000000000000003",
"0x0000000000000000000000000000000000000004",
"0x0000000000000000000000000000000000000001"
]
],
false
)
);

await tester.runTest(
`DharmaAccountRecoveryMultisig contract deployment fails with too many owners`,
contract,
'',
'deploy',
[[
'0x0000000000000000000000000000000000000001',
'0x0000000000000000000000000000000000000002',
'0x0000000000000000000000000000000000000003',
'0x0000000000000000000000000000000000000004',
'0x0000000000000000000000000000000000000005',
'0x0000000000000000000000000000000000000006',
'0x0000000000000000000000000000000000000007',
'0x0000000000000000000000000000000000000008',
'0x0000000000000000000000000000000000000009',
'0x000000000000000000000000000000000000000a',
'0x000000000000000000000000000000000000000b'
]],
"",
"deploy",
[
[
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000002",
"0x0000000000000000000000000000000000000003",
"0x0000000000000000000000000000000000000004",
"0x0000000000000000000000000000000000000005",
"0x0000000000000000000000000000000000000006",
"0x0000000000000000000000000000000000000007",
"0x0000000000000000000000000000000000000008",
"0x0000000000000000000000000000000000000009",
"0x000000000000000000000000000000000000000a",
"0x000000000000000000000000000000000000000b"
]
],
false
)
);

await tester.runTest(
`DharmaAccountRecoveryMultisig contract deployment`,
contract,
'',
'deploy',
[[tester.ownerOne, tester.ownerTwo, tester.ownerThree, tester.ownerFour]]
)
"",
"deploy",
[
[
tester.ownerOne,
tester.ownerTwo,
tester.ownerThree,
tester.ownerFour
]
]
);
}

module.exports = {
testDharmaAccountRecoveryMultisigDeployer,
testDharmaAccountRecoveryMultisigDeployer
};
Loading

0 comments on commit 5b53bfb

Please sign in to comment.