eprbell / dali-rp2

DaLI (Data Loader Interface) is a data loader and input generator for RP2 (https://pypi.org/project/rp2), the privacy-focused, free, open-source cryptocurrency tax calculator: DaLI removes the need to manually prepare RP2 input files. Just like RP2, DaLI is also free, open-source and it prioritizes user privacy.
https://pypi.org/project/dali-rp2/
Apache License 2.0
63 stars 42 forks source link

Bitbank widthdrawals status CONFIRM_TIMEOUT #166

Closed topherbuckley closed 1 year ago

topherbuckley commented 1 year ago

I got the following error while importing a csv from bitbank.

ERROR: Fatal exception occurred:
Traceback (most recent call last):
  File "/media/christopher/HDD/git/dali-rp2/src/dali/dali_main.py", line 176, in _dali_main_internal
    result_list = pool.map(_input_plugin_helper, input_plugin_args_list)
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/media/christopher/HDD/git/dali-rp2/src/dali/dali_main.py", line 214, in _input_plugin_helper
    plugin_transactions = input_plugin.load(country)
  File "/media/christopher/HDD/git/dali-rp2/src/dali/plugin/input/csv/bitbank_supplemental.py", line 73, in load
    result.extend(self.parse_withdrawals_file(self.__withdrawals_csv_file))
  File "/media/christopher/HDD/git/dali-rp2/src/dali/plugin/input/csv/bitbank_supplemental.py", line 140, in parse_withdrawals_file
    IntraTransaction(
  File "/media/christopher/HDD/git/dali-rp2/src/dali/intra_transaction.py", line 50, in __init__
    super().__init__(
  File "/media/christopher/HDD/git/dali-rp2/src/dali/abstract_transaction.py", line 115, in __init__
    self.__unique_id: str = self._validate_string_field(Keyword.UNIQUE_ID.value, unique_id, raw_data, disallow_empty=True, disallow_unknown=False)
  File "/media/christopher/HDD/git/dali-rp2/src/dali/abstract_transaction.py", line 55, in _validate_string_field
    raise RP2RuntimeError(f"Internal error: {name} is empty: {raw_data}")
rp2.rp2_error.RP2RuntimeError: Internal error: unique_id is empty: 2021/09/12 20:10:27,3020,0.01,3020.01,Coinbase,{RECATED_ADDRESS},,CONFIRM_TIMEOUT

Looking at the csv file, the line in question looks like:

2021/09/12 20:10:27,3020,0.01,3020.01,Coinbase,{RECATED_ADDRESS},,CONFIRM_TIMEOUT

Note the Status (ステータス) is normally 'DONE' but in this case it is 'CONFIRM_TIMEOUT'. I checked on my Coinbase account, and indeed it looks like such a withdrawals never made its way to Coinbase, so I assume this is an indicator of a failed transaction. I wonder if there are others and will search a bit for documentation on this from bitbank, but otherwise will submit a PR to handle this string and just exit out of whatever transaction handling that is occurring.