Skip to content

Commit

Permalink
Cleaning up PR and removing unneeded changes, #3
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBriar committed Jul 4, 2023
1 parent c77163a commit 593b907
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions test/functional/rpc_rawtransaction.py
Expand Up @@ -6,11 +6,12 @@
Test the following RPCs:
- getrawtransaction
- compressrawtransaction
- createrawtransaction
- signrawtransactionwithwallet
- sendrawtransaction
- decoderawtransaction
- compressrawtransaction
- decompressrawtransaction
"""

from collections import OrderedDict
Expand Down Expand Up @@ -87,11 +88,12 @@ def run_test(self):

self.getrawtransaction_tests()
self.getrawtransaction_verbosity_tests()
self.compressrawtransaction_tests()
self.createrawtransaction_tests()
self.sendrawtransaction_tests()
self.sendrawtransaction_testmempoolaccept_tests()
self.decoderawtransaction_tests()
self.compressrawtransaction_tests()
self.decompressrawtransaction_tests()
self.transaction_version_number_tests()
if self.is_specified_wallet_compiled() and not self.options.descriptors:
self.import_deterministic_coinbase_privkeys()
Expand Down Expand Up @@ -246,6 +248,14 @@ def getrawtransaction_verbosity_tests(self):
gottx = self.nodes[1].getrawtransaction(txid=coin_base, verbosity=2, blockhash=block1)
assert 'fee' not in gottx

def compressrawtransaction_tests(self):
self.log.info("Test compressrawtransaction")
tx = "010000000001010000000000000072c1a6a246ae63f74f931e8365e15a089c68d61900000000000000000000ffffffff0100e1f50500000000000102616100000000"
compressed_transaction = self.nodes[0].compressrawtransaction(tx)
self.log.info("Compressed_Transaction = "+compressed_transaction)
compressed_tx_target = ""
assert_equal(compressed_tx_target, compressed_transaction)

def createrawtransaction_tests(self):
self.log.info("Test createrawtransaction")
# Test `createrawtransaction` required parameters
Expand Down Expand Up @@ -453,20 +463,13 @@ def decoderawtransaction_tests(self):
assert_equal(decrawtx, decrawtx_wit) # the witness interpretation should be chosen
assert_equal(decrawtx['vin'][0]['coinbase'], coinbase)

def compressrawtransaction_tests(self):
self.log.info("Test compressrawtransaction")
self.wallet.send_self_transfer(from_node=self.nodes[0])["hex"]
self.generate(self.nodes[0], 1)
tx = self.wallet.send_self_transfer(from_node=self.nodes[0])["hex"]
self.generate(self.nodes[0], 1)
self.log.info("test = "+tx)
# witness transaction
# tx = "010000000001010000000000000072c1a6a246ae63f74f931e8365e15a089c68d61900000000000000000000ffffffff0100e1f50500000000000102616100000000"
compressed_transaction = self.nodes[0].compressrawtransaction(tx)
def decompressrawtransaction_tests(self):
self.log.info("Test decompressrawtransaction")
tx = ""
decompressed_transaction = self.nodes[0].compressrawtransaction(tx)
self.log.info("Compressed_Transaction = "+compressed_transaction)
# decompressed_transaction = self.node[0].decompressrawtransaction(compressed_transaction)
# self.log.info("Decompressed_Transaction = "+decompressed_transaction)
# assert_equal(tx, decompressed_transaction)
decompressed_tx_target = "010000000001010000000000000072c1a6a246ae63f74f931e8365e15a089c68d61900000000000000000000ffffffff0100e1f50500000000000102616100000000"
assert_equal(decompressed_transaction, decompressed_tx_target)

def transaction_version_number_tests(self):
self.log.info("Test transaction version numbers")
Expand Down

0 comments on commit 593b907

Please sign in to comment.