From 4f2147cd265e5bedd12f8237bd0e783248e9b766 Mon Sep 17 00:00:00 2001
From: Jubal Mabaquiao
Date: Wed, 20 Nov 2024 12:24:09 +0800
Subject: [PATCH] fixed indents, spaces, extra semicolonts, etc (+1 squashed
commit)
---
app/ts/background/accessManagement.ts | 2 +-
app/ts/background/background.ts | 8 +--
app/ts/background/iconHandler.ts | 2 +-
app/ts/background/messageSending.ts | 10 +--
app/ts/background/sleeping.ts | 14 ++--
app/ts/background/windows/personalSign.ts | 2 +-
app/ts/components/App.tsx | 12 ++--
app/ts/components/pages/AddNewAddress.tsx | 6 +-
.../components/pages/ChangeActiveAddress.tsx | 2 +-
app/ts/components/pages/ChangeChain.tsx | 4 +-
.../components/pages/ConfirmTransaction.tsx | 43 ++++++-------
app/ts/components/pages/Home.tsx | 40 ++++++------
app/ts/components/pages/InterceptorAccess.tsx | 14 ++--
.../pages/InterceptorAccessList.tsx | 2 +-
app/ts/components/pages/WebsiteAccess.tsx | 64 +++++++++----------
.../SimulationSummary.tsx | 2 +-
.../simulationExplaining/SwapTransactions.tsx | 4 +-
.../simulationExplaining/Transactions.tsx | 10 +--
.../customExplainers/CatchAllVisualizer.tsx | 2 +-
.../customExplainers/GnosisSafeVisualizer.tsx | 2 +-
.../GovernanceVoteVisualizer.tsx | 4 +-
.../customExplainers/OpenSeaOrder.tsx | 6 +-
.../SimpleTokenApprovalVisualisation.tsx | 6 +-
.../identifyTransaction.tsx | 1 +
.../subcomponents/ConfigureRpcConnection.tsx | 6 +-
app/ts/components/subcomponents/DinoSays.tsx | 4 +-
.../subcomponents/DynamicScroller.tsx | 4 +-
app/ts/components/subcomponents/Hint.tsx | 2 +-
.../subcomponents/ParsedInputData.tsx | 2 +-
.../components/subcomponents/PasteCatcher.tsx | 2 +-
app/ts/components/subcomponents/Spinner.tsx | 2 +-
app/ts/components/subcomponents/Tooltip.tsx | 2 +-
app/ts/components/subcomponents/address.tsx | 2 +-
app/ts/components/subcomponents/icons.tsx | 6 +-
.../components/subcomponents/solidityType.tsx | 2 +-
app/ts/components/ui-utils.tsx | 34 +++++-----
.../services/EthereumClientService.ts | 6 +-
.../services/EthereumSubscriptionService.ts | 6 +-
.../SimulationModeEthereumClientService.ts | 8 +--
app/ts/types/JsonRpc-types.ts | 5 +-
app/ts/types/ethSimulate-types.ts | 40 ++++++------
app/ts/utils/contentScriptsUpdating.ts | 4 +-
app/ts/utils/errorDecoding.ts | 6 +-
app/ts/utils/sleep.ts | 2 +-
app/ts/utils/typescript.ts | 2 +-
app/ts/utils/uniswap.ts | 8 +--
package.json | 3 +-
47 files changed, 211 insertions(+), 209 deletions(-)
diff --git a/app/ts/background/accessManagement.ts b/app/ts/background/accessManagement.ts
index 31b27924..5c6948fb 100644
--- a/app/ts/background/accessManagement.ts
+++ b/app/ts/background/accessManagement.ts
@@ -110,7 +110,7 @@ function getAddressesThatDoNotNeedIndividualAccesses(activeAddressEntries: Addre
export async function setInterceptorDisabledForWebsite(website: Website, interceptorDisabled: boolean) {
return await updateWebsiteAccess((previousWebsiteAccess) => {
const index = previousWebsiteAccess.findIndex((entry) => entry.website.websiteOrigin === website.websiteOrigin)
- const previousAccess = index !== -1 ? previousWebsiteAccess[index] : undefined;
+ const previousAccess = index !== -1 ? previousWebsiteAccess[index] : undefined
if (previousAccess === undefined) return [...previousWebsiteAccess, { website, addressAccess: [], interceptorDisabled } ]
return replaceElementInReadonlyArray(previousWebsiteAccess, index, { ...previousAccess, interceptorDisabled })
})
diff --git a/app/ts/background/background.ts b/app/ts/background/background.ts
index 240885ab..b3cfc692 100644
--- a/app/ts/background/background.ts
+++ b/app/ts/background/background.ts
@@ -365,10 +365,10 @@ export async function refreshConfirmTransactionSimulation(
...transactionToSimulate.transaction,
nonce: lastNonceFixed.preSimulationTransaction.signedTransaction.nonce,
} }
- : { error: {
- ...transactionToSimulate.error,
- decodedErrorMessage: decodeEthereumError(availableAbis, transactionToSimulate.error).reason
- } }
+ : { error: {
+ ...transactionToSimulate.error,
+ decodedErrorMessage: decodeEthereumError(availableAbis, transactionToSimulate.error).reason
+ } }
}
}
}
diff --git a/app/ts/background/iconHandler.ts b/app/ts/background/iconHandler.ts
index b4ca2da5..2bcbddd7 100644
--- a/app/ts/background/iconHandler.ts
+++ b/app/ts/background/iconHandler.ts
@@ -36,7 +36,7 @@ export async function updateExtensionIcon(websiteTabConnections: WebsiteTabConne
return setIcon(ICON_ACCESS_DENIED, `The access to ${ activeAddress.name } for ${ websiteOrigin } has been DENIED!`)
}
if (settings.simulationMode) return setIcon(ICON_SIMULATING, 'The Interceptor simulates your sent transactions.')
- if (settings.currentRpcNetwork.httpsRpc === undefined) return setIcon(ICON_SIGNING_NOT_SUPPORTED, `The Interceptor is disabled while it's on an unsupported network`)
+ if (settings.currentRpcNetwork.httpsRpc === undefined) return setIcon(ICON_SIGNING_NOT_SUPPORTED, 'The Interceptor is disabled while it\'s on an unsupported network')
const tabState = await getTabState(tabId)
return setIcon(ICON_SIGNING, `The Interceptor forwards your transactions to ${ getPrettySignerName(tabState.signerName) } once sent.`)
}
diff --git a/app/ts/background/messageSending.ts b/app/ts/background/messageSending.ts
index 3ef5e2fe..cb170a08 100644
--- a/app/ts/background/messageSending.ts
+++ b/app/ts/background/messageSending.ts
@@ -1,8 +1,8 @@
-import { InterceptedRequestForward, InterceptorMessageToInpage, SubscriptionReplyOrCallBack } from "../types/interceptor-messages.js"
-import { WebsiteSocket, checkAndPrintRuntimeLastError } from "../utils/requests.js"
-import { WebsiteTabConnections } from "../types/user-interface-types.js"
-import { websiteSocketToString } from "./backgroundUtils.js"
-import { serialize } from "../types/wire-types.js"
+import { InterceptedRequestForward, InterceptorMessageToInpage, SubscriptionReplyOrCallBack } from '../types/interceptor-messages.js'
+import { WebsiteSocket, checkAndPrintRuntimeLastError } from '../utils/requests.js'
+import { WebsiteTabConnections } from '../types/user-interface-types.js'
+import { websiteSocketToString } from './backgroundUtils.js'
+import { serialize } from '../types/wire-types.js'
function postMessageToPortIfConnected(port: browser.runtime.Port, message: InterceptorMessageToInpage) {
try {
diff --git a/app/ts/background/sleeping.ts b/app/ts/background/sleeping.ts
index 3b12b9f5..918d98a7 100644
--- a/app/ts/background/sleeping.ts
+++ b/app/ts/background/sleeping.ts
@@ -1,10 +1,10 @@
-import { EthereumClientService } from "../simulation/services/EthereumClientService.js"
-import { TIME_BETWEEN_BLOCKS } from "../utils/constants.js"
-import { modifyObject } from "../utils/typescript.js"
-import { sendPopupMessageToOpenWindows } from "./backgroundUtils.js"
-import { updateExtensionBadge } from "./iconHandler.js"
-import { getInterceptorStartSleepingTimestamp, getRpcConnectionStatus, setInterceptorStartSleepingTimestamp, setRpcConnectionStatus } from "./storageVariables.js"
-import { isConfirmTransactionFocused } from "./windows/confirmTransaction.js"
+import { EthereumClientService } from '../simulation/services/EthereumClientService.js'
+import { TIME_BETWEEN_BLOCKS } from '../utils/constants.js'
+import { modifyObject } from '../utils/typescript.js'
+import { sendPopupMessageToOpenWindows } from './backgroundUtils.js'
+import { updateExtensionBadge } from './iconHandler.js'
+import { getInterceptorStartSleepingTimestamp, getRpcConnectionStatus, setInterceptorStartSleepingTimestamp, setRpcConnectionStatus } from './storageVariables.js'
+import { isConfirmTransactionFocused } from './windows/confirmTransaction.js'
const updateConnectionStatusRetry = async (ethereumClientService: EthereumClientService) => {
const status = await getRpcConnectionStatus()
diff --git a/app/ts/background/windows/personalSign.ts b/app/ts/background/windows/personalSign.ts
index 22197808..8fe5c8a1 100644
--- a/app/ts/background/windows/personalSign.ts
+++ b/app/ts/background/windows/personalSign.ts
@@ -19,7 +19,7 @@ async function addMetadataToOpenSeaOrder(ethereumClientService: EthereumClientSe
offerer: await identifyAddress(ethereumClientService, requestAbortController, openSeaOrder.offerer),
offer: await Promise.all(openSeaOrder.offer.map( async (offer) => ({ ...offer, token: await identifyAddress(ethereumClientService, requestAbortController, offer.token) }))),
consideration: await Promise.all(openSeaOrder.consideration.map(async (offer) => ({ ...offer, token: await identifyAddress(ethereumClientService, requestAbortController, offer.token), recipient: await identifyAddress(ethereumClientService, requestAbortController, offer.recipient) })))
- }
+ }
}
export async function craftPersonalSignPopupMessage(ethereumClientService: EthereumClientService, requestAbortController: AbortController | undefined, signedMessageTransaction: SignedMessageTransaction, rpcNetwork: RpcNetwork): Promise {
diff --git a/app/ts/components/App.tsx b/app/ts/components/App.tsx
index e9d33ca7..ca0125c7 100644
--- a/app/ts/components/App.tsx
+++ b/app/ts/components/App.tsx
@@ -52,12 +52,12 @@ export function NetworkErrors({ rpcConnectionStatus } : NetworkErrorParams) {
Unable to connect to { rpcConnectionStatus.rpcNetwork.name }. Retrying in .>
}/>
- : <>> }
+ : <>> }
{ rpcConnectionStatus.latestBlock !== undefined && noNewBlockForOverTwoMins(rpcConnectionStatus) && rpcConnectionStatus.latestBlock !== null ?
The connected RPC ({ rpcConnectionStatus.rpcNetwork.name }) seem to be stuck at block { rpcConnectionStatus.latestBlock.number } (occured on: { humanReadableDate(rpcConnectionStatus.latestBlock.timestamp) }). Retrying in .>
}/>
- : <>> }
+ : <>> }
>
}
@@ -366,7 +366,7 @@ export function App() {
close = { () => setAndSaveAppPage({ page: 'Home' }) }
editEnsNamedHashWindowState = { appPage.state }
/>
- : <>> }
+ : <>> }
{ appPage.page === 'AccessList' ?
- : <>> }
+ : <>> }
{ appPage.page === 'ChangeActiveAddress' ?
- : <>> }
+ : <>> }
{ appPage.page === 'AddNewAddress' || appPage.page === 'ModifyAddress' ?
setAndSaveAppPage({ page: 'Home' }) }
activeAddress = { simulationMode ? activeSimulationAddress : activeSigningAddress }
/>
- : <>> }
+ : <>> }
> }
diff --git a/app/ts/components/pages/AddNewAddress.tsx b/app/ts/components/pages/AddNewAddress.tsx
index c860b22e..aaf94549 100644
--- a/app/ts/components/pages/AddNewAddress.tsx
+++ b/app/ts/components/pages/AddNewAddress.tsx
@@ -44,7 +44,7 @@ type NameInputParams = {
function NameInput({ nameInput, setNameInput, disabled }: NameInputParams) {
const ref = createRef()
- useEffect(() => { ref.current?.focus() }, [])
+ useEffect(() => { ref.current?.focus() }, [])
return ()
- useEffect(() => { ref.current?.focus() }, [])
+ useEffect(() => { ref.current?.focus() }, [])
return
{ chainChangeData.rpcNetwork.httpsRpc === undefined && chainChangeData.simulationMode ?
- : <>> }
+ : <>> }
{ chainChangeData.rpcNetwork.httpsRpc === undefined && !chainChangeData.simulationMode ?
- : <>> }
+ : <>> }
diff --git a/app/ts/components/pages/ConfirmTransaction.tsx b/app/ts/components/pages/ConfirmTransaction.tsx
index c12d5f66..edec67ef 100644
--- a/app/ts/components/pages/ConfirmTransaction.tsx
+++ b/app/ts/components/pages/ConfirmTransaction.tsx
@@ -98,7 +98,6 @@ const TransactionNames = (param: TransactionNamesParams) => {
const currentPendingTransactionOrSignableMessage = param.currentPendingTransaction
if (currentPendingTransactionOrSignableMessage === undefined) return 'Loading...'
if (currentPendingTransactionOrSignableMessage.transactionOrMessageCreationStatus !== 'Simulated') return currentPendingTransactionOrSignableMessage.transactionOrMessageCreationStatus
- currentPendingTransactionOrSignableMessage.transactionOrMessageCreationStatus
if (currentPendingTransactionOrSignableMessage.type === 'SignableMessage') return identifySignature(currentPendingTransactionOrSignableMessage.visualizedPersonalSignRequest).title
if (currentPendingTransactionOrSignableMessage.simulationResults.statusCode === 'failed') return 'Failing transaction'
const lastTx = currentPendingTransactionOrSignableMessage.simulationResults.statusCode !== 'success' ? undefined : getResultsForTransaction(currentPendingTransactionOrSignableMessage.simulationResults.data.simulatedAndVisualizedTransactions, currentPendingTransactionOrSignableMessage.transactionIdentifier)
@@ -364,12 +363,12 @@ function Buttons({ currentPendingTransactionOrSignableMessage, reject, approve,
@@ -542,7 +541,7 @@ export function ConfirmTransaction() {
close = { () => { setModalState({ page: 'noModal' }) } }
editEnsNamedHashWindowState = { modalState.state }
/>
- : <>> }
+ : <>> }
{ modalState.page === 'modifyAddress' ?
{ setModalState({ page: 'noModal' }) } }
activeAddress = { currentPendingTransactionOrSignableMessage?.activeAddress }
/>
- : <>> }
+ : <>> }
{ param.simulationAndVisualisationResults.simulatedAndVisualizedTransactions.length === 0 && param.simulationAndVisualisationResults.visualizedPersonalSignRequests.length === 0 ?
- : <>
-
-
- { param.removedTransactionOrSignedMessages.length > 0
- ? <>>
- :
+
+
- }
-
- > }
+ { param.removedTransactionOrSignedMessages.length > 0
+ ? <>>
+ :
+ }
+
+ > }
}
@@ -284,7 +284,7 @@ export function Home(param: HomeParams) {
return <>
{ rpcNetwork.httpsRpc === undefined ?
- : <>> }
+ : <>> }
void, accessRequest: PendingAccessRequest, changeActiveAddress: () => void, refreshActiveAddress: () => Promise }) {
return <>
{ accessRequest.requestAccessToAddress === undefined ?
-
-
-
-
- would like to connect to The Interceptor
-
-
:
+
+
+
+
+ would like to connect to The Interceptor
+
+
:
<>
diff --git a/app/ts/components/pages/InterceptorAccessList.tsx b/app/ts/components/pages/InterceptorAccessList.tsx
index 86ac6a25..86e5d2c4 100644
--- a/app/ts/components/pages/InterceptorAccessList.tsx
+++ b/app/ts/components/pages/InterceptorAccessList.tsx
@@ -227,7 +227,7 @@ export function InterceptorAccessList(param: InterceptorAccessListParams) {
- : <>> }
+ : <>> }
{ editableAccessList === undefined ? <>> : editableAccessList.map((access, accessListIndex) => (
{ access.removed ? { `Forgot ${ access.websiteAccess.website.websiteOrigin }. `}
:
diff --git a/app/ts/components/pages/WebsiteAccess.tsx b/app/ts/components/pages/WebsiteAccess.tsx
index f3dae282..8df05cad 100644
--- a/app/ts/components/pages/WebsiteAccess.tsx
+++ b/app/ts/components/pages/WebsiteAccess.tsx
@@ -40,7 +40,7 @@ const WebsiteAccessProvider = ({ children }: { children: ComponentChildren }) =>
retrieveWebsiteAccess({ query: searchQuery.value })
}
- const listenForPopupMessages = () => {
+ const listenForPopupMessages = () => {
const popupMessageListener = async (msg: unknown) => {
const maybeParsed = MessageToPopup.safeParse(msg)
if (!maybeParsed.success) return // not a message we are interested in
@@ -177,8 +177,8 @@ const WebsiteSettingsList = () => {
const selectedWebsiteOrigin = formData.get(URL_HASH_KEY)?.toString()
if (!selectedWebsiteOrigin) {
- window.location.href = window.location.pathname
- return
+ window.location.href = window.location.pathname
+ return
}
window.location.href = `${ window.location.pathname }${ URL_HASH_PREFIX }${ selectedWebsiteOrigin }`
@@ -276,7 +276,7 @@ const WebsiteSettingsDetail = () => {