-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a small script for testing deployments framework
- Loading branch information
1 parent
f2455fa
commit f0f7c30
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* global artifacts */ | ||
global.web3 = web3; | ||
|
||
const TestContract = artifacts.require("TestContract"); | ||
const MultiSig = artifacts.require("MultiSigWallet"); | ||
|
||
const deployManager = require("../utils/deploy-manager.js"); | ||
const MultisigExecutor = require("../utils/multisigexecutor.js"); | ||
|
||
async function main() { | ||
const { deploymentAccount, configurator } = await deployManager.getProps(); | ||
console.log("deploymentAccount", deploymentAccount); | ||
const { config } = configurator; | ||
|
||
const testContractWrapper = await TestContract.new(); | ||
console.log("TestContract created at", testContractWrapper.address); | ||
|
||
await testContractWrapper.changeOwner(config.contracts.MultiSigWallet); | ||
console.log("Set the MultiSig as the owner of TestContract"); | ||
|
||
const MultiSigWrapper = await MultiSig.at(config.contracts.MultiSigWallet); | ||
const multisigExecutor = new MultisigExecutor(MultiSigWrapper, deploymentAccount, config.multisig.autosign); | ||
await multisigExecutor.executeCall(testContractWrapper, "setStateRestricted", [99]); | ||
const stateValue = await testContractWrapper.state(); | ||
assert.equal(stateValue.toNumber(), 99); | ||
|
||
console.log("## completed deployment script 7 ##"); | ||
} | ||
|
||
// For truffle exec | ||
module.exports = function (callback) { | ||
main().then(() => callback()).catch((err) => callback(err)); | ||
}; |