From ecde67819fcc0bae32c87487d175b7b64de6c252 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Tue, 11 Feb 2025 15:32:07 +0100 Subject: [PATCH] station -> checker (wip) --- README.md | 4 +- docs/DEVELOPING.md | 4 +- docs/MODULE_INTERFACE.md | 12 +++--- main/config.js | 39 +++++++++++++---- main/index.js | 2 +- main/ipc.js | 2 +- main/telemetry.js | 2 +- main/tray.js | 4 +- main/ui.js | 2 +- main/updater.js | 4 +- renderer/README.md | 2 +- renderer/src/components/Layout.tsx | 2 - renderer/src/components/Onboarding.tsx | 6 +-- renderer/src/components/RebrandBanner.tsx | 36 ---------------- renderer/src/components/Sentry.tsx | 4 +- renderer/src/components/UpdateBanner.tsx | 4 +- renderer/src/components/WalletModal.tsx | 12 +++--- renderer/src/hooks/Activity.tsx | 10 ++--- renderer/src/hooks/Rewards.tsx | 14 +++---- renderer/src/hooks/Wallet.tsx | 30 ++++++------- renderer/src/lib/config.tsx | 42 +++++++++---------- renderer/src/pages/wallet/TransferWrapper.tsx | 6 +-- renderer/src/pages/wallet/Wallet.tsx | 12 +++--- renderer/src/test/dashboard.test.tsx | 22 +++++----- renderer/src/test/helpers.tsx | 2 +- renderer/src/test/onboarding.test.tsx | 2 +- renderer/src/test/settings.test.tsx | 2 +- renderer/src/test/wallet-modal.test.tsx | 12 +++--- renderer/src/test/wallet.test.tsx | 12 +++--- test/e2e/app-launch.e2e.test.js | 6 +-- 30 files changed, 150 insertions(+), 163 deletions(-) delete mode 100644 renderer/src/components/RebrandBanner.tsx diff --git a/README.md b/README.md index ee506fe5e..90d7388e4 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ [![](https://img.shields.io/badge/project-Filecoin-blue.svg?style=flat-square)](https://filecoin.io/) [![ci](https://github.com/CheckerNetwork/app/actions/workflows/ci.yml/badge.svg)](https://github.com/CheckerNetwork/app/actions/workflows/ci.yml) -Station is a desktop app that connects your computer’s idle resources +Checker is a desktop app that connects your computer’s idle resources to the Filecoin network and rewards you with Filecoin. Taking part is simple, just launch the app and start earning. Learn more at -[filstation.app](https://filstation.app). +[checker.network](https://checker.network). ## Install diff --git a/docs/DEVELOPING.md b/docs/DEVELOPING.md index ed6421fbe..3415bcd8f 100644 --- a/docs/DEVELOPING.md +++ b/docs/DEVELOPING.md @@ -6,8 +6,8 @@ ```mermaid graph - fil-stat-repo(github.com/CheckerNetwork/app) --> fil-stat-main(Station main process) - fil-stat-repo --> fil-stat-webui(Station WebUI) + fil-stat-repo(github.com/CheckerNetwork/app) --> fil-stat-main(Checker main process) + fil-stat-repo --> fil-stat-webui(Checker WebUI) saturn-l2-repo(https://github.com/filecoin-project/saturn-l2) --> saturn-l2-go(Saturn L2 Node binary) diff --git a/docs/MODULE_INTERFACE.md b/docs/MODULE_INTERFACE.md index a80ebe05d..93a3179dd 100644 --- a/docs/MODULE_INTERFACE.md +++ b/docs/MODULE_INTERFACE.md @@ -1,11 +1,11 @@ -# Station module interface +# Checker module interface 1. A module itself is a long-running executable, which - performs its business logic - writes informative messages to `stdio` - exposes stats via a builtin webserver -1. A module needs to have its __binaries hosted__ on HTTPS accessible URLs, so that Station can download updates. Path patterns are flexible, GitHub Releases would be nice. +1. A module needs to have its __binaries hosted__ on HTTPS accessible URLs, so that Checker can download updates. Path patterns are flexible, GitHub Releases would be nice. Example: ``` @@ -38,8 +38,8 @@ 4. A module communicates activity by writing to its `stdout` stream: - `API: $1` The module has launched and `$1` can be queried for fetching module stats (see below) - - `INFO: $1` `$1` will be displayed to the user inside Station's Activity Log - - `ERROR: $1` `$1` will be displayed to the user inside Station's Activity Log, with a warning icon + - `INFO: $1` `$1` will be displayed to the user inside Checker's Activity Log + - `ERROR: $1` `$1` will be displayed to the user inside Checker's Activity Log, with a warning icon - `$1` all log lines will be stored in a module-specific log file, which can be submitted to Sentry for error handling 5. A module is expected to have provided its `API` URL in `<=500ms` @@ -61,8 +61,8 @@ the following fields: process restarts, somewhere in `ROOT_DIR`. The module may include additional fields in the JSON response, although - these will be ignored by Station. + these will be ignored by Checker. 7. A module can be told to shut down via signal `SIGTERM` -8. A module can shut down at any time, which is always considered an error. Its exit will be shown in Station's UI, and the last 100 lines of its output streams forwarded to Sentry. The module won't automatically be restarted by Station (for now). +8. A module can shut down at any time, which is always considered an error. Its exit will be shown in Checker's UI, and the last 100 lines of its output streams forwarded to Sentry. The module won't automatically be restarted by Checker (for now). diff --git a/main/config.js b/main/config.js index 414e08217..53a10040a 100644 --- a/main/config.js +++ b/main/config.js @@ -5,11 +5,11 @@ const Store = require('electron-store') const log = require('electron-log').scope('config') const ConfigKeys = { - OnboardingCompleted: 'station.OnboardingCompleted', - TrayOperationExplained: 'station.TrayOperationExplained', - StationID: 'station.StationID', - FilAddress: 'station.FilAddress', - DestinationFilAddress: 'station.DestinationFilAddress' + OnboardingCompleted: 'checker.OnboardingCompleted', + TrayOperationExplained: 'checker.TrayOperationExplained', + CheckerID: 'checker.CheckerID', + FilAddress: 'checker.FilAddress', + DestinationFilAddress: 'checker.DestinationFilAddress' } // Use this to test migrations @@ -18,6 +18,31 @@ const ConfigKeys = { const configStore = new Store({ migrations: { + '>x': store => { + const migration = [ + { + from: 'station.OnboardingCompleted', + to: ConfigKeys.OnboardingCompleted + }, { + from: 'station.TrayOperationExplained', + to: ConfigKeys.TrayOperationExplained + }, { + from: 'station.stationID', + to: ConfigKeys.CheckerID + }, { + from: 'station.FilAddress', + to: ConfigKeys.FilAddress + }, { + from: 'station.DestinationFilAddress', + to: ConfigKeys.DestinationFilAddress + } + ] + for (const { from, to } of migration) { + if (store.has(from)) { + store.set(to, store.get(from)) + } + } + }, '>=0.9.0': store => { if (store.has('station.onboardingCompleted')) { store.set( @@ -32,13 +57,13 @@ const configStore = new Store({ }, beforeEachMigration: (_, context) => { log.info( - `Migrating station-config from ${context.fromVersion} → ` + + `Migrating config from ${context.fromVersion} → ` + context.toVersion ) } }) -log.info('Loading Station configuration from', configStore.path) +log.info('Loading configuration from', configStore.path) let OnboardingCompleted = /** @type {boolean} */ diff --git a/main/index.js b/main/index.js index 1fe4ce38b..79d982151 100644 --- a/main/index.js +++ b/main/index.js @@ -91,7 +91,7 @@ if (!inTest && !app.requestSingleInstanceLock()) { app.quit() } -// When the user attempts to start the app and didn't notice the Station icon in +// When the user attempts to start the app and didn't notice the Checker icon in // the tray, help them out by showing the main window app.on('second-instance', () => { ctx.showUI() diff --git a/main/ipc.js b/main/ipc.js index b6288e74e..ea9cd348a 100644 --- a/main/ipc.js +++ b/main/ipc.js @@ -21,7 +21,7 @@ const ipcMainEvents = Object.freeze({ }) function setupIpcMain (/** @type {Context} */ ctx) { - // Station-wide config + // Checker-wide config ipcMain.handle( 'checker:getOnboardingCompleted', config.getOnboardingCompleted diff --git a/main/telemetry.js b/main/telemetry.js index 2e9e16f6d..9f0f88168 100644 --- a/main/telemetry.js +++ b/main/telemetry.js @@ -47,7 +47,7 @@ async function setup () { point.tag('platform', platform()) // `os.arch()` returns `x64` when running in a translated environment on // ARM64 machine, e.g. via macOS Rosetta. We don't provide Apple `arm64` - // builds yet. As a result, Stations running on Apple Silicon were reporting + // builds yet. As a result, Checkers running on Apple Silicon were reporting // `x64` arch. To fix the problem, we detect `arm64` translation and report // a different architecture. point.tag('arch', app?.runningUnderARM64Translation ? 'arm64' : arch()) diff --git a/main/tray.js b/main/tray.js index 6f7bbf1d2..c490c7cf1 100644 --- a/main/tray.js +++ b/main/tray.js @@ -52,7 +52,7 @@ const createContextMenu = (/** @type {Context} */ ctx) => { enabled: false }, { - label: 'Open Station', + label: 'Open Checker', click: () => ctx.showUI() }, { type: 'separator' }, @@ -77,7 +77,7 @@ const createContextMenu = (/** @type {Context} */ ctx) => { }, { type: 'separator' }, { - label: 'Quit Station', + label: 'Quit Checker', click: () => app.quit(), accelerator: IS_MAC ? 'Command+Q' : undefined } diff --git a/main/ui.js b/main/ui.js index 1f8c3390c..83acb9cd1 100644 --- a/main/ui.js +++ b/main/ui.js @@ -80,7 +80,7 @@ module.exports = async function (ctx) { if (app.dock) app.dock.show() ui.show() } - // We want the Station to start hidden in the tray. + // We want the Checker to start hidden in the tray. // However, when the user did not complete the onboarding flow, // we need to show the app to ask them to finish the setup process if (!getOnboardingCompleted()) { diff --git a/main/updater.js b/main/updater.js index fe583400a..a83b69f71 100644 --- a/main/updater.js +++ b/main/updater.js @@ -26,7 +26,7 @@ let nextVersion const store = new Store({ name: 'updater' }) function quitAndInstall () { - log.info('Restarting Station to install the new version') + log.info('Restarting Checker to install the new version') beforeQuitCleanup() store.set('upgradeToVersion', nextVersion) autoUpdater.quitAndInstall() @@ -202,7 +202,7 @@ function onUpdateDownloaded (ctx, { version /*, releaseNotes */ }) { if (checkingManually) { // when checking manually, show the dialog immediately showUpdateDialog() - // also don't trigger the automatic Station restart + // also don't trigger the automatic Checker restart // showUpdateDialog() offers the user to restart } else if (ctx.isShowingUI) { // show unobtrusive notification + dialog on click diff --git a/renderer/README.md b/renderer/README.md index d0839578d..cfbdd3ddd 100644 --- a/renderer/README.md +++ b/renderer/README.md @@ -1,3 +1,3 @@ # Renderer -This is the front-end application providing Station Shell UI. +This is the front-end application providing Checker Shell UI. diff --git a/renderer/src/components/Layout.tsx b/renderer/src/components/Layout.tsx index 8b3716edf..6d0d5a7fc 100644 --- a/renderer/src/components/Layout.tsx +++ b/renderer/src/components/Layout.tsx @@ -3,14 +3,12 @@ import Sidebar from 'src/components/Sidebar' import UpdateBanner from 'src/components/UpdateBanner' import WalletWidget from 'src/components/WalletWidget' import DraggableArea from 'src/components/DraggableArea' -import RebrandBanner from 'src/components/RebrandBanner' const Layout = ({ children }: {children: ReactNode}) => { return (
-
diff --git a/renderer/src/components/Onboarding.tsx b/renderer/src/components/Onboarding.tsx index 56c572574..5f5a0a8e7 100644 --- a/renderer/src/components/Onboarding.tsx +++ b/renderer/src/components/Onboarding.tsx @@ -64,7 +64,7 @@ const Onboarding: FC = ({ onFinish }) => {

- Station securely connects your computer to Filecoin's global peer-to-peer network, which + Checker securely connects your computer to Filecoin's global peer-to-peer network, which rewards you for your participation. Once you've connected, you will begin completing network jobs.

@@ -113,14 +113,14 @@ const Onboarding: FC = ({ onFinish }) => {

- Station asks for your consent to use your personal data to store and/or access information on a + Checker asks for your consent to use your personal data to store and/or access information on a device. Your personal data will be processed and information from your device (cookies, unique identifiers, and other device data) may be stored by, accessed by and shared with third party vendors, or used specifically by this app.

By clicking {'"'}Create Wallet{'"'} or otherwise continuing to use this service, you agree, you - have read, understand and accept Station's + have read, understand and accept Checker's {' '} { - const { pathname } = useLocation() - const [visible, setVisible] = useState(true) - - if (!visible) { - return null - } - - if (pathname === ROUTES.wallet) { - return null - } - - return ( -

-
- 🚨 Filecoin Station is becoming the Checker Network. - -
- -
- ) -} - -export default RebrandBanner diff --git a/renderer/src/components/Sentry.tsx b/renderer/src/components/Sentry.tsx index a61d4cfb6..991e59342 100644 --- a/renderer/src/components/Sentry.tsx +++ b/renderer/src/components/Sentry.tsx @@ -4,12 +4,12 @@ import * as Sentry from '@sentry/react' const SentryComponent = () => { useEffect(() => { // Disable Sentry integration for dev builds - if (window.electron.stationBuildVersion.endsWith('-dev')) { return } + if (window.electron.checkerBuildVersion.endsWith('-dev')) { return } Sentry.init({ dsn: 'https://8667b1c7749ae24e35ba531bffa3ed7a@o1408530.ingest.us.sentry.io/6762462', integrations: [Sentry.browserTracingIntegration()], - release: window.electron.stationBuildVersion, + release: window.electron.checkerBuildVersion, // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production diff --git a/renderer/src/components/UpdateBanner.tsx b/renderer/src/components/UpdateBanner.tsx index 9c12aa8f6..8f81ac79a 100644 --- a/renderer/src/components/UpdateBanner.tsx +++ b/renderer/src/components/UpdateBanner.tsx @@ -12,7 +12,7 @@ const UpdateBanner = () => { } reload() - const unsubscribeUpdateNotification = window.electron.stationEvents.onReadyToUpdate(() => { + const unsubscribeUpdateNotification = window.electron.events.onReadyToUpdate(() => { setIsReadyToUpdate(true) }) @@ -26,7 +26,7 @@ const UpdateBanner = () => {
- New version available: Station will update itself on next launch. + New version available: Checker will update itself on next launch.
diff --git a/renderer/src/components/WalletModal.tsx b/renderer/src/components/WalletModal.tsx index 7899fc387..fa0f41ff6 100644 --- a/renderer/src/components/WalletModal.tsx +++ b/renderer/src/components/WalletModal.tsx @@ -13,8 +13,8 @@ import TransactionStatusIndicator from './TransactionStatusIndicator' const WalletModal = () => { const { - stationAddress, - stationAddress0x, + walletAddress, + walletAddress0x, walletBalance, processingTransaction } = useWallet() @@ -32,14 +32,14 @@ const WalletModal = () => { - // Station address ... : + // Checker address ... :
-
-
+
+
diff --git a/renderer/src/hooks/Activity.tsx b/renderer/src/hooks/Activity.tsx index cf2109914..5ecb46629 100644 --- a/renderer/src/hooks/Activity.tsx +++ b/renderer/src/hooks/Activity.tsx @@ -5,11 +5,11 @@ import { } from 'src/lib/config' import { Activity } from 'src/typings' -interface StationActivity { +interface CheckerActivity { totalJobs: number; activities: Activity[] | []; } -const useStationActivity = (): StationActivity => { +const useCheckerActivity = (): CheckerActivity => { const [totalJobs, setTotalJobs] = useState(0) const [activities, setActivities] = useState([]) @@ -24,14 +24,14 @@ const useStationActivity = (): StationActivity => { }, []) useEffect(() => { - const unsubscribeOnJobProcessed = window.electron.stationEvents.onJobProcessed(setTotalJobs) + const unsubscribeOnJobProcessed = window.electron.events.onJobProcessed(setTotalJobs) return () => { unsubscribeOnJobProcessed() } }, []) useEffect(() => { - const unsubscribeOnActivityLogged = window.electron.stationEvents.onActivityLogged(activity => { + const unsubscribeOnActivityLogged = window.electron.events.onActivityLogged(activity => { setActivities(activities => { const updatedActivities = [activity, ...activities] updatedActivities.length = Math.min(updatedActivities.length, 100) @@ -46,4 +46,4 @@ const useStationActivity = (): StationActivity => { return { totalJobs, activities } } -export default useStationActivity +export default useCheckerActivity diff --git a/renderer/src/hooks/Rewards.tsx b/renderer/src/hooks/Rewards.tsx index 9eb2119a9..147d514f9 100644 --- a/renderer/src/hooks/Rewards.tsx +++ b/renderer/src/hooks/Rewards.tsx @@ -116,7 +116,7 @@ export function sumAllRewards (data: RewardsRecord['totalRewardsReceived']) { return Object.values(data).reduce((acc, val) => acc + val, 0n) } -const useStationRewards = () => { +const useCheckerRewards = () => { const wallet = useWallet() const [scheduledRewards, setScheduledRewards] = useState() const [historicalRewards, setHistoricalRewards] = useState([]) @@ -128,9 +128,9 @@ const useStationRewards = () => { useEffect(() => { async function loadStoredInfo () { - if (!wallet.stationAddress0x || document.hidden) return + if (!wallet.checkerAddress0x || document.hidden) return setHistoricalRewards( - await getHistoricalRewardsData(wallet.stationAddress0x) + await getHistoricalRewardsData(wallet.checkerAddress0x) ) } loadStoredInfo() @@ -140,7 +140,7 @@ const useStationRewards = () => { clearInterval(id) document.removeEventListener('visibilitychange', loadStoredInfo) } - }, [wallet.stationAddress0x]) + }, [wallet.checkerAddress0x]) useEffect(() => { async function loadStoredInfo () { @@ -154,10 +154,10 @@ const useStationRewards = () => { clearInterval(id) document.removeEventListener('visibilitychange', loadStoredInfo) } - }, [wallet.stationAddress0x]) + }, [wallet.checkerAddress0x]) useEffect(() => { - const unsubscribeOnScheduledRewardsUpdate = window.electron.stationEvents.onScheduledRewardsUpdate(balance => { + const unsubscribeOnScheduledRewardsUpdate = window.electron.checkerEvents.onScheduledRewardsUpdate(balance => { setScheduledRewards(formattedFilToBigInt(balance)) }) return () => { @@ -200,4 +200,4 @@ const useStationRewards = () => { } } -export default useStationRewards +export default useCheckerRewards diff --git a/renderer/src/hooks/Wallet.tsx b/renderer/src/hooks/Wallet.tsx index a1e98bd87..cbd76d8e5 100644 --- a/renderer/src/hooks/Wallet.tsx +++ b/renderer/src/hooks/Wallet.tsx @@ -2,9 +2,9 @@ import { useState, useEffect, useCallback, useRef } from 'react' import { getDestinationWalletAddress, setDestinationWalletAddress, - getStationWalletAddress, - getStationWalletBalance, - getStationWalletTransactionsHistory, + getCheckerWalletAddress, + getCheckerWalletBalance, + getCheckerWalletTransactionsHistory, transferAllFundsToDestinationWallet } from 'src/lib/config' import { @@ -16,8 +16,8 @@ import { import { ethAddressFromDelegated } from '@glif/filecoin-address' export interface Wallet { - stationAddress: string; - stationAddress0x: string; + checkerAddress: string; + checkerAddress0x: string; destinationFilAddress: string | undefined; walletBalance: string | undefined; walletTransactions: FILTransaction[] | undefined; @@ -28,7 +28,7 @@ export interface Wallet { } const useWallet = (): Wallet => { - const [stationAddress, setStationAddress] = useState('') + const [checkerAddress, setCheckerAddress] = useState('') const [destinationFilAddress, setDestinationFilAddress] = useState() const [walletBalance, setWalletBalance] = useState() const [walletTransactions, setWalletTransactions] = useState() @@ -87,21 +87,21 @@ const useWallet = (): Wallet => { useEffect(() => { const loadStoredInfo = async () => { - setStationAddress(await getStationWalletAddress()) + setCheckerAddress(await getCheckerWalletAddress()) } loadStoredInfo() - }, [stationAddress]) + }, [checkerAddress]) useEffect(() => { const loadStoredInfo = async () => { - setWalletBalance(await getStationWalletBalance()) + setWalletBalance(await getCheckerWalletBalance()) } loadStoredInfo() }, []) useEffect(() => { const loadStoredInfo = async () => { - setTransactions(await getStationWalletTransactionsHistory()) + setTransactions(await getCheckerWalletTransactionsHistory()) } loadStoredInfo() }, [setTransactions]) @@ -109,7 +109,7 @@ const useWallet = (): Wallet => { // Subscribe to events useEffect(() => { - const unsubscribeOnTransactionUpdate = window.electron.stationEvents.onTransactionUpdate( + const unsubscribeOnTransactionUpdate = window.electron.checkerEvents.onTransactionUpdate( setTransactions ) return () => { @@ -118,7 +118,7 @@ const useWallet = (): Wallet => { }, [setTransactions]) useEffect(() => { - const unsubscribeOnBalanceUpdate = window.electron.stationEvents.onBalanceUpdate(balance => { + const unsubscribeOnBalanceUpdate = window.electron.checkerEvents.onBalanceUpdate(balance => { setWalletBalance(balance) }) return () => { @@ -127,9 +127,9 @@ const useWallet = (): Wallet => { }, [walletBalance]) return { - stationAddress, - stationAddress0x: stationAddress !== '' - ? ethAddressFromDelegated(stationAddress) + checkerAddress, + checkerAddress0x: checkerAddress !== '' + ? ethAddressFromDelegated(checkerAddress) : '', destinationFilAddress, walletBalance, diff --git a/renderer/src/lib/config.tsx b/renderer/src/lib/config.tsx index ebb79084b..735bbb7e6 100644 --- a/renderer/src/lib/config.tsx +++ b/renderer/src/lib/config.tsx @@ -2,11 +2,11 @@ import { Activity, FILTransaction, FILTransactionProcessing } from 'src/typings' import pDebounce from 'p-debounce' export async function getOnboardingCompleted (): Promise { - return await window.electron.stationConfig.getOnboardingCompleted() + return await window.electron.checkerConfig.getOnboardingCompleted() } export async function setOnboardingCompleted (): Promise { - return await window.electron.stationConfig.setOnboardingCompleted() + return await window.electron.checkerConfig.setOnboardingCompleted() } export async function getActivities (): Promise { @@ -30,68 +30,68 @@ export function openReleaseNotes (): void { } export async function getDestinationWalletAddress (): Promise { - return await window.electron.stationConfig.getDestinationWalletAddress() + return await window.electron.checkerConfig.getDestinationWalletAddress() } export async function setDestinationWalletAddress (address: string | undefined): Promise { - return await window.electron.stationConfig.setDestinationWalletAddress(address) + return await window.electron.checkerConfig.setDestinationWalletAddress(address) } -export async function getStationWalletAddress (): Promise { - return await window.electron.stationConfig.getStationWalletAddress() +export async function getCheckerWalletAddress (): Promise { + return await window.electron.checkerConfig.getCheckerWalletAddress() } -export async function getStationWalletBalance (): Promise { - return await window.electron.stationConfig.getStationWalletBalance() +export async function getCheckerWalletBalance (): Promise { + return await window.electron.checkerConfig.getCheckerWalletBalance() } -export const getStationWalletTransactionsHistory = pDebounce( +export const getCheckerWalletTransactionsHistory = pDebounce( async function (): Promise<(FILTransaction|FILTransactionProcessing)[]> { - return await window.electron.stationConfig.getStationWalletTransactionsHistory() + return await window.electron.checkerConfig.getCheckerWalletTransactionsHistory() }, 0 ) export async function transferAllFundsToDestinationWallet (): Promise { - return await window.electron.stationConfig.transferAllFundsToDestinationWallet() + return await window.electron.checkerConfig.transferAllFundsToDestinationWallet() } export function browseTransactionTracker (transactionHash: string): void { - return window.electron.stationConfig.openExternalURL(`https://beryx.zondax.ch/v1/search/fil/mainnet/address/${transactionHash}`) + return window.electron.checkerConfig.openExternalURL(`https://beryx.zondax.ch/v1/search/fil/mainnet/address/${transactionHash}`) } export function openExternalURL (url: string): void { - return window.electron.stationConfig.openExternalURL(url) + return window.electron.checkerConfig.openExternalURL(url) } export function openBeryx (): void { - return window.electron.stationConfig.openExternalURL('https://beryx.io/') + return window.electron.checkerConfig.openExternalURL('https://beryx.io/') } export function showTermsOfService (): void { - return window.electron.stationConfig.openExternalURL('https://pl-strflt.notion.site/Station-Terms-Conditions-e97da76bb89f49e280c2897aebe4c41f?pvs=4') + return window.electron.checkerConfig.openExternalURL('https://pl-strflt.notion.site/Station-Terms-Conditions-e97da76bb89f49e280c2897aebe4c41f?pvs=4') } export function openDocsLink () { - return window.electron.stationConfig.openExternalURL('https://docs.filstation.app/your-station-wallet') + return window.electron.checkerConfig.openExternalURL('https://docs.filstation.app/your-station-wallet') } export function toggleOpenAtLogin () { - return window.electron.stationConfig.toggleOpenAtLogin() + return window.electron.checkerConfig.toggleOpenAtLogin() } export function isOpenAtLogin () { - return window.electron.stationConfig.isOpenAtLogin() + return window.electron.checkerConfig.isOpenAtLogin() } export function exportSeedPhrase () { - return window.electron.stationConfig.exportSeedPhrase() + return window.electron.checkerConfig.exportSeedPhrase() } export function saveModuleLogsAs () { - return window.electron.stationConfig.saveModuleLogsAs() + return window.electron.checkerConfig.saveModuleLogsAs() } export function checkForUpdates () { - return window.electron.stationConfig.checkForUpdates() + return window.electron.checkerConfig.checkForUpdates() } diff --git a/renderer/src/pages/wallet/TransferWrapper.tsx b/renderer/src/pages/wallet/TransferWrapper.tsx index e2e407426..735a92a28 100644 --- a/renderer/src/pages/wallet/TransferWrapper.tsx +++ b/renderer/src/pages/wallet/TransferWrapper.tsx @@ -11,7 +11,7 @@ import { openDocsLink } from 'src/lib/config' const SEND_THRESHOLD = 0.01 const TransferWrapper = ({ - stationAddress, + checkerAddress, destinationFilAddress, processingTransaction, walletBalance, @@ -20,7 +20,7 @@ const TransferWrapper = ({ }: { walletBalance: Wallet['walletBalance']; destinationFilAddress?: Wallet['destinationFilAddress']; - stationAddress?: Wallet['stationAddress']; + checkerAddress?: Wallet['checkerAddress']; processingTransaction: Wallet['processingTransaction']; editDestinationAddress: Wallet['editDestinationAddress']; transferAllFundsToDestinationWallet: Wallet['transferAllFundsToDestinationWallet']; @@ -45,7 +45,7 @@ const TransferWrapper = ({ destinationFilAddress={destinationFilAddress} processingTransaction={processingTransaction} /> - {stationAddress && ( + {checkerAddress && ( <> { const { walletBalance, - stationAddress, - stationAddress0x, + checkerAddress, + checkerAddress0x, walletTransactions, destinationFilAddress, editDestinationAddress, @@ -31,12 +31,12 @@ const Wallet = () => { // Station address ... :
-
-
+
+
@@ -49,7 +49,7 @@ const Wallet = () => { destinationFilAddress={destinationFilAddress} editDestinationAddress={editDestinationAddress} transferAllFundsToDestinationWallet={transferAllFundsToDestinationWallet} - stationAddress={stationAddress} + checkerAddress={checkerAddress} processingTransaction={processingTransaction} /> diff --git a/renderer/src/test/dashboard.test.tsx b/renderer/src/test/dashboard.test.tsx index 3fd2d3f44..70d549413 100644 --- a/renderer/src/test/dashboard.test.tsx +++ b/renderer/src/test/dashboard.test.tsx @@ -5,9 +5,9 @@ import { getActivities, getDestinationWalletAddress, getScheduledRewards, - getStationWalletAddress, - getStationWalletBalance, - getStationWalletTransactionsHistory + getCheckerWalletAddress, + getCheckerWalletBalance, + getCheckerWalletTransactionsHistory } from 'src/lib/config' import Dashboard from 'src/pages/dashboard/Dashboard' import useWallet from 'src/hooks/Wallet' @@ -20,7 +20,7 @@ import { useEffect, useState } from 'react' vi.mock('src/hooks/StationWallet') vi.mock('src/hooks/StationActivity') vi.mock('src/hooks/StationRewards') -vi.mock('src/lib/station-config') +vi.mock('src/lib/checker-config') stubGlobalElectron() @@ -31,9 +31,9 @@ describe('Dashboard page', () => { describe('Unpopulated', () => { beforeAll(() => { - vi.mocked(getStationWalletBalance).mockReturnValue(Promise.resolve('0')) - vi.mocked(getStationWalletTransactionsHistory).mockReturnValue(Promise.resolve([])) - vi.mocked(getStationWalletAddress).mockReturnValue( + vi.mocked(getCheckerWalletBalance).mockReturnValue(Promise.resolve('0')) + vi.mocked(getCheckerWalletTransactionsHistory).mockReturnValue(Promise.resolve([])) + vi.mocked(getCheckerWalletAddress).mockReturnValue( Promise.resolve('f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa') ) vi.mocked(getDestinationWalletAddress).mockReturnValue(Promise.resolve('')) @@ -43,8 +43,8 @@ describe('Dashboard page', () => { beforeEach(() => { vi.mocked(useWallet).mockReturnValue({ - stationAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', - stationAddress0x: '0x000000000000000000000000000000000000dEaD', + checkerAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', + checkerAddress0x: '0x000000000000000000000000000000000000dEaD', destinationFilAddress: '', walletBalance: '0', walletTransactions: [], @@ -85,8 +85,8 @@ describe('Dashboard page', () => { vi.useFakeTimers() vi.mocked(useWallet).mockReturnValue({ - stationAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', - stationAddress0x: '0x000000000000000000000000000000000000dEaD', + checkerAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', + checkerAddress0x: '0x000000000000000000000000000000000000dEaD', destinationFilAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellfff2rg', walletBalance: '0', walletTransactions: [], diff --git a/renderer/src/test/helpers.tsx b/renderer/src/test/helpers.tsx index 9c5b91151..77d7ef101 100644 --- a/renderer/src/test/helpers.tsx +++ b/renderer/src/test/helpers.tsx @@ -8,7 +8,7 @@ import { vi } from 'vitest' export function stubGlobalElectron () { vi.stubGlobal('electron', { - stationEvents: { + checkerEvents: { onActivityLogged: vi.fn(), onEarningsChanged: vi.fn(), onJobProcessed: vi.fn(), diff --git a/renderer/src/test/onboarding.test.tsx b/renderer/src/test/onboarding.test.tsx index c0233e5b7..9281af7ee 100644 --- a/renderer/src/test/onboarding.test.tsx +++ b/renderer/src/test/onboarding.test.tsx @@ -11,7 +11,7 @@ const mocks = vi.hoisted(() => { } }) -vi.mock('src/lib/station-config') +vi.mock('src/lib/checker-config') vi.mock('react-router', async () => { const router = await vi.importActual('react-router') diff --git a/renderer/src/test/settings.test.tsx b/renderer/src/test/settings.test.tsx index 9ff6a152a..2e742477c 100644 --- a/renderer/src/test/settings.test.tsx +++ b/renderer/src/test/settings.test.tsx @@ -3,7 +3,7 @@ import { checkForUpdates, exportSeedPhrase, isOpenAtLogin, saveModuleLogsAs } fr import Settings from 'src/pages/settings/Settings' import { describe, expect, test, vi } from 'vitest' -vi.mock('src/lib/station-config') +vi.mock('src/lib/checker-config') const mocks = vi.hoisted(() => { return { diff --git a/renderer/src/test/wallet-modal.test.tsx b/renderer/src/test/wallet-modal.test.tsx index 6ae7c6bc5..0eff7b21f 100644 --- a/renderer/src/test/wallet-modal.test.tsx +++ b/renderer/src/test/wallet-modal.test.tsx @@ -10,10 +10,10 @@ import { renderApp, stubGlobalElectron } from './helpers' const mockedSetDestinationWalletAddress = vi.fn() -vi.mock('src/lib/station-config', () => ({ - getStationWalletBalance: () => Promise.resolve(0), - getStationWalletTransactionsHistory: () => Promise.resolve([]), - getStationWalletAddress: () => Promise.resolve('f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa'), +vi.mock('src/lib/checker-config', () => ({ + getCheckerWalletBalance: () => Promise.resolve(0), + getCheckerWalletTransactionsHistory: () => Promise.resolve([]), + getCheckerWalletAddress: () => Promise.resolve('f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa'), getDestinationWalletAddress: () => Promise.resolve(''), setDestinationWalletAddress: () => mockedSetDestinationWalletAddress, getScheduledRewards: () => Promise.resolve('0.0'), @@ -31,8 +31,8 @@ describe('Dashboard wallet display', () => { vi.clearAllMocks() vi.mocked(useWallet).mockReturnValue({ - stationAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', - stationAddress0x: '0x000000000000000000000000000000000000dEaD', + checkerAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', + checkerAddress0x: '0x000000000000000000000000000000000000dEaD', destinationFilAddress: '', walletBalance: '0', walletTransactions: [], diff --git a/renderer/src/test/wallet.test.tsx b/renderer/src/test/wallet.test.tsx index cc5ab44fb..6942a755d 100644 --- a/renderer/src/test/wallet.test.tsx +++ b/renderer/src/test/wallet.test.tsx @@ -17,8 +17,8 @@ describe('Transfer page', () => { describe('Wallet info', () => { beforeEach(() => { vi.mocked(useWallet).mockReturnValue({ - stationAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', - stationAddress0x: '0x000000000000000000000000000000000000dEaD', + checkerAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', + checkerAddress0x: '0x000000000000000000000000000000000000dEaD', destinationFilAddress: '', walletBalance: '0', walletTransactions: [], @@ -47,8 +47,8 @@ describe('Transfer page', () => { } return { - stationAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', - stationAddress0x: '0x000000000000000000000000000000000000dEaD', + checkerAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', + checkerAddress0x: '0x000000000000000000000000000000000000dEaD', destinationFilAddress, walletBalance: '0', walletTransactions: [], @@ -108,8 +108,8 @@ describe('Transfer page', () => { }, []) return { - stationAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', - stationAddress0x: '0x000000000000000000000000000000000000dEaD', + checkerAddress: 'f16m5slrkc6zumruuhdzn557a5sdkbkiellron4qa', + checkerAddress0x: '0x000000000000000000000000000000000000dEaD', destinationFilAddress: '0x000000000000000000000000000000000000dEaD', walletBalance: balance, walletTransactions: [], diff --git a/test/e2e/app-launch.e2e.test.js b/test/e2e/app-launch.e2e.test.js index ceecdb0c3..8f791c6e9 100644 --- a/test/e2e/app-launch.e2e.test.js +++ b/test/e2e/app-launch.e2e.test.js @@ -23,8 +23,8 @@ test.describe.serial('Application launch', async () => { test.slow() // Launch Electron app against sandbox fake HOME dir - const stationRootDir = tmp.dirSync({ - prefix: 'station-', + const checkerRootDir = tmp.dirSync({ + prefix: 'checker-', unsafeCleanup: true }).name electronApp = await electron.launch({ @@ -32,7 +32,7 @@ test.describe.serial('Application launch', async () => { env: { ...process.env, NODE_ENV: 'test', - STATION_ROOT: stationRootDir, + CHECKER_ROOT: checkerRootDir, DISABLE_KEYTAR: 'true' }, timeout: 30000 * TIMEOUT_MULTIPLIER