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 to cover all transaction types #6744

Merged

Conversation

hansieodendaal
Copy link
Contributor

@hansieodendaal hansieodendaal commented Jan 16, 2025

Description

  • Updated PaymentId::Open, PaymentId::AddressAndData and PaymentId::TransactionInfo to reflect the transaction type for all defined types in pub enum TxType.
  • Fixed transaction identification for all defined types in pub enum TxType.
  • Added method transaction_type_from_encrypted_data to the wallet FFI and a unit test to test all cases.
  • Added wallet FFI test cases to ensure coin-join and coin-split transactions are correctly flagged in the payment ID.

TODO: System-level testing mobile wallet recovery into a view-only console wallet.

Close issues #6713 and #6745

Motivation and Context

The payment ID did not cover all transaction types or provide sufficient information for wallet recovery.

How Has This Been Tested?

  • System-level testing (console wallet recovered as a view-only wallet)
  • Added unit tests for the wallet FFI

What process can a PR reviewer use to test or verify this change?

Code review
System-level tests

Breaking Changes

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

BREAKING CHANGE:

  • Added a new wallet FFI method: fn transaction_type_from_encrypted_data
  • Embedded PaymentId enum in EncryptedData changed:
    • PaymentId::Open changed
    • PaymentId::Address fell away
    • PaymentId::AddressAndData changed
    • PaymentId::TransactionInfo changed
  • No changes to pre-mine payment IDs in the genesis block that makes use of PaymentId::U64

- Updated `PaymentId::Open, AddressAndData, TransactionInfo` to reflect the
  transaction type for all defined types in `pub enum TxType`.
- Fixed transaction identification for all defined types in `pub enum TxType`.
- Added method `transaction_type_from_encrypted_data` to the wallet FFI and a
  unit test to test all cases.
- Added wallet FFI test cases to ensure coin-join and coin-split transactions
  are correctly flagged in the payment ID.
@hansieodendaal hansieodendaal requested a review from a team as a code owner January 16, 2025 15:47
@hansieodendaal hansieodendaal changed the title feat! update payment id to cover all transactin types feat! update payment id to cover all transaction types Jan 16, 2025
@hansieodendaal hansieodendaal changed the title feat! update payment id to cover all transaction types feat!: update payment id to cover all transaction types Jan 16, 2025
Copy link

github-actions bot commented Jan 16, 2025

Test Results (CI)

    3 files    129 suites   36m 58s ⏱️
1 350 tests 1 350 ✅ 0 💤 0 ❌
4 048 runs  4 048 ✅ 0 💤 0 ❌

Results for commit ae4463c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 16, 2025

Test Results (Integration tests)

36 tests   36 ✅  19m 41s ⏱️
11 suites   0 💤
 2 files     0 ❌

Results for commit ae4463c.

♻️ This comment has been updated with latest results.

@SWvheerden SWvheerden merged commit 5f4f95b into tari-project:development Jan 17, 2025
17 checks passed
@hansieodendaal hansieodendaal deleted the ho_update_payment_id branch January 17, 2025 10:09
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