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

standard tx status responses #2289

Merged
merged 6 commits into from
Oct 8, 2020
Merged

Conversation

bogdan-rosianu
Copy link
Contributor

@bogdan-rosianu bogdan-rosianu commented Sep 15, 2020

Changed transactions' statuses for indexer and API transaction status fetcher. Now they use the same messages from the same place.

Changes:
Elastic Search responses:

Before After
Invalid invalid
Pending pending
Not Executed unsuccessful
Success successful

API transaction status responses:

Before After
invalid invalid
received pending
partially-executed pending
not-executed unsuccessful
executed successful

Meanings:
Invalid/invalid: the transaction is invalid and won't be processed. will be changed to invalid
partially-executed: executed only in sender shard. in order to abstract sharding terminology, it will be changed to pending
received: in the pool on sender shard, but not executed yet. will be changed to pending
Not Executed/not-executed: processing of the transaction failed. will be changed to unsuccessful
Success/executed: fully-executed transaction. will be changed to successful for consistency

// TxStatusPending = received and maybe executed on source shard, but not on destination shard
TxStatusPending TxStatus = "pending"
// TxStatusSuccessful = received and executed
TxStatusSuccessful TxStatus = "successful"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Breaking change for the exchanges consuming the API. But we will deal with in on the Proxy side somwhow 🥳

Perhaps we can introduce a v2 prefix in the URL on the Proxy (and re-map to old names in v1 URLs).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a jira ticket with ID EN-7718

failReason := ""
retCode, err := ts.txProcessor.ProcessTransaction(tx)
if err != nil {
failReason = err.Error()
txStatus = transaction.TxStatusNotExecuted
txStatus = transaction.TxStatusUnsuccessful
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, here it is really non-executed. But Unsuccessful should be all right for most purposes, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it can remain like this. this type of status would have been returned also on the normal transaction sending

@andreibancioiu andreibancioiu added the type:feature New feature or request label Sep 22, 2020
Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

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

System tests passed.

@LucianMincu LucianMincu merged commit daa6a88 into development Oct 8, 2020
@LucianMincu LucianMincu deleted the standard-tx-status-responses branch October 8, 2020 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants