fix: address/hash160 round-trip for w_get_addr_from_pubkey_hash (#1)#2
Open
xre217 wants to merge 1 commit into
Open
fix: address/hash160 round-trip for w_get_addr_from_pubkey_hash (#1)#2xre217 wants to merge 1 commit into
xre217 wants to merge 1 commit into
Conversation
…georg#1) w_dogecoin_address_to_pubkey_hash returns bare hash160 while getAddrFromPubkeyHash expects a P2PKH scriptPubKey. Accept both in w_get_addr_from_pubkey_hash by wrapping 40-char hash160 as 76a914…88ac. Docs clarify the two formats. Adds regression test for the natural addr -> hash160 -> addr path.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Area
python-libdogecoin (Dogecoin Python bindings) — not GigaWallet, not X.
Problem (#1)
addr -> w_dogecoin_address_to_pubkey_hash -> w_get_addr_from_pubkey_hashreturned the wrong address because:
getAddrFromPubkeyHashexpects scriptPubKey (50 hex76a914…88ac)Fix
w_get_addr_from_pubkey_hashnormalizes 40-char hash160 to scriptPubKey form.Still accepts full scriptPubKey. Docs + regression test updated.
DOGE
Tips/contract in Dogecoin:
DTRJECKXfxgnSzGbt7TYRikLPDocqvdmo5· trefongwork@gmail.com