Merge pull request #18 from status-im/fix/commit-time
fix: added current timestamp to commit time
This commit is contained in:
commit
3485dcca29
|
@ -20,3 +20,4 @@ __pycache__
|
||||||
|
|
||||||
.secret.json
|
.secret.json
|
||||||
TODO
|
TODO
|
||||||
|
accounts.json
|
|
@ -96,6 +96,7 @@ class Actions {
|
||||||
}
|
}
|
||||||
|
|
||||||
async addProject(params) {
|
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")})`
|
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 () => {
|
return doAction(text, async () => {
|
||||||
const toSend = this.contracts.LiquidPledging.methods.addProject(params.name, params.url, params.account, params.parentProject, params.commitTime, params.plugin);
|
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) {
|
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")})`
|
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 () => {
|
return doAction(text, async () => {
|
||||||
const toSend = this.contracts.LiquidPledging.methods.addGiver(params.name, params.url, params.commitTime, params.plugin);
|
const toSend = this.contracts.LiquidPledging.methods.addGiver(params.name, params.url, params.commitTime, params.plugin);
|
||||||
|
|
|
@ -155,7 +155,7 @@ const menus = {
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
name: 'commitTime',
|
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,
|
default: 86400,
|
||||||
filter: Number
|
filter: Number
|
||||||
},
|
},
|
||||||
|
@ -238,7 +238,7 @@ const menus = {
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
name: 'commitTime',
|
name: 'commitTime',
|
||||||
message: 'commit time',
|
message: 'Seconds from now which the project owner can access any funds pledged by this funder',
|
||||||
default: 86400,
|
default: 86400,
|
||||||
filter: Number
|
filter: Number
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue