Skip to content

Commit

Permalink
FIX forward uncatched binance remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
provinzio committed Apr 28, 2024
1 parent 411c26b commit a0ad3cf
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,21 +243,27 @@ def _read_binance(self, file_path: Path, version: int = 1) -> None:
assert coin
assert change

# Check for problems.
if remark and remark not in (
"Withdraw fee is included",
"Binance Earn",
"Binance Launchpool",
) and not remark.endswith(" to BNB"):
log.warning(
"I may have missed a remark in %s:%i: `%s`.",
file_path,
row,
remark,
)
if remark:
# Ignore default remarks
if remark in (
"Withdraw fee is included",
"Binance Earn",
"Binance Launchpool",
) or remark.endswith(" to BNB"):
remark = None

# Warn on other binance remarks, becuase all remarks should be some
# unnecessary default text which we'd like to ignore
else:
log.warning(
"I may have missed a remark in %s:%i: `%s`.",
file_path,
row,
remark,
)

self.append_operation(
operation, utc_time, platform, change, coin, row, file_path
operation, utc_time, platform, change, coin, row, file_path, remark
)

def _read_binance_v2(self, file_path: Path) -> None:
Expand Down

0 comments on commit a0ad3cf

Please sign in to comment.