refactor: rename WalletHistory fieldname from price to rate

This commit is contained in:
Matthias
2026-01-12 20:28:47 +01:00
parent 623991c772
commit f7ddf46b32
7 changed files with 18 additions and 18 deletions
+3 -3
View File
@@ -643,10 +643,10 @@ def test_record_wallet_state_stores_wallet_history(mocker, default_conf):
records_by_currency = {entry.currency: entry for entry in wallet_entries}
assert records_by_currency[stake_currency].balance == 1.5
assert records_by_currency[stake_currency].price == 1.0
assert records_by_currency["ETH"].price == 0.5
assert records_by_currency[stake_currency].rate == 1.0
assert records_by_currency["ETH"].rate == 0.5
assert records_by_currency["ETH/BTC"].balance == 0.8
assert records_by_currency["ETH/BTC"].price == 2500.0
assert records_by_currency["ETH/BTC"].rate == 2500.0
@pytest.mark.usefixtures("init_persistence")
@@ -232,14 +232,14 @@ def test_migrate_wallet_history_with_multiple_pairs(default_conf_usdt, fee, time
# Stake currency should have price = 1.0
for entry in usdt_entries:
assert entry.price == 1.0
assert entry.rate == 1.0
eth_entries = [e for e in wallet_entries if e.currency == "ETH"]
btc_entries = [e for e in wallet_entries if e.currency == "BTC"]
assert len(eth_entries) == 4
assert len(btc_entries) == 2
assert all(entry.price and entry.price > 1400 and entry.price < 1600 for entry in eth_entries)
assert all(entry.price and entry.price > 29000 and entry.price < 31000 for entry in btc_entries)
assert all(entry.rate and entry.rate > 1400 and entry.rate < 1600 for entry in eth_entries)
assert all(entry.rate and entry.rate > 29000 and entry.rate < 31000 for entry in btc_entries)
assert all(entry.balance == 10 for entry in btc_entries)