Skip to content

Commit

Permalink
fix: Add missing allowed action to the SmartTransactionsController me…
Browse files Browse the repository at this point in the history
…ssenger
  • Loading branch information
cryptodev-2s committed Jan 7, 2025
1 parent 82d7f87 commit 5c88b84
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions app/core/Engine/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ export class Engine {

return Boolean(
hasProperty(showIncomingTransactions, currentChainId) &&
showIncomingTransactions?.[currentHexChainId],
showIncomingTransactions?.[currentHexChainId],
);
},
updateTransactions: true,
Expand Down Expand Up @@ -1241,7 +1241,10 @@ export class Engine {
state: initialState.SmartTransactionsController,
messenger: this.controllerMessenger.getRestricted({
name: 'SmartTransactionsController',
allowedActions: ['NetworkController:getNetworkClientById'],
allowedActions: [
'NetworkController:getNetworkClientById',
'NetworkController:getState',
],
allowedEvents: ['NetworkController:stateChange'],
}),
getTransactions: this.transactionController.getTransactions.bind(
Expand Down Expand Up @@ -1518,7 +1521,7 @@ export class Engine {
if (
state.networksMetadata[state.selectedNetworkClientId].status ===
NetworkStatus.Available &&
getGlobalChainId(networkController) !== currentChainId
getGlobalChainId(networkController) !== currentChainId
) {
// We should add a state or event emitter saying the provider changed
setTimeout(() => {
Expand Down Expand Up @@ -1780,7 +1783,7 @@ export class Engine {

const tokenBalances =
allTokenBalances?.[selectedInternalAccount.address as Hex]?.[
chainId
chainId
] ?? {};
tokens.forEach(
(item: { address: string; balance?: string; decimals: number }) => {
Expand All @@ -1791,9 +1794,9 @@ export class Engine {
item.balance ||
(item.address in tokenBalances
? renderFromTokenMinimalUnit(
tokenBalances[item.address as Hex],
item.decimals,
)
tokenBalances[item.address as Hex],
item.decimals,
)
: undefined);
const tokenBalanceFiat = balanceToFiatNumber(
// TODO: Fix this by handling or eliminating the undefined case
Expand Down

0 comments on commit 5c88b84

Please sign in to comment.