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: update payment_id display #6597

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Conversation

CjS77
Copy link
Collaborator

@CjS77 CjS77 commented Oct 2, 2024

Description

Update PaymentId Display implementation

Motivation and Context

The main current use case for PaymentId::to_string(), besides logging, is passing the payment ID to the notification script.

The current implentation makes it awkward to deal with:

  • spaces in the formatting (bad for command line arguments)
  • The payment id type is not self describing.
  • emojis are awkward to deal with on some terminals and OSs
  • A slash may have to be escaped on some OSs (for empty => N/A)

This update addresses these issues, while still maintaining clear readibility in logs:

  • Change N/A to None and eliminate any edge cases that may creep in when dealing with a slash
  • Other formats are <type>(<data>,...) e.g. u64(1235678) or address_and_data(f3S7XTiyKQauZpDUjdR8NbcQ33MYJigiWiS44ccZCxwAAjk,48656c6c6f20576f726c64)
  • No spaces

How Has This Been Tested?

A single test for displaying each PaymentId type is also included.

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

The main current use case for `PaymentId::to_string()`, besides logging, is
passing the payment ID to the notification script.

The current implentation makes it awkward to deal with:
* spaces in the formatting (bad for command line arguments)
* The payment id type is not self describing.
* emojis are awkward to deal with on some terminals and OSs
* A slash may have to be escaped on some OSs (for empty => N/A)

This update addresses these issues, while still maintaining clear
readibility in logs:

* Change `N/A` to None and eliminate any edge cases that may creep in
  when dealing with a slash
* Other formats are `<type>(<data>,...)`
  e.g. `u64(1235678)` or
  `address_and_data(f3S7XTiyKQauZpDUjdR8NbcQ33MYJigiWiS44ccZCxwAAjk,48656c6c6f20576f726c64)`
* No spaces

A single test for displaying each `PaymentId` type is also included.
@CjS77 CjS77 requested a review from a team as a code owner October 2, 2024 14:25
Copy link

github-actions bot commented Oct 2, 2024

Test Results (CI)

    3 files    129 suites   36m 17s ⏱️
1 325 tests 1 325 ✅ 0 💤 0 ❌
3 973 runs  3 973 ✅ 0 💤 0 ❌

Results for commit f5a5de6.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Oct 2, 2024
Copy link

github-actions bot commented Oct 2, 2024

Test Results (Integration tests)

 2 files  11 suites   15m 40s ⏱️
36 tests 35 ✅ 0 💤 1 ❌
37 runs  36 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit f5a5de6.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Oct 2, 2024
@SWvheerden SWvheerden merged commit 54eb6d7 into development Oct 3, 2024
16 of 17 checks passed
@SWvheerden SWvheerden deleted the update-payment-id-display branch October 4, 2024 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants