Improve helper scripts #41

Merged
bumi merged 7 commits from feature/improve-scripts into master 2018-04-29 07:43:23 +00:00
bumi commented 2018-04-23 10:12:34 +00:00 (Migrated from github.com)

now using the library in add-proposal.js, too. And the CLI is smarter and allows calling functions on the contract and on the wrapper.

now using the library in add-proposal.js, too. And the CLI is smarter and allows calling functions on the contract and on the wrapper.
fsmanuel (Migrated from github.com) reviewed 2018-04-25 21:42:12 +00:00
fsmanuel (Migrated from github.com) left a comment

Some comments

Some comments
fsmanuel (Migrated from github.com) commented 2018-04-25 21:14:44 +00:00

Do you have a linter now?

Do you have a linter now?
fsmanuel (Migrated from github.com) commented 2018-04-25 21:20:35 +00:00

Where does contributors come from?

Where does `contributors` come from?
fsmanuel (Migrated from github.com) commented 2018-04-25 21:31:18 +00:00

So good that we went with upper case contract names and the properties instead of the functions!
But it will breaks on Contributor, wouldn’t it? I think we should rename that contract next and align the module code to it. Will make the future much brighter!

So good that we went with upper case contract names and the properties instead of the functions! But it will breaks on `Contributor`, wouldn’t it? I think we should rename that contract next and align the module code to it. Will make the future much brighter!
@ -30,2 +30,4 @@
return;
}
let argumentInput = await promptly.prompt('Arguments (comma separated): ', { default: '' });
let args = [];
fsmanuel (Migrated from github.com) commented 2018-04-25 21:32:13 +00:00

👀 nice!

👀 nice!
@ -34,1 +44,4 @@
func = contractWrapper.functions[method];
}
func.apply(contractWrapper, args).then((result) => {
console.log("\nResult:");
fsmanuel (Migrated from github.com) commented 2018-04-25 21:38:20 +00:00

Haha master of es6. I think you don’t need the if and the initial args
let args = argumentInput.split(',') should return an empty array.

Haha master of es6. I think you don’t need the if and the initial `args` `let args = argumentInput.split(',')` should return an empty array.
bumi (Migrated from github.com) reviewed 2018-04-26 00:27:12 +00:00
bumi (Migrated from github.com) commented 2018-04-26 00:27:12 +00:00

nah, not yet. :(

nah, not yet. :(
bumi (Migrated from github.com) reviewed 2018-04-26 00:29:37 +00:00
@ -34,1 +44,4 @@
func = contractWrapper.functions[method];
}
func.apply(contractWrapper, args).then((result) => {
console.log("\nResult:");
bumi (Migrated from github.com) commented 2018-04-26 00:29:37 +00:00

oh yeah, true.

oh yeah, true.
bumi (Migrated from github.com) reviewed 2018-04-26 00:33:31 +00:00
@ -34,1 +44,4 @@
func = contractWrapper.functions[method];
}
func.apply(contractWrapper, args).then((result) => {
console.log("\nResult:");
bumi (Migrated from github.com) commented 2018-04-26 00:33:31 +00:00

ah noo. it returns an array with an empty string, that was the reason for the if. or what am I missing?

ah noo. it returns an array with an empty string, that was the reason for the if. or what am I missing?
bumi (Migrated from github.com) reviewed 2018-04-26 00:34:37 +00:00
@ -29,0 +25,4 @@
method = await promptly.prompt('Function: ');
}
if (!contractWrapper[method] && !contractWrapper.functions[method]) {
bumi (Migrated from github.com) commented 2018-04-26 00:34:37 +00:00

yes, agree on renaming it! and maybe adding an alias for Contributor <=> Contributors

yes, agree on renaming it! and maybe adding an alias for Contributor <=> Contributors
fsmanuel (Migrated from github.com) reviewed 2018-04-26 10:35:51 +00:00
@ -34,1 +44,4 @@
func = contractWrapper.functions[method];
}
func.apply(contractWrapper, args).then((result) => {
console.log("\nResult:");
fsmanuel (Migrated from github.com) commented 2018-04-26 10:35:51 +00:00

Ah ok.

Ah ok.
raucao (Migrated from github.com) reviewed 2018-04-26 10:40:37 +00:00
@ -34,1 +44,4 @@
func = contractWrapper.functions[method];
}
func.apply(contractWrapper, args).then((result) => {
console.log("\nResult:");
raucao (Migrated from github.com) commented 2018-04-26 10:40:37 +00:00

But if input is already not an empty string, wouldn't it return an array with one argument string?

But if input is already not an empty string, wouldn't it return an array with one argument string?
fsmanuel (Migrated from github.com) reviewed 2018-04-26 10:43:41 +00:00
@ -29,0 +25,4 @@
method = await promptly.prompt('Function: ');
}
if (!contractWrapper[method] && !contractWrapper.functions[method]) {
fsmanuel (Migrated from github.com) commented 2018-04-26 10:43:41 +00:00

I opened #44 for the alias

I opened #44 for the alias
bumi (Migrated from github.com) reviewed 2018-04-26 11:22:18 +00:00
@ -34,1 +44,4 @@
func = contractWrapper.functions[method];
}
func.apply(contractWrapper, args).then((result) => {
console.log("\nResult:");
bumi (Migrated from github.com) commented 2018-04-26 11:22:18 +00:00

https://jsbin.com/qarikabane/edit?js,console

it would return [""] but if no arguments are given I need [].

https://jsbin.com/qarikabane/edit?js,console it would return `[""]` but if no arguments are given I need `[]`.
raucao (Migrated from github.com) reviewed 2018-04-26 11:36:42 +00:00
@ -34,1 +44,4 @@
func = contractWrapper.functions[method];
}
func.apply(contractWrapper, args).then((result) => {
console.log("\nResult:");
raucao (Migrated from github.com) commented 2018-04-26 11:36:42 +00:00

I was actually asking about the trim inside, but no idea why. It's for removing whitespace, so that's still needed.

I was actually asking about the `trim` inside, but no idea why. It's for removing whitespace, so that's still needed.
bumi (Migrated from github.com) reviewed 2018-04-26 21:19:06 +00:00
@ -34,1 +44,4 @@
func = contractWrapper.functions[method];
}
func.apply(contractWrapper, args).then((result) => {
console.log("\nResult:");
bumi (Migrated from github.com) commented 2018-04-26 21:19:06 +00:00

yep, trim() for potential whitespace as for example in "first, second"

yep, trim() for potential whitespace as for example in `"first, second"`
bumi commented 2018-04-26 21:19:50 +00:00 (Migrated from github.com)

mergeable? or is anything missing?

mergeable? or is anything missing?
fsmanuel (Migrated from github.com) approved these changes 2018-04-29 07:43:13 +00:00
Sign in to join this conversation.
No description provided.