Fix CANCEL_ASSET_ORDER check for already closed, partially/fully matched, order.

Additional unit tests to cover above case.
This commit is contained in:
catbref
2019-06-16 11:41:33 +01:00
parent aa141bb97f
commit 2e6d33659c
4 changed files with 54 additions and 6 deletions

View File

@@ -74,6 +74,9 @@ public class CancelAssetOrderTransaction extends Transaction {
if (orderData == null)
return ValidationResult.ORDER_DOES_NOT_EXIST;
if (orderData.getIsClosed())
return ValidationResult.ORDER_ALREADY_CLOSED;
Account creator = getCreator();
// Check creator's public key results in valid address

View File

@@ -235,6 +235,7 @@ public abstract class Transaction {
MAXIMUM_PROXY_RELATIONSHIPS(84),
TRANSACTION_ALREADY_EXISTS(85),
NO_BLOCKCHAIN_LOCK(86),
ORDER_ALREADY_CLOSED(87),
NOT_YET_RELEASED(1000);
public final int value;