Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabo/sdk 0.26.1-rc1 #1515

Merged
merged 46 commits into from
Nov 17, 2018
Merged

Fabo/sdk 0.26.1-rc1 #1515

merged 46 commits into from
Nov 17, 2018

Conversation

faboweb
Copy link
Collaborator

@faboweb faboweb commented Nov 5, 2018

Description:

Current commit: bb54a0de127e45713f272217f578c0abe53a5b21

❤️ Thank you!


  • Added entries in CHANGELOG.md with issue # and GitHub username
  • Reviewed Files changed in the github PR explorer

@faboweb
Copy link
Collaborator Author

faboweb commented Nov 5, 2018

Waiting on #1512

@fedekunze fedekunze changed the title WIP: Fabo/sdk 0.25.0 WIP: Fabo/sdk 0.26.0-rc0 Nov 8, 2018
@fedekunze
Copy link
Contributor

@faboweb v0.26.0 is out

@@ -28,9 +23,7 @@ const Client = (axios, localLcdURL, remoteLcdURL) => {
if (Array.isArray(args)) {
args = args.join(`/`)
}
if (method === `DELETE`) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember that the DELETE requests needed to have this nested data structure. Did you test if any DELETE requests works like this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I tried to but I'm unable to start Voyager on this branch.

I deleted the above code because the behavior changed when I called Axios using axios({method: 'delete', ...}) instead of axios.delete(... and this change was necessary to make the tests pass again. At least one of the tests was the contract test keys.delete against a real HTTP server so it's likely that any other delete requests will work this way as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, just wanted to make sure

@fedekunze
Copy link
Contributor

@faboweb lint is failing

@faboweb
Copy link
Collaborator Author

faboweb commented Nov 13, 2018

@fedekunze still a lot failing ;)

tasks/build/local/build.js Outdated Show resolved Hide resolved
@faboweb
Copy link
Collaborator Author

faboweb commented Nov 16, 2018

@NodeGuy the suggestion made the linter cry. Could you reformat and push if you find time?

tasks/gaia.js Outdated Show resolved Hide resolved
tasks/gaia.js Outdated Show resolved Hide resolved
tasks/gaia.js Show resolved Hide resolved
}

// execute command and return stdout
function makeExec(command) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use const makeExec = command => instead then it won't get hoisted and I would have spent less time looking for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like hoisting with helper functions. Keeps the top of the file for the important functions. But I understand your approach.

tasks/gaia.js Show resolved Hide resolved
Co-Authored-By: faboweb <[email protected]>
` --commission-max-rate=0` +
` --commission-rate=0` +
` --json`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let command = `${cliBinary} tx create-validator
  --home ${clientHomeDir}
  --from ${keyName}
  --amount=10steak
  --pubkey=${valPubKey}
  --address-delegator=${operatorAddress}
  --moniker=${moniker}
  --chain-id=test_chain
  --commission-max-change-rate=0
  --commission-max-rate=0
  --commission-rate=0
  --json`

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this command includes several \n which doesn't work

tasks/gaia.js Outdated Show resolved Hide resolved
test/e2e/launch.js Outdated Show resolved Hide resolved
test/e2e/launch.js Outdated Show resolved Hide resolved
value = parseInt(value.trim().substr(0, value.length - 2))
} else if (value.trim().endsWith(`s`)) {
value = parseInt(value.trim().substr(0, value.length - 1)) * 1000
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to put this parsing code into a separate function and write unit tests for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels excessive for a one shot. This is also implicitly tested by running this as part of the e2e test. Do you disagree?

app/src/main/index.js Outdated Show resolved Hide resolved
app/src/renderer/scripts/axiosProxy.js Show resolved Hide resolved
tasks/gaia.js Show resolved Hide resolved
on: () => {},
pipe: () => {}
kill: () => {},
removeAllListeners: () => {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you implementing removeAllListeners instead of letting EventEmitter do it for you?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using EventEmitter produced side effects. and I prefer opting in to features so I know what to expect from a mock. do you disagree?

@NodeGuy
Copy link
Contributor

NodeGuy commented Nov 16, 2018

@NodeGuy the suggestion made the linter cry. Could you reformat and push if you find time?

Which suggestion?

@faboweb
Copy link
Collaborator Author

faboweb commented Nov 17, 2018

Which suggestion?

Nevermind, did it.

@@ -3,7 +3,9 @@
const Client = (axios, localLcdURL, remoteLcdURL) => {
async function request(method, path, data, useRemote) {
const url = useRemote ? remoteLcdURL : localLcdURL
return (await axios({ data, method, url: url + path })).data
const result = await axios({ data, method, url: url + path })
console.log(method, path, data, result.data)
Copy link
Contributor

@fedekunze fedekunze Nov 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete console log

Suggested change
console.log(method, path, data, result.data)

Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ACK. We should have better guides/error msgs to update the version tho. I couldn't find the right version to update, which ended up being 0.26.1-rc1-0-gbb54a0de

@fedekunze fedekunze merged commit c28f638 into develop Nov 17, 2018
@fedekunze fedekunze deleted the fabo/sdk-0.25.0 branch November 17, 2018 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants