unspent.py 538 B

1234567891011121314151617
  1. import os as overlay_fake_os
  2. from .unspent_orig import *
  3. if overlay_fake_os.getenv('MMGEN_BOGUS_UNSPENT_DATA'):
  4. class overlay_fake_BitcoinTwUnspentOutputs(BitcoinTwUnspentOutputs):
  5. async def get_rpc_data(self):
  6. from decimal import Decimal
  7. import json
  8. from ....fileutil import get_data_from_file
  9. return json.loads(get_data_from_file(
  10. self.cfg,
  11. overlay_fake_os.getenv('MMGEN_BOGUS_UNSPENT_DATA')
  12. ), parse_float=Decimal)
  13. BitcoinTwUnspentOutputs.get_rpc_data = overlay_fake_BitcoinTwUnspentOutputs.get_rpc_data