Browse Source

test suite: vendor `tx_valid.json` from Bitcoin Core repo (v28.0)

The MMGen Project 2 months ago
parent
commit
7293135db8
3 changed files with 436 additions and 15 deletions
  1. 3 8
      test/daemontest_d/ut_tx.py
  2. 0 7
      test/modtest_d/ut_testdep.py
  3. 433 0
      test/ref/tx_valid.json

+ 3 - 8
test/daemontest_d/ut_tx.py

@@ -123,18 +123,13 @@ class unit_tests:
 
 
 	async def core_vectors(self, name, ut):
 	async def core_vectors(self, name, ut):
 
 
-		core_repo_root = os.getenv('CORE_REPO_ROOT')
-		if not core_repo_root:
-			msg('The environmental variable CORE_REPO_ROOT must be set before running this test')
-			return False
-
 		start_test_daemons('btc')
 		start_test_daemons('btc')
 
 
-		fn_b = 'src/test/data/tx_valid.json'
-		fn = os.path.join(core_repo_root, fn_b)
-		with open(fn) as fp:
+		with open('test/ref/tx_valid.json') as fp:
 			core_data = json.loads(fp.read())
 			core_data = json.loads(fp.read())
+
 		print_info(name, 'Bitcoin Core test vectors')
 		print_info(name, 'Bitcoin Core test vectors')
+
 		n = 1
 		n = 1
 		for e in core_data:
 		for e in core_data:
 			if isinstance(e[0], list):
 			if isinstance(e[0], list):

+ 0 - 7
test/modtest_d/ut_testdep.py

@@ -26,13 +26,6 @@ class unit_tests:
 			bmsg("  Install pylint with 'python3 -m pip install pylint'")
 			bmsg("  Install pylint with 'python3 -m pip install pylint'")
 			return False
 			return False
 
 
-	def core_repo(self, name, ut):
-		crr = os.getenv('CORE_REPO_ROOT')
-		if not crr or not os.path.exists(os.path.join(crr, 'src/test/data/tx_valid.json')):
-			ymsg('CORE_REPO_ROOT not set, or does not point to Bitcoin Core repository')
-			return False
-		return True
-
 	def losetup(self, name, ut):
 	def losetup(self, name, ut):
 		os.stat('/dev/loop0')
 		os.stat('/dev/loop0')
 		run(['/sbin/losetup', '-f'], check=True, stdout=DEVNULL)
 		run(['/sbin/losetup', '-f'], check=True, stdout=DEVNULL)

File diff suppressed because it is too large
+ 433 - 0
test/ref/tx_valid.json


Some files were not shown because too many files changed in this diff