fix: the ETH line reads unknown at an address no refresh has read (closes #736)
An address's ETH balance is now null until a refresh has read it. That covers a new address, a new wallet, addresses a wallet scan finds, and every address after a network switch. Its line reads `quantity unknown`, Home's balance `unknown (ETH)`, and Send `Current balance: unknown (ETH)`. Max says the balance is unknown. Send is no longer refused as zero. The address has no total, and DeleteAddress warns that it may hold a balance. A refresh also deletes `balanceNotFetched` only when it read every address in the stored record. Model: opus-5-5
This commit was merged in pull request #741.
This commit is contained in:
@@ -125,6 +125,14 @@ describe("the value of an address, and whether it is the whole value", () => {
|
||||
expect(getAddressValue(addr)).toEqual({ usd: 0, partial: false });
|
||||
});
|
||||
|
||||
// No total can include an ETH balance no refresh has read, and "unpriced
|
||||
// tokens only" would be untrue of an address with nothing known at all.
|
||||
test("an ETH balance no refresh has read means no value", () => {
|
||||
const addr = { address: "0x1", balance: null, tokenBalances: [] };
|
||||
expect(getAddressValue(addr)).toEqual({ usd: null, partial: false });
|
||||
expect(formatAddressTotal(getAddressValue(addr))).toBe("");
|
||||
});
|
||||
|
||||
// Before the first price fetch, and on testnet, nothing is knowable: that
|
||||
// is a third state, and it stays distinct from both of the others.
|
||||
test("no prices at all means no value, not an incomplete one", () => {
|
||||
|
||||
Reference in New Issue
Block a user