Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Add support for payment-v2 memo field #768

Merged
merged 4 commits into from
Apr 21, 2021
Merged

Add support for payment-v2 memo field #768

merged 4 commits into from
Apr 21, 2021

Conversation

vihu
Copy link
Member

@vihu vihu commented Apr 7, 2021

Enables support for specifying a uint64 memo for a payment-v2.

Notes:

  • Introduces allow_payment_v2_memos boolean chain variable
  • If the var is not set, existing payment-v2s will have memo=0 as default
  • If the var is set, as long as the memo lies between 0 - 2^64 it will be considered valid
  • Add some test cases to verify said logic
  • Update and refactor payment-v2 txn validation

TODO:

  • Switch proto to master once proto#72 lands.

@codecov
Copy link

codecov bot commented Apr 8, 2021

Codecov Report

Merging #768 (a3b7118) into master (ea3a112) will decrease coverage by 0.05%.
The diff coverage is 91.30%.

❗ Current head a3b7118 differs from pull request most recent head aa3a0a6. Consider uploading reports for the commit aa3a0a6 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #768      +/-   ##
==========================================
- Coverage   71.53%   71.48%   -0.06%     
==========================================
  Files          97       97              
  Lines       14009    14042      +33     
==========================================
+ Hits        10022    10038      +16     
- Misses       3987     4004      +17     
Impacted Files Coverage Δ
src/transactions/v1/blockchain_txn_vars_v1.erl 62.85% <50.00%> (-0.11%) ⬇️
src/transactions/v2/blockchain_payment_v2.erl 91.30% <87.50%> (-2.45%) ⬇️
src/transactions/v2/blockchain_txn_payment_v2.erl 95.77% <96.96%> (+0.77%) ⬆️
src/ledger/v1/blockchain_ledger_snapshot_v1.erl 47.42% <100.00%> (ø)
src/blockchain_gateway_cache.erl 55.81% <0.00%> (-9.31%) ⬇️
src/handlers/blockchain_sync_handler.erl 92.85% <0.00%> (-1.79%) ⬇️
src/ledger/v1/blockchain_ledger_v1.erl 80.21% <0.00%> (-0.10%) ⬇️
src/transactions/blockchain_txn.erl 82.35% <0.00%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f85dc49...aa3a0a6. Read the comment docs.

- Update to_json for payment-v2
- Update error msg for old behavior
- Dont allow memo greater than a 64 bit integer
- Add test cases for big memo validation
@Vagabond
Copy link
Contributor

Did we want to land this?

@vihu
Copy link
Member Author

vihu commented Apr 21, 2021

Did we want to land this?

I think this is good to land despite differing slightly from HIP26, but the author seems okay with this implementation as well.

@evanmcc evanmcc merged commit 7943a9b into master Apr 21, 2021
@evanmcc evanmcc deleted the rg/payment-v2-memos branch April 21, 2021 22:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants