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: charge a fee for opening swap deposit addresses #4512

Merged
merged 9 commits into from
Feb 15, 2024

Conversation

dandanlen
Copy link
Collaborator

Pull Request

Closes: PRO-1134

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have updated documentation where appropriate.

Summary

Charges a fee for opening swap channels.

Currently the fee is zero, can be set using the new governance extrinsic update_pallet_config.

Bonus feature: it's now possible to do multiple updates at once (eg. update all the swap limits at once).

state-chain/pallets/cf-swapping/src/lib.rs Outdated Show resolved Hide resolved
state-chain/pallets/cf-swapping/src/tests.rs Outdated Show resolved Hide resolved
state-chain/pallets/cf-swapping/src/lib.rs Outdated Show resolved Hide resolved
@dandanlen
Copy link
Collaborator Author

Kyle mentioned that it might make sense to apply the fee to all channels (swap and lp), and i agree. So i moved it into the ingress/egress pallet.

I also moved the fee to the rpcs instead of returning it in the apis.

@dandanlen dandanlen force-pushed the feat/swap-deposit-address-fee branch from 0ea8b3d to 747c608 Compare February 14, 2024 21:48
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

Attention: 29 lines in your changes are missing coverage. Please review.

Comparison is base (76ce86a) 73% compared to head (e2bd018) 73%.

❗ Current head e2bd018 differs from pull request most recent head 68704e6. Consider uploading reports for the commit 68704e6 to get more accurate results

Files Patch % Lines
state-chain/pallets/cf-ingress-egress/src/lib.rs 64% 14 Missing and 1 partial ⚠️
state-chain/runtime/src/lib.rs 25% 0 Missing and 6 partials ⚠️
state-chain/custom-rpc/src/lib.rs 50% 5 Missing ⚠️
state-chain/pallets/cf-swapping/src/lib.rs 70% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #4512    +/-   ##
======================================
  Coverage     73%     73%            
======================================
  Files        401     401            
  Lines      68051   68283   +232     
  Branches   68051   68283   +232     
======================================
+ Hits       49451   49640   +189     
- Misses     15973   15978     +5     
- Partials    2627    2665    +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kylezs
Copy link
Contributor

kylezs commented Feb 15, 2024

@acdibble some environment RPC snapshots changing here

@dandanlen
Copy link
Collaborator Author

dandanlen commented Feb 15, 2024

Sorry @acdibble I thought you would be auto-tagged for the review. The change is an additional item channel_opening_fees in the ingress egress environment return value.

It will be set to zero initially but that might change ofc.

@dandanlen dandanlen requested a review from acdibble February 15, 2024 11:02
@dandanlen dandanlen force-pushed the feat/swap-deposit-address-fee branch from e2bd018 to 68704e6 Compare February 15, 2024 12:15
@dandanlen dandanlen merged commit 4999313 into main Feb 15, 2024
42 checks passed
@dandanlen dandanlen deleted the feat/swap-deposit-address-fee branch February 15, 2024 12:50
syan095 added a commit that referenced this pull request Feb 16, 2024
…igned-error

* origin/main:
  chore: fetch solana state from docker (#4538)
  feat: charge a fee for opening swap deposit addresses (#4512)
  refactor: Remove RpcAsset (PRO-1187) (#4491)
  fix: re-add version update (#4533)
  fix: pull first (#4526)
  feat: auto pick non-breaking changes (#4498)

# Conflicts:
#	state-chain/pallets/cf-ingress-egress/src/lib.rs
#	state-chain/pallets/cf-ingress-egress/src/tests.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants