Add EventTypeTransferOpFailed for token transfer operations that fail #279
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #218.
This basically works, but I'd like to vet the behavior since there are some slight inconsistencies.
When you submit a transfer request, you'll (now) ultimately receive one of two events in response:
EventTypeTransferConfirmedif transfer is confirmed -> references the transfer'sLocalIDso you can look up the transferEventTypeTransferOpFailedif transfer fails -> references the operation'sIDso you can look up the failed operation (there is no transfer object created in this case)Even though this means the events are a bit asymmetric, I can't come up with a more sensible way to do it.
However, when submitting a transfer with
confirm=true, the sync-async bridge tracks a single ID which will ultimately resolve in success or failure. I've chosen the transfer'sLocalID, but that means there's an additional step in the case ofEventTypeTransferOpFailed, for sync-async to map the operationIDto the transferLocalID. This also meant extracting some helpers totxcommon(for lack of a better place to put them).