var CredentialOrgFactory = artifacts.require("CredentialOrgFactory");
var CredentialFactory = artifacts.require("CredentialFactory");
var ApplicantFactory = artifacts.require("ApplicantFactory");
//var ProcessCredentials = artifacts.require("ProcessCredentials");
module.exports = async(deployer) => {
let deployCredentialOrgFactory = await deployer.deploy(CredentialOrgFactory);
let deployCredentialFactory = await deployer.deploy(CredentialFactory);
contractCredentialFactory = await CredentialFactory.deployed()
let setAddress = await contractTwo.setAddress(
CredentialOrgFactory.address,
{ gas: 200000 }
);
};
with the message:
(node:13120) UnhandledPromiseRejectionWarning: Error: VM Exception while processing transaction: revert
//some unimportant stuff //
(node:13120) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13120) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
what is the proper coding in the 2_deploy_contracts.js file? maybe i'm not setting the address of CredentialFactory properly? thoughts? i'm a bit stuck atm.
it could be part of the test file.
pragma solidity ^0.4.21;
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../contracts/CredentialFactory.sol";
contract TestCredentialFactory {
CredentialFactory credentialFactory = CredentialFactory(DeployedAddresses.CredentialFactory());
function testIsActiveValid() public {
bool r = credentialFactory.isCredentialActive(0x2259aA88Cc0aa3d83d5ec5aF6096C627778FBD06, 0);
Assert.isTrue(r, "Valid isActive Test.");
}
function testIsActiveInvalid() public {
bool r = credentialFactory.isCredentialActive(0x5a186B7FeC36909678211F69beB67EC3b1E4fFBB, 5);
Assert.isFalse(r, "Outside Range IsActive Test");
}
function SelectOrgCredentialCount() public {
uint256 testVal = uint256(credentialFactory.SelectOrgCredentialCount(0x2259aA88Cc0aa3d83d5ec5aF6096C627778FBD06));
uint256 expected = 1;
Assert.equal(testVal, expected, "Expected Credential Count (1)");
}
}