Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monkey-patch server.web3-events to avoir repeating last-processed block #438

Merged
merged 18 commits into from
Dec 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix smart contract migrations
madis committed Oct 31, 2024
commit d959e419ca4e3012f60b10031e0024f0f5ac4941
18 changes: 16 additions & 2 deletions migrations/2_unchangeable_and_proxy_contracts.js
Original file line number Diff line number Diff line change
@@ -14,8 +14,16 @@ let Job = artifacts.require("Job");
let EthlanceStructs = artifacts.require("EthlanceStructs");
let EthlanceProxy = artifacts.require("EthlanceProxy");
let MutableForwarder = artifacts.require("MutableForwarder");
// copy("EthlanceProxy", "EthlanceProxy", contracts_build_directory);
// let EthlanceProxy = artifacts.require("EthlanceProxy");

let deployedContracts = {};

function getDeployedAddress(contractName) {
const address = deployedContracts[contractName];
if (address == null) {
throw new Error("Contract with" + contractName + " not founc in deployedContracts");
}
return address;
}

// Deployment Functions

@@ -68,6 +76,10 @@ async function deploy_proxies(deployer, opts) {
}

async function deploy_Job(deployer, opts){
jobHelpersInstance = await JobHelpers.at(getDeployedAddress("JobHelpers"));
ethlanceStructsInstance = await EthlanceStructs.at(getDeployedAddress("EthlanceStructs"));
deployer.link(jobHelpersInstance, Job);
deployer.link(ethlanceStructsInstance, Job);
let job = await deployer.deploy(Job, {...opts, gas: 18e6});
assignContract(job, "Job", "job");
}
@@ -78,6 +90,7 @@ async function deploy_all(deployer, opts) {
await deploy_TestMultiToken(deployer, opts);
await deploy_EthlanceStructs(deployer, opts);
await deploy_JobHelpers(deployer, opts);

await deploy_Job(deployer, opts);
await deploy_proxies(deployer, opts);
}
@@ -94,6 +107,7 @@ let smart_contract_listing = [];
*/
function assignContract(contract_instance, contract_name, contract_key, opts) {
console.log("- Assigning '" + contract_name + "' to smart contract listing...");
deployedContracts[contract_name] = contract_instance.address;
opts = opts || {};
smart_contract_listing = smart_contract_listing.concat(
encodeContractEDN(contract_instance, contract_name, contract_key, opts));