What is a good way to solve my deployment issue: (furtherance of issue: truffle testing problem, migration successful, testing runs out of gas with addition of testing file)
When i add the TestProcessApplicants.sol file i run out of gas. I suspect this is also true, due to the instantiation of local instances to test some modifiers in the solidity tests.
Modules Remix TransactionCost
CredentialOrgFactory 2209646
CredentialFactory 1934056
SafeMath32 74748
ApplicantFactory 2432336
ProcessApplicants 1937776
Total 8588562
I suspect a 3_deploy_contracts.js file will be needed. I need to be able to set reference addresses like in below deploy, but I need to be able to see previous (2_deploy_contracts.js) instances. how would i go about doing that? Or is there a better approach? or am i just 'doing it wrong'. lol.
here is 2_deploy_contracts.js
var SafeMath32 = artifacts.require("./SafeMath32.sol");
var CredentialOrgFactory = artifacts.require("CredentialOrgFactory");
var CredentialFactory = artifacts.require("CredentialFactory");
var ApplicantFactory = artifacts.require("ApplicantFactory");
var ProcessApplicants = artifacts.require("ProcessApplicants");
module.exports = async function(deployer, accounts) {
let safeMathInst, aInst, bInst, cInst, dInst;
await Promise.all([
deployer.deploy(SafeMath32),
deployer.deploy(CredentialOrgFactory),
deployer.deploy(CredentialFactory),
deployer.deploy(ApplicantFactory),
deployer.deploy(ProcessApplicants),
deployer.link(SafeMath32, [CredentialOrgFactory,CredentialFactory,ApplicantFactory])
]);
instances = await Promise.all([
SafeMath32.deployed(),
CredentialOrgFactory.deployed(),
CredentialFactory.deployed(),
ApplicantFactory.deployed(),
ProcessApplicants.deployed(),
])
aInst = instances[1];
bInst = instances[2];
cInst = instances[3];
dInst = instances[4];
results = await Promise.all([
// Set Address of bInst so it can point at aInst
console.log("setAddress CredentialFactory: for CredentialOrgFactory"),
bInst.setAddress(aInst.address),
// Set Address of cInst so it can point at aInst
cInst.setAddress(aInst.address),
// Set Address of dInst so it can point at aInst, bInst, and cInst
dInst.setAddress(aInst.address, bInst.address, cInst.address)
]);
};