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

PAN-3175: Private tx nonce errors return same msg as any tx #48

Merged
merged 2 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ public static GraphQLError of(final TransactionInvalidReason transactionInvalidR
case UPFRONT_COST_EXCEEDS_BALANCE:
return TRANSACTION_UPFRONT_COST_EXCEEDS_BALANCE;
case NONCE_TOO_LOW:
case PRIVATE_NONCE_TOO_LOW:
return NONCE_TOO_LOW;
case INCORRECT_NONCE:
case INCORRECT_PRIVATE_NONCE:
return INCORRECT_NONCE;
case INTRINSIC_GAS_EXCEEDS_GAS_LIMIT:
return INTRINSIC_GAS_EXCEEDS_LIMIT;
Expand All @@ -87,10 +89,6 @@ public static GraphQLError of(final TransactionInvalidReason transactionInvalidR
// Private Transaction Invalid Reasons
case PRIVATE_TRANSACTION_FAILED:
return PRIVATE_TRANSACTION_FAILED;
case PRIVATE_NONCE_TOO_LOW:
return PRIVATE_NONCE_TOO_LOW;
case INCORRECT_PRIVATE_NONCE:
return INCORRECT_PRIVATE_NONCE;
case GAS_PRICE_TOO_LOW:
return GAS_PRICE_TOO_LOW;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ public static JsonRpcError convertTransactionInvalidReason(
final TransactionInvalidReason reason) {
switch (reason) {
case NONCE_TOO_LOW:
case PRIVATE_NONCE_TOO_LOW:
return JsonRpcError.NONCE_TOO_LOW;
case INCORRECT_NONCE:
case INCORRECT_PRIVATE_NONCE:
return JsonRpcError.INCORRECT_NONCE;
case INVALID_SIGNATURE:
return JsonRpcError.INVALID_TRANSACTION_SIGNATURE;
Expand All @@ -39,10 +41,6 @@ public static JsonRpcError convertTransactionInvalidReason(
// Private Transaction Invalid Reasons
case CHAIN_HEAD_WORLD_STATE_NOT_AVAILABLE:
return JsonRpcError.CHAIN_HEAD_WORLD_STATE_NOT_AVAILABLE;
case PRIVATE_NONCE_TOO_LOW:
return JsonRpcError.PRIVATE_NONCE_TOO_LOW;
case INCORRECT_PRIVATE_NONCE:
return JsonRpcError.INCORRECT_PRIVATE_NONCE;
case GAS_PRICE_TOO_LOW:
return JsonRpcError.GAS_PRICE_TOO_LOW;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ public enum JsonRpcError {

// Private transaction errors
ENCLAVE_ERROR(-50100, "Error communicating with enclave"),
PRIVATE_NONCE_TOO_LOW(-50100, "Private transaction nonce too low"),
INCORRECT_PRIVATE_NONCE(-50100, "Private transaction nonce is incorrect"),
UNIMPLEMENTED_PRIVATE_TRANSACTION_TYPE(-50100, "Unimplemented private transaction type"),
PRIVACY_NOT_ENABLED(-50100, "Privacy is not enabled to get the precompiled address"),
CREATE_PRIVACY_GROUP_ERROR(-50100, "Error creating privacy group"),
Expand Down