From b699623610e8db25cc19bcb6ab7cf9098e651136 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Fri, 24 May 2019 19:29:39 -0400 Subject: [PATCH] fix: added current timestamp to commit time --- .gitignore | 1 + src/actions.js | 2 ++ src/menus.js | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e060deb..db48e6a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ __pycache__ .secret.json TODO +accounts.json \ No newline at end of file diff --git a/src/actions.js b/src/actions.js index 4b9a0b3..74e6dff 100644 --- a/src/actions.js +++ b/src/actions.js @@ -96,6 +96,7 @@ class Actions { } async addProject(params) { + params.commitTime = Math.floor(Date.now() / 1000) + params.commitTime; let text = `await LiquidPledging.methods.addProject(\"${params.name}\", \"${params.url}\", \"${params.account}\", ${params.parentProject}, ${params.commitTime}, \"${params.plugin}\").send({gas: 2000000, gasPrice: web3.utils.toWei(${params.gasPrice}, "gwei")})` return doAction(text, async () => { const toSend = this.contracts.LiquidPledging.methods.addProject(params.name, params.url, params.account, params.parentProject, params.commitTime, params.plugin); @@ -178,6 +179,7 @@ class Actions { } async addGiver(params) { + params.commitTime = Math.floor(Date.now() / 1000) + params.commitTime; let text = `await LiquidPledging.methods.addGiver(\"${params.name}\", \"${params.url}\", ${params.commitTime}, \"${params.plugin}\").send({gas: 2000000, gasPrice: web3.utils.toWei(${params.gasPrice}, "gwei")})` return doAction(text, async () => { const toSend = this.contracts.LiquidPledging.methods.addGiver(params.name, params.url, params.commitTime, params.plugin); diff --git a/src/menus.js b/src/menus.js index 2f390ae..e971f78 100644 --- a/src/menus.js +++ b/src/menus.js @@ -155,7 +155,7 @@ const menus = { { type: 'input', name: 'commitTime', - message: 'Time in seconds after which the project owner can access funds', + message: 'Seconds from now which any project funded by this project can access funds', default: 86400, filter: Number }, @@ -238,7 +238,7 @@ const menus = { { type: 'input', name: 'commitTime', - message: 'commit time', + message: 'Seconds from now which the project owner can access any funds pledged by this funder', default: 86400, filter: Number },