old_contents: #!/usr/bin/env python3
  # Copyright (c) 2019-2020 The Bitcoin Core developers
  # Distributed under the MIT software license, see the accompanying
  # file COPYING or http://www.opensource.org/licenses/mit-license.php.
  """Test the generation of UTXO snapshots using `dumptxoutset`.
  """
  from test_framework.test_framework import SyscoinTestFramework
  from test_framework.util import assert_equal, assert_raises_rpc_error
  
  import hashlib
  from pathlib import Path
  
  
  class DumptxoutsetTest(SyscoinTestFramework):
      def set_test_params(self):
          self.setup_clean_chain = True
          self.num_nodes = 1
  
      def run_test(self):
          """Test a trivial usage of the dumptxoutset RPC command."""
          node = self.nodes[0]
          mocktime = node.getblockheader(node.getblockhash(0))['time'] + 1
          node.setmocktime(mocktime)
          node.generate(100)
  
          FILENAME = 'txoutset.dat'
          out = node.dumptxoutset(FILENAME)
          expected_path = Path(node.datadir) / self.chain / FILENAME
  
          assert expected_path.is_file()
  
          assert_equal(out['coins_written'], 100)
          assert_equal(out['base_height'], 100)
          assert_equal(out['path'], str(expected_path))
          # Blockhash should be deterministic based on mocked time.
          # SYSCOIN
          assert_equal(
              out['base_hash'],
              '4467b30ba5ffd3ef65ededf39e0bdb0e250606741713a07f7e9bf0335b20088d')
  
          with open(str(expected_path), 'rb') as f:
              digest = hashlib.sha256(f.read()).hexdigest()
              # UTXO snapshot hash should be deterministic based on mocked time.
              # SYSCOIN
              assert_equal(
                  digest, '8ff350ec4526b110bcb2caf989e1c89f0716030f326b21f02566d6f65d0cc565')
  
          # Specifying a path to an existing file will fail.
          assert_raises_rpc_error(
              -8, '{} already exists'.format(FILENAME),  node.dumptxoutset, FILENAME)
  
  if __name__ == '__main__':
      DumptxoutsetTest().main()
  
new_contents: #!/usr/bin/env python3
  # Copyright (c) 2019-2020 The Bitcoin Core developers
  # Distributed under the MIT software license, see the accompanying
  # file COPYING or http://www.opensource.org/licenses/mit-license.php.
  """Test the generation of UTXO snapshots using `dumptxoutset`.
  """
  from test_framework.test_framework import SyscoinTestFramework
  from test_framework.util import assert_equal, assert_raises_rpc_error
  
  import hashlib
  from pathlib import Path
  
  
  class DumptxoutsetTest(SyscoinTestFramework):
      def set_test_params(self):
          self.setup_clean_chain = True
          self.num_nodes = 1
  
      def run_test(self):
          """Test a trivial usage of the dumptxoutset RPC command."""
          node = self.nodes[0]
          mocktime = node.getblockheader(node.getblockhash(0))['time'] + 1
          node.setmocktime(mocktime)
          node.generate(100)
  
          FILENAME = 'txoutset.dat'
          out = node.dumptxoutset(FILENAME)
          expected_path = Path(node.datadir) / self.chain / FILENAME
  
          assert expected_path.is_file()
  
          assert_equal(out['coins_written'], 100)
          assert_equal(out['base_height'], 100)
          assert_equal(out['path'], str(expected_path))
          # Blockhash should be deterministic based on mocked time.
          # SYSCOIN
          assert_equal(
              out['base_hash'],
              '4467b30ba5ffd3ef65ededf39e0bdb0e250606741713a07f7e9bf0335b20088d')
  
          with open(str(expected_path), 'rb') as f:
              digest = hashlib.sha256(f.read()).hexdigest()
              # UTXO snapshot hash should be deterministic based on mocked time.
              # SYSCOIN
              assert_equal(
                  digest, 'e771b160b690e002464f61bed07af483e2d54dd02fd344db6943886697e6463c')
  
          # Specifying a path to an existing file will fail.
          assert_raises_rpc_error(
              -8, '{} already exists'.format(FILENAME),  node.dumptxoutset, FILENAME)
  
  if __name__ == '__main__':
      DumptxoutsetTest().main()
  
subject: fix test