-
Notifications
You must be signed in to change notification settings - Fork 37
chore: check trustline using new 'preconidtions' data from backend #1358
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
base: next
Are you sure you want to change the base?
chore: check trustline using new 'preconidtions' data from backend #1358
Conversation
|
|
||
| const hasAlreadyProceededToSign = | ||
| typeof swap.hasAlreadyProceededToSign === 'boolean'; | ||
| const hasAlreadyProceededToSign = !!swap.hasAlreadyProceededToSign; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is important change. if hasAlreadyProceededToSign was false, the old check was changing it to true at the end.
| setTransactionDataByHash(hash, { response }); | ||
| } | ||
| const { schedule, next } = actions; | ||
| updateStorageOnSuccessfulSign(actions, { hash, response }, data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem here was handleSuccessfulSign always schedule CHECK_TRANSACTION_STATUS as next step but in check trustline the next step is EXECUTE_XRPL_TRANASCTION.
e9a6a08 to
df4988c
Compare
| } else { | ||
| schedule(SwapActionTypes.EXECUTE_TRANSACTION); | ||
| } | ||
| schedule(SwapActionTypes.SCHEDULE_NEXT_STEP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
important change. ensure doesn't affect the non-xrpl flow.
df4988c to
bbe622a
Compare
Summary
َUsing
preconditionsfrom server and make checking the trustline a separate step.In the first implementation we were checking a user needs a trustline or not in client. there are some cases for the determining the trustline should be open first are hard, e.g. bridge a token into xrpl and a non-native token. we handed over this to server, now each transaction has a
preconditionsfield which tell us to run the actual transaction what we need to first do. so here we are using this new approach.Another change is make the check of trustline a separate step to break the process into smaller steps and in future we can integrate stellar more easily and also evm approvals.
Fixes RF-2294
Part of #1096
Blocked by rango-exchange/rango-types#57
How did you test this change?
you can test in #1096
do some transactions as followed:
Checklist: