Skip to content

Commit

Permalink
Merge #1245: unused and missing vars in jmbitcoin tx code
Browse files Browse the repository at this point in the history
8eefb4d unused and missing vars in jmbitcoin tx code (Adam Gibson)

Pull request description:

  Just noticed these while reading the code for some reason or other.

  The `btc.OP_RETURN` was presumably not fixed before because that code (burn addresses) is now entirely unused.

  However, this should be in the tests somewhere. We are missing tests for a lot of the functions in `secp256k1_transaction`. A PR should be opened by someone at some point to add those.

ACKs for top commit:
  kristapsk:
    ACK 8eefb4d

Tree-SHA512: 6cd7f959c1f798f14536a17c672a7ededbb4f962183aed17cba46a81955d91f5499bbd550a2de7bf337ed81660d55d00ea2f8b8cb0936c905f49a14ad405a6b9
  • Loading branch information
kristapsk committed Apr 17, 2022
2 parents ece4946 + 8eefb4d commit 0d20aa9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions jmbitcoin/jmbitcoin/secp256k1_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ def mk_freeze_script(pub, locktime):
raise TypeError("locktime must be int")
if not isinstance(pub, bytes):
raise TypeError("pubkey must be in bytes")
usehex = False
if not is_valid_pubkey(pub, require_compressed=True):
raise ValueError("not a valid public key")
return CScript([locktime, OP_CHECKLOCKTIMEVERIFY, OP_DROP, pub,
Expand All @@ -227,7 +226,7 @@ def mk_burn_script(data):
"""
if not isinstance(data, bytes):
raise TypeError("data must be in bytes")
return CScript([btc.OP_RETURN, data])
return CScript([OP_RETURN, data])

def sign(tx, i, priv, hashcode=SIGHASH_ALL, amount=None, native=False):
"""
Expand Down
1 change: 0 additions & 1 deletion jmbitcoin/test/test_tx_signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def test_sign_standard_txs(addrtype):
amount_less_fee = int(amount - btc.coins_to_satoshi(0.01))

# Create a destination to send the coins.
destination_address = address
target_scriptPubKey = scriptPubKey

# Create the unsigned transaction.
Expand Down

0 comments on commit 0d20aa9

Please sign in to comment.