-
Notifications
You must be signed in to change notification settings - Fork 18
Implement swap intent for pumpx #3354
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
Implement swap intent for pumpx #3354
Conversation
SubmitSwapOrderParams structures
…pumpx Signed-off-by: Francisco Silva <franjs.francisco@gmail.com>
Add intent_id field to SubmitSwapOrderParams and pass it through the intent execution flow to replace the hardcoded 0 value in the intent_completed call and RequestIntent task creation.
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 logic looks good - I have a few comments.
The address
is the main missing part
tee-worker/omni-executor/intent/executors/cross-chain/src/lib.rs
Outdated
Show resolved
Hide resolved
execution_result, | ||
); | ||
ctx.transaction_signer.sign(intent_executed_call).await | ||
let tx = ctx.transaction_signer.sign(intent_executed_call).await; | ||
if rpc_client.submit_tx(&tx).await.is_err() { |
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.
It doesn't wait for any finalisation, does it? (We don't want to wait for it)
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.
No it does not wait, when we want to wait we use submit_and_watch_tx_until
@@ -60,16 +77,19 @@ pub type ParentchainTxSigner = TxSigner< | |||
SubxtMetadataProvider<CustomConfig>, | |||
>; | |||
|
|||
// TODO: should we rename this to something like MultiChainIntentExecutor? |
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.
Good idea - but probably in separate PR
tee-worker/omni-executor/intent/executors/cross-chain/src/lib.rs
Outdated
Show resolved
Hide resolved
…-chain-swap-intent-for-pumpx
@@ -29,7 +29,7 @@ pub trait IntentExecutor: Send { | |||
account_id: &AccountId, | |||
intent_id: IntentId, | |||
intent: Intent, | |||
) -> Result<(), ()>; | |||
) -> Result<Option<Vec<u8>>, ()>; |
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.
Can this be generic ?
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.
Do you mean like a trait object?
This PR introduces a draft implementation of the swap intent processing for pumpx so we can start testing.
Important notes: