Merge pull request #18 from status-im/fix/commit-time

fix: added current timestamp to commit time
This commit is contained in:
Iuri Matias 2019-05-26 19:32:56 -04:00 committed by GitHub
commit 3485dcca29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ __pycache__
.secret.json
TODO
accounts.json

View File

@ -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);

View File

@ -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
},