LN-Zap / zap-iOS

Zap Wallet - Native iOS lightning wallet focused on user experience and ease of use ⚡️
http://zaphq.io
MIT License
181 stars 47 forks source link

fix: Pasting Address with Newline Characters and Spaces Work #300

Closed chitowncrispy closed 4 years ago

chitowncrispy commented 4 years ago

Description

I created a new method on the extension of String to filter out all the newline characters and spaces. I then utilized this method in the 2 places we reference the string placed on the UIPasteboard in order to clear out all the newline characters and spaces.

Motivation and Context

This is to address issue #225 .

How Has This Been Tested?

I pasted an example of a testnet bitcoin address and a testnet lightning node address into Atom and then added newlines and spaces at the beginning, middle and end of the address. I then copied those newly created addresses I created and clicked the Paste Address button in the app. When doing this the address was recognized without the newline characters and spaces.

Screenshots (if appropriate):

Types of changes

Checklist:

codecov-io commented 4 years ago

Codecov Report

Merging #300 into master will decrease coverage by 0.13%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #300      +/-   ##
==========================================
- Coverage   11.18%   11.04%   -0.14%     
==========================================
  Files         230      230              
  Lines        9077     9077              
==========================================
- Hits         1015     1003      -12     
- Misses       8062     8074      +12
Impacted Files Coverage Δ
...es/QRCodeScanner/QRCodeScannerViewController.swift 0% <0%> (ø) :arrow_up:
...htning/Certificates/PinnedURLSessionDelegate.swift 75.86% <0%> (-20.69%) :arrow_down:

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 3dcf085...c777b0f. Read the comment docs.

chitowncrispy commented 4 years ago

@ottosuess this one should be ready to go. Let me know if you have any other concerns.

ottosuess commented 4 years ago

🔥 sweet