Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/assets-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Set `persist: false` on state metadata for legacy assets controllers so their state is no longer written to disk (`TokensController`, `CurrencyRateController`, `TokenRatesController`, `TokenBalancesController`, `AccountTrackerController`, `MultichainAssetsController`, `MultichainAssetsRatesController`, `MultichainBalancesController`) ([#9842](https://github.com/MetaMask/core/pull/9842))
- Bump `@metamask/transaction-controller` from `^69.5.0` to `^69.5.2` ([#9798](https://github.com/MetaMask/core/pull/9798), [#9823](https://github.com/MetaMask/core/pull/9823))
- Bump `@metamask/accounts-controller` from `^39.0.7` to `^39.1.0` ([#9807](https://github.com/MetaMask/core/pull/9807))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2042,13 +2042,7 @@ describe('AccountTrackerController', () => {
controller.metadata,
'persist',
),
).toMatchInlineSnapshot(`
{
"accountsByChainId": {
"0x1": {},
},
}
`);
).toMatchInlineSnapshot(`{}`);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export type AccountTrackerControllerState = {
const accountTrackerMetadata: StateMetadata<AccountTrackerControllerState> = {
accountsByChainId: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
Expand Down
13 changes: 1 addition & 12 deletions packages/assets-controllers/src/CurrencyRateController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2326,18 +2326,7 @@ describe('CurrencyRateController', () => {
controller.metadata,
'persist',
),
).toMatchInlineSnapshot(`
{
"currencyRates": {
"ETH": {
"conversionDate": 0,
"conversionRate": 0,
"usdConversionRate": null,
},
},
"currentCurrency": "usd",
}
`);
).toMatchInlineSnapshot(`{}`);
});

it('exposes expected state to UI', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/assets-controllers/src/CurrencyRateController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ export type CurrencyRateMessenger = Messenger<
const metadata: StateMetadata<CurrencyRateState> = {
currentCurrency: {
includeInStateLogs: true,
persist: true,
persist: false,
includeInDebugSnapshot: true,
usedInUi: true,
},
currencyRates: {
includeInStateLogs: true,
persist: true,
persist: false,
includeInDebugSnapshot: true,
usedInUi: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2212,13 +2212,7 @@ describe('MultichainAssetsController', () => {
controller.metadata,
'persist',
),
).toMatchInlineSnapshot(`
{
"accountsAssets": {},
"allIgnoredAssets": {},
"assetsMetadata": {},
}
`);
).toMatchInlineSnapshot(`{}`);
});

it('exposes expected state to UI', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,19 @@ const assetsControllerMetadata: StateMetadata<MultichainAssetsControllerState> =
{
assetsMetadata: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
accountsAssets: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
allIgnoredAssets: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1613,11 +1613,7 @@ describe('MultichainAssetsRatesController', () => {
controller.metadata,
'persist',
),
).toMatchInlineSnapshot(`
{
"conversionRates": {},
}
`);
).toMatchInlineSnapshot(`{}`);
});

it('exposes expected state to UI', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export type MultichainAssetsRatesPollingInput = {
const metadata: StateMetadata<MultichainAssetsRatesControllerState> = {
conversionRates: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: true,
usedInUi: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,11 +1040,7 @@ describe('MultichainBalancesController', () => {
controller.metadata,
'persist',
),
).toMatchInlineSnapshot(`
{
"balances": {},
}
`);
).toMatchInlineSnapshot(`{}`);
});

it('exposes expected state to UI', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const balancesControllerMetadata: StateMetadata<MultichainBalancesControllerStat
{
balances: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6345,11 +6345,7 @@ describe('TokenBalancesController', () => {
controller.metadata,
'persist',
),
).toMatchInlineSnapshot(`
{
"tokenBalances": {},
}
`);
).toMatchInlineSnapshot(`{}`);
});

it('exposes expected state to UI', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function mergeUpdateBalancesOptions(
const metadata: StateMetadata<TokenBalancesControllerState> = {
tokenBalances: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1407,11 +1407,7 @@ describe('TokenRatesController', () => {
controller.metadata,
'persist',
),
).toMatchInlineSnapshot(`
{
"marketData": {},
}
`);
).toMatchInlineSnapshot(`{}`);
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/assets-controllers/src/TokenRatesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export type TokenRatesControllerMessenger = Messenger<
const tokenRatesControllerMetadata: StateMetadata<TokenRatesControllerState> = {
marketData: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
Expand Down
8 changes: 1 addition & 7 deletions packages/assets-controllers/src/TokensController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4025,13 +4025,7 @@ describe('TokensController', () => {
controller.metadata,
'persist',
),
).toMatchInlineSnapshot(`
{
"allDetectedTokens": {},
"allIgnoredTokens": {},
"allTokens": {},
}
`);
).toMatchInlineSnapshot(`{}`);
});
});

Expand Down
6 changes: 3 additions & 3 deletions packages/assets-controllers/src/TokensController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,19 @@ export type TokensControllerState = {
const metadata: StateMetadata<TokensControllerState> = {
allTokens: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
allIgnoredTokens: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
allDetectedTokens: {
includeInStateLogs: false,
persist: true,
persist: false,
includeInDebugSnapshot: false,
usedInUi: true,
},
Expand Down