Skip to content

Commit

Permalink
http api /external-payment returns invalid signature error message
Browse files Browse the repository at this point in the history
  • Loading branch information
gagarin55 committed May 11, 2016
1 parent 9778e07 commit 3cb0db5
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/main/scala/scorex/waves/http/WavesApiRoute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,25 @@ case class WavesApiRoute(override val application: Application)(implicit val con
WrongJson.json
case JsSuccess(payment: ExternalPayment, _) =>
val tx = transactionModule.broadcastPayment(payment)
tx.validate match {
case ValidationResult.ValidateOke =>
tx.json
if (!tx.signatureValid)
InvalidSignature.json
else {
tx.validate match {
case ValidationResult.ValidateOke =>
tx.json

case ValidationResult.InvalidAddress =>
InvalidAddress.json
case ValidationResult.InvalidAddress =>
InvalidAddress.json

case ValidationResult.NegativeAmount =>
NegativeAmount.json
case ValidationResult.NegativeAmount =>
NegativeAmount.json

case ValidationResult.NegativeFee =>
NegativeFee.json
case ValidationResult.NegativeFee =>
NegativeFee.json

case ValidationResult.NoBalance =>
NoBalance.json
case ValidationResult.NoBalance =>
NoBalance.json
}
}
}
}.getOrElse(WrongJson.json).toString
Expand Down

0 comments on commit 3cb0db5

Please sign in to comment.