Skip to content

Conversation

@ecioppettini
Copy link
Contributor

Return a 503 http status (Service unavailable) and a message when the faucet account has no funds to make the required transaction.

Note that as the faucet can only support one transaction at a time (because it queries the node for spending counter and balance), it will return a success message until the transaction that spends the funds is accepted by the node.

closes #87

@ecioppettini ecioppettini added bug Something isn't working enhancement New feature or request labels Nov 11, 2019
@ecioppettini ecioppettini self-assigned this Nov 11, 2019
Copy link
Contributor

@jpcapurro-atixlabs jpcapurro-atixlabs left a comment

Choose a reason for hiding this comment

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

Looks good to me.

tests performed (LOVELACES_TO_GIVE==300 ):

send-money: happy path

  • [ x ] faucet funds > 310
  • [ x ] no pending txs
  • [ x ] curl -X POST localhost:3000/send-money/receiver-address
  • [ x ] receiver-address balanceincreases by 300

send-money: not enough funds for money given

  • [ x ] faucet funds == 0
  • [ x ] no pending txs
  • [ x ] curl -X POST localhost:3000/send-money/receiver-address
  • [ x ] faucet returns 503

send-money: not enough funds for fee + money given (but enough funds for money
given)

  • [ x ] faucet funds == 300
  • [ x ] no pending txs
  • [ x ] curl -X POST localhost:3000/send-money/receiver-address
  • [ x ] faucet returns 503

@jpcapurro-atixlabs jpcapurro-atixlabs merged commit 51e0aef into master Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Faucet example code: returns always success even when there is not enough funds in the wallet

3 participants