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: use encoded address in ccm deposit metadata in events #5192

Merged
merged 5 commits into from
Aug 23, 2024

Conversation

j4m1ef0rd
Copy link
Contributor

@j4m1ef0rd j4m1ef0rd commented Aug 23, 2024

Pull Request

Closes: PRO-1597

Checklist

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

  • I am confident that the code works.
  • I have written sufficient tests.
  • I have written and tested required migrations.
  • I have updated documentation where appropriate.

Summary

Made CcmDepositMetadata generic so we can encode the address inside of it when outputting it in the swap requested event and the ccm failed event.

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 70%. Comparing base (428583b) to head (0e5aa9d).
Report is 1 commits behind head on main.

Files Patch % Lines
state-chain/pallets/cf-swapping/src/lib.rs 77% 3 Missing ⚠️
state-chain/traits/src/swapping.rs 0% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #5192    +/-   ##
======================================
- Coverage     70%     70%    -0%     
======================================
  Files        481     481            
  Lines      86087   85969   -118     
  Branches   86087   85969   -118     
======================================
- Hits       60399   60224   -175     
- Misses     22419   22475    +56     
- Partials    3269    3270     +1     

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

@@ -1966,7 +1966,14 @@ pub mod pallet {
output_address: T::AddressConverter::to_encoded_address(
output_address.clone(),
),
ccm_deposit_metadata: ccm_deposit_metadata.clone(),
ccm_deposit_metadata: cf_chains::CcmDepositMetadataEncoded {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think CcmDepositMetadata is also exposed via the CcmFailed event, so that one should be updated to use the encoded version.

@@ -688,6 +688,14 @@ mod ccm {
#[track_caller]
fn init_ccm_swap_request(input_asset: Asset, output_asset: Asset, input_amount: AssetAmount) {
let ccm_deposit_metadata = generate_ccm_deposit();
let ccm_deposit_metadata_encoded = cf_chains::CcmDepositMetadataEncoded {
Copy link
Contributor

@msgmaxim msgmaxim Aug 23, 2024

Choose a reason for hiding this comment

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

We could have a method on CcmDepositMetadata to convert it into the encoded verson (taking AddressConverter as a generic parameter?). Or you can look at how it is done for ChannelRefundParametersGeneric.

@j4m1ef0rd j4m1ef0rd changed the title feat: use encoded address in ccm deposit metadata in event feat: use encoded address in ccm deposit metadata in events Aug 23, 2024
@dandanlen dandanlen added this pull request to the merge queue Aug 23, 2024
Merged via the queue into main with commit 18debf4 Aug 23, 2024
48 checks passed
@dandanlen dandanlen deleted the feat/ccm-deposit-metadata-encoded branch August 23, 2024 11:13
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.

3 participants