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

feat(solana-swap): solana swap protocol v1 POC #2091

Merged
merged 24 commits into from
Jun 24, 2024
Merged

feat(solana-swap): solana swap protocol v1 POC #2091

merged 24 commits into from
Jun 24, 2024

Conversation

r2st
Copy link

@r2st r2st commented Mar 27, 2024

Implementation of the following SwapOps trait methods for SolanaCoin in the defi framework:

  • send_maker_payment
  • send_taker_spends_maker_payment
  • send_maker_refunds_payment

Test cases for:

  • send and spend
  • send and refund

@r2st r2st changed the title feat(solana-swap):solana swap protocol v1 POC feat(solana-swap):solana swap protocol v1 POC - progress Mar 27, 2024
@r2st r2st changed the title feat(solana-swap):solana swap protocol v1 POC - progress feat(solana-swap):solana swap protocol v1 POC - in progress Mar 27, 2024
@shamardy shamardy changed the title feat(solana-swap):solana swap protocol v1 POC - in progress feat(solana-swap):solana swap protocol v1 POC Mar 27, 2024
@shamardy shamardy added the in progress Changes will be made from the author label Mar 27, 2024
@shamardy shamardy changed the title feat(solana-swap):solana swap protocol v1 POC feat(solana-swap): solana swap protocol v1 POC Mar 27, 2024
@shamardy shamardy added under review and removed in progress Changes will be made from the author labels Mar 29, 2024
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! This is the first review iteration concerned with cleaning up the code a bit so I can easily review it.

mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
@shamardy
Copy link
Collaborator

shamardy commented Jun 6, 2024

@mj-blockydevs first step is to merge with latest dev to resolve conflicts

Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
@mj-blockydevs
Copy link

Recent updates:

  • Merged the dev branch into the solana-swaps-poc branch.
  • Resolved all conflicts.
  • Made it possible to run and build the app without the --feature enable-solana flag.
  • Implemented Clippy suggestions.
  • Updated tests to work correctly with new function implementations.

Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Thank you for the fixes! Next review iteration!

mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana/solana_tests.rs Outdated Show resolved Hide resolved
mm2src/coins/solana/solana_tests.rs Outdated Show resolved Hide resolved
mm2src/coins/solana/solana_tests.rs Outdated Show resolved Hide resolved
mm2src/coins/solana/solana_tests.rs Outdated Show resolved Hide resolved
mm2src/coins/solana/solana_tests.rs Outdated Show resolved Hide resolved
Copy link
Member

@laruh laruh left a comment

Choose a reason for hiding this comment

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

I have some small notes for now

mm2src/coins/solana.rs Outdated Show resolved Hide resolved
mm2src/coins/solana.rs Outdated Show resolved Hide resolved
…ion async instead of fut, better error handling, log used in tests instead of print, redundant test removed

Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
@mj-blockydevs
Copy link

@shamardy @laruh

Here are the recent adjustments based on your PR reviews:

  • Grouped and sorted use statements in solana.rs and solana_tests.rs.
  • Renamed functions: get_transaction_details and sign_and_send_transaction to reflect their swap association. Also, made the public function sign_and_send_transaction async.
  • Improved error handling to address possible panics.
  • Replaced print statements in tests with log.
  • Removed a redundant test added in my previous set of changes.

Feel free to let me know if there is anything else we should adjust before merging this stage of the work. To use a different source of constants, I need them to be accepted in this PR.

Copy link
Member

@borngraced borngraced left a comment

Choose a reason for hiding this comment

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

Great work!. only one comment after taking a quick look.

mm2src/coins/solana.rs Outdated Show resolved Hide resolved
Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Last comment from my side! Once all previous unresolved comments are fixed alongside the below one I approve this PR.

mm2src/coins/solana.rs Outdated Show resolved Hide resolved
Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
laruh
laruh previously approved these changes Jun 21, 2024
Copy link
Member

@laruh laruh left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes, LGTM!

…recently deployed one

Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas+instead@blockydevs.com>
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

🔥

@shamardy shamardy merged commit 2e0b3ca into dev Jun 24, 2024
18 of 25 checks passed
@shamardy shamardy deleted the solana-swaps-poc branch June 24, 2024 13:21
dimxy added a commit that referenced this pull request Jul 3, 2024
* dev:
  fix(restrictions): remove wallet-only restriction from max_maker_vol (#2153)
  feat(tendermint): support unsigned txs for ledger's keplr extension (#2148)
  chore(toolchain): upgrade to 1.72 nightly (#2149)
  feat(solana-swap): solana swap protocol v1 POC (#2091)
  fix(docs): update cargo test command (#2144)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants