Skip to content

Commit

Permalink
add unpublishPlan logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ninabreznik committed Feb 19, 2024
1 parent 516763e commit 62de935
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 97 deletions.
4 changes: 2 additions & 2 deletions demo/scenarios/2.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

module.exports = [
// { "name": "joshua", "behavior": ["register_chain_account", "sponsor_plan", "offer_service"] },
// { "name": "nora", "behavior": ["register_chain_account", "author_hypercore"] },
{ "name": "joshua", "behavior": ["register_chain_account", "sponsor_plan", "offer_service"] },
{ "name": "nora", "behavior": ["register_chain_account", "author_hypercore"] },
{ "name": "tony", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "jannis", "behavior": ["register_chain_account", "offer_service"] },
{ "name": "nina", "behavior": ["register_chain_account", "offer_service"] },
Expand Down
2 changes: 1 addition & 1 deletion demo/simsim.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function run (params) {
console.log('3. ===== stop `two` =====')
// console.log('4. ===== just end everything =====')
const delay3 = 12000
setTimeout(() => all_processes[pos2].kill('SIGINT'), delay3)
// setTimeout(() => all_processes[pos2].kill('SIGINT'), delay3)
}
/**********************************************************
SCENARIOS
Expand Down
10 changes: 8 additions & 2 deletions src/node_modules/datdot-chain-sdk/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/node_modules/datdot-chain-sdk/simulate-polkadotjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/node_modules/datdot-node-javascript-internal/DB.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 34 additions & 49 deletions src/node_modules/datdot-node-javascript-internal/chain.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 37 additions & 18 deletions src/node_modules/datdot-simulate-user/behavior/sponsor-plan.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions src/roles/attester.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = APIS => {
const { identity, log, hyper } = account
const { myAddress, signer, noiseKey: attesterkey } = identity
// log({ type: 'attester', data: [`I am an attester`] })
const jobsDB = await tempDB(attesterkey)
chainAPI.listenToEvents(handleEvent)

async function handleEvent (event) {
Expand Down Expand Up @@ -805,10 +804,6 @@ async function unpublishPlan_handler (args) {
const { event, chainAPI, account, signer, attesterkey, myAddress, hyper, log } = args
const [planID] = event.data
// const jobIDs = unpublishedPlan_jobIDs(planID)
// jobIDs.forEach(jobID => {
// const job = jobsDB.get(jobID)
// if (job) { /* TODO: ... */ }
// })
}
/* ----------------------------------------------------------------------
DROP HOSTING
Expand All @@ -818,10 +813,6 @@ async function dropHosting_handler (args) {
const { event, chainAPI, account, signer, attesterkey, myAddress, hyper, log } = args
const [planID] = event.data
// const jobIDs = unpublishedPlan_jobIDs(planID)
// jobIDs.forEach(jobID => {
// const job = jobsDB.get(jobID)
// if (job) { /* TODO: ... */ }
// })
}

/* ----------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 62de935

Please sign in to comment.