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

Sending transaction to not-valid address (yet being base58 encoded string) gives HTTP 500 -> "Something went wrong" #333

Closed
piotr-iohk opened this issue May 28, 2019 · 1 comment
Assignees

Comments

@piotr-iohk
Copy link
Contributor

piotr-iohk commented May 28, 2019

Release Operating System Cause
next Linux Code

Context

When trying to send transaction to in-valid address there should be a meaningful error message provided. Currently when trying to send transaction to address that is NOT base58 encoded string there is a HTTP 400 response and an error message:

{
"code":"bad_request",
"message":"Error in $.payments[0].address: Unable to decode Address: expected Base58 encoding"
}

(yet this message should be also edited to comply with anthropomorphic style of messaging cf #298, #299)

However, in case when provided address IS base58 string (yet not valid address) the response from the server is just HTTP 500 and a message:

Something went wrong

Steps to Reproduce

  1. Create a wallet
  2. Try to perform transaction:
curl  -vX POST http://localhost:8090/v2/wallets/{wallet-id}/transactions \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{
"payments": [
{
	"address": "1",
	"amount": {
				"quantity": 10,
				"unit": "lovelace"
			}
} ], 
 "passphrase": "Secure Passphrase"
}' | jq

Expected behavior

HTTP 400
error message:

{
"code":"bad_request",
"message":"Error in $.payments[0].address: I'm sorry, what you provided here is not a valid address"
}

Actual behavior

HTTP 500
Something went wrong


Resolution Plan

N/A

PR

Number Base
#313 master

QA

Actually fixed as a side-effect of #313 which also even adds a proper negative test to capture this behavior: see Cardano.Wallet.HttpBridge.CompatibilitySpec

@piotr-iohk piotr-iohk added the BUG label May 28, 2019
@KtorZ KtorZ self-assigned this May 28, 2019
@piotr-iohk
Copy link
Contributor Author

👍

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

No branches or pull requests

2 participants