Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const certificate = contract(Certificate);
- certificate.setProvider(web3.currentProvider);
- var certificateInstance =
- certificate.at("0xfcdf59a5e2a43059d3d469f4aa31534d6c0d00b7");
- return certificateInstance
- .ownerName() // state variable in the contract
- .then(function(_ownerName) {
- console.log(_ownerName);
- // getParam2 is the function with onlyOwner modifier
- return certificateInstance.getParam2({ from: owner });
- })
- .then(function(_value) {
- console.log(_value);
- });
- ...
- return Certificate.at(certAddress);
- }).then(function(instance){
- certInstance = instance;
- return certInstance.getParam2({from: owner});
- }).then(function(_value){
- assert.equal(_value, "param2value", "modifier function returns correct value"
- })
Add Comment
Please, Sign In to add comment