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

Add command "withdraw" #21

Merged
merged 7 commits into from
Jan 21, 2018
Merged

Conversation

Petrucheqa
Copy link
Collaborator

@Petrucheqa Petrucheqa commented Jan 13, 2018

Implementation of withdraw command, see #6

@mbaumanndev
Copy link
Member

@Petrucheqa Please reference the "Add withdraw command" issue in your PR message :)
I'll start to review your PR in a few minutes ;)

@Petrucheqa Petrucheqa changed the title Add command to withdraw dogecoins to an external address Add command "withdraw" Jan 13, 2018
@@ -25,6 +25,7 @@
"request": "^2.81.0"
},
"devDependencies": {
"nodemon": "^1.12.1"
"nodemon": "^1.12.1",
"standard": "*"
Copy link
Member

Choose a reason for hiding this comment

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

What is the utility of the "standard" dependency ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's a linter and code fixer, it works without configuration.

https://github.com/standard/standard

const NO_COMMA_TEXT = 'Please avoid "," in your amount and use "."'
const NEED_ADDRESS_TEXT = 'Need an address as a third argument'
const NO_FUNDS = 'You dont have doge to transfer.'
const NOT_ENOUGH_FUNDS = 'Not enough funds for this transfer. Please add some dogecoins.'
Copy link
Member

Choose a reason for hiding this comment

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

I think we could move theses const to the message file, since some of them are already used somewhere else in the app

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Start new issue ?

if (amount.indexOf(',') >= 0) {
message.reply(NO_COMMA_TEXT)
return
}
Copy link
Contributor

@rllola rllola Jan 13, 2018

Choose a reason for hiding this comment

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

This code that verify that we have a proper amount should be in a verifyAmount function and also be used in tip. This function would be tested to be sure we have the proper amount format.

if (!toAddress) {
message.reply(NEED_ADDRESS_TEXT)
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we verify that it would be a proper Dogecoin address ? Or is the sendFrom command would reject this if not a proper dogecoin address ?

@rllola
Copy link
Contributor

rllola commented Jan 13, 2018

This need to be rebased with the development branch and we can merge it.

@rllola rllola merged commit 4ea855b into BitcoinAmiens:development Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants