fix: the first wallet's first address is active as soon as it is added (closes #512)
The popup picked an active address only when it opened, so after the first wallet was created nothing was active until a reopen: Home had no headline, and Send and Receive refused. Each of the three import paths on AddWallet now makes the new wallet's first address active when no address is. The background already answered sites with that address through its own fallback, so nothing is broadcast. The address scan stand-in in the popup test boot now answers in the real scan's shape, which the phrase and xprv imports read. Model: opus-5-5
This commit is contained in:
@@ -258,12 +258,17 @@ async function bootPopup(stored, options) {
|
||||
formatAddressTotal: () => "",
|
||||
getAddressValue: () => ({ usd: null, partial: false }),
|
||||
}));
|
||||
// scanForAddresses() answers in the real one's shape, a scan that found
|
||||
// no used address: AddWallet reads `addresses` from it.
|
||||
jest.doMock("../../src/shared/balances", () => ({
|
||||
fetchTokenBalances: jest.fn(async () => []),
|
||||
refreshBalances: jest.fn(async () => {}),
|
||||
lookupTokenInfo: jest.fn(async () => null),
|
||||
getProvider: () => ({}),
|
||||
scanForAddresses: jest.fn(async () => []),
|
||||
scanForAddresses: jest.fn(async () => ({
|
||||
addresses: [],
|
||||
nextIndex: 1,
|
||||
})),
|
||||
}));
|
||||
// filterTransactions() answers in the real one's shape: Home,
|
||||
// AddressDetail and AddressToken read both fields, and a bare list makes
|
||||
|
||||
Reference in New Issue
Block a user