-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalise BCH CashAddr formt to legacy when inserting to tagstore
- Loading branch information
1 parent
de665bf
commit 9dd9e16
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ GitPython~=3.1 | |
giturlparse~=0.10 | ||
coinaddrvalidator~=1.1.3 | ||
colorama~=0.4.6 | ||
cashaddress~=1.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from tagpack.tagstore import _perform_address_modifications | ||
|
||
|
||
def test_bch_conversion(): | ||
cashaddr = 'bitcoincash:prseh0a4aejjcewhc665wjqhppgwrz2lw5txgn666a' | ||
|
||
# as per https://bch.btc.com/tools/address-converter | ||
expected = '3NFvYKuZrxTDJxgqqJSfouNHjT1dAG1Fta' | ||
result = _perform_address_modifications(cashaddr, 'BCH') | ||
|
||
assert expected == result | ||
|
||
|
||
def test_eth_conversion(): | ||
checksumaddr = '0xC61b9BB3A7a0767E3179713f3A5c7a9aeDCE193C' | ||
|
||
expected = '0xc61b9bb3a7a0767e3179713f3a5c7a9aedce193c' | ||
result = _perform_address_modifications(checksumaddr, 'ETH') | ||
|
||
assert expected == result | ||
|
||
|