diff --git a/tests/raid_test.py b/tests/raid_test.py index e770b74..d4d0f40 100644 --- a/tests/raid_test.py +++ b/tests/raid_test.py @@ -24,6 +24,7 @@ get_transfer_assets_plain_value, get_tx_delay_factor, list_tx_nonce, + row_to_recipient, update_agent_address, write_ranking_rewards_csv, write_tx_result_csv, @@ -604,3 +605,15 @@ def test_get_prepare_reward_assets_plain_value(fx_session): 23890, ], ] + + +@pytest.mark.parametrize("ticker", ["CRYSTAL", "Item_NT_500000", "RUNESTONE_FENRIR1"]) +def test_row_to_recipient(ticker: str): + content = f"3,25,0x01069aaf336e6aEE605a8A54D0734b43B62f8Fe4,5b65f5D0e23383FA18d74A62FbEa383c7D11F29d,150000,{ticker},18,175" + row = content.split(",") + recipient: Recipient = row_to_recipient(row) + assert recipient["recipient"] == "5b65f5D0e23383FA18d74A62FbEa383c7D11F29d" + amount = recipient["amount"] + assert amount["quantity"] == 150000 + assert amount["decimalPlaces"] == 18 + assert amount["ticker"] == ticker diff --git a/world_boss/app/raid.py b/world_boss/app/raid.py index 1a036a5..45ba9a7 100644 --- a/world_boss/app/raid.py +++ b/world_boss/app/raid.py @@ -171,14 +171,12 @@ def write_ranking_rewards_csv( def row_to_recipient(row: RecipientRow) -> Recipient: - agent_address = row[2] avatar_address = row[3] amount = int(row[4]) ticker = row[5] decimal_places = int(row[6]) - recipient = agent_address if ticker == "CRYSTAL" else avatar_address return { - "recipient": recipient, + "recipient": avatar_address, "amount": { "quantity": amount, "decimalPlaces": decimal_places,