From 32baa6694a7d0e1fe49ca9f9724cf4ace5995ccc Mon Sep 17 00:00:00 2001 From: Satoshi Qazi Muhammed Date: Mon, 12 Oct 2026 10:17:18 +0400 Subject: [PATCH] Remove the local fork "Fork Locally" ran the selected chain in the browser through @acala-network/chopsticks-core, which brings its own @polkadot stack (types, rpc-provider, util-crypto 13 and 14) and @polkadot/wasm-crypto 7.5.4 with the crate versions pezkuwi-wasm 7.5.21 moved off. The app shipped that second wasm twice, next to ours, for a developer tool; chopsticks itself stays available from the command line. Gone: the button, the overlay, the "Local" mock-account modal and the chopsticks account group, the fork path in the API context, and their 69 locale strings. Mock accounts a fork left in a browser's keyring are address-only; they now show with the test accounts. yarn.lock: 32 @polkadot and 2 @acala-network entries -> 0. --- packages/apps/package.json | 1 - .../apps/public/locales/ckb/translation.json | 10 - .../apps/public/locales/en/app-accounts.json | 8 - packages/apps/public/locales/en/apps.json | 2 - .../apps/public/locales/en/translation.json | 10 - .../apps/public/locales/fa/translation.json | 10 - .../apps/public/locales/id/translation.json | 8 - .../apps/public/locales/ku/translation.json | 10 - .../apps/public/locales/tr/translation.json | 10 - .../apps/public/locales/zh/translation.json | 1 - packages/apps/src/Endpoints/index.tsx | 74 +- packages/apps/src/overlays/Bottom.tsx | 2 - packages/apps/src/overlays/LocalFork.tsx | 46 - packages/page-accounts/src/Accounts/index.tsx | 30 +- .../page-accounts/src/modals/LocalAdd.tsx | 107 --- packages/react-api/src/Api.tsx | 58 +- packages/react-api/src/types.ts | 3 - .../src/util/getAccountCryptoType.ts | 4 +- packages/react-hooks/src/ctx/types.ts | 3 - yarn.lock | 792 +----------------- 20 files changed, 35 insertions(+), 1154 deletions(-) delete mode 100644 packages/apps/src/overlays/LocalFork.tsx delete mode 100644 packages/page-accounts/src/modals/LocalAdd.tsx diff --git a/packages/apps/package.json b/packages/apps/package.json index 370f143..d548f04 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -16,7 +16,6 @@ "type": "module", "version": "1.0.2-1-x", "dependencies": { - "@acala-network/chopsticks-core": "^1.2.1", "@pezkuwi/apps-config": "^1.0.2-1-x", "@pezkuwi/apps-routing": "^1.0.2-1-x", "@pezkuwi/dev": "^0.86.8", diff --git a/packages/apps/public/locales/ckb/translation.json b/packages/apps/public/locales/ckb/translation.json index dfea684..3457bb6 100644 --- a/packages/apps/public/locales/ckb/translation.json +++ b/packages/apps/public/locales/ckb/translation.json @@ -46,7 +46,6 @@ "Active nominations ({{count}})": "", "Add": "", "Add Bounty": "", - "Add a mock account to chopsticks": "", "Add account via Ledger": "", "Add account via Qr": "", "Add an account via seed {{step}}/{{STEPS_COUNT}}": "", @@ -97,7 +96,6 @@ "Announcements ({{count}})": "", "Any account can request payout for stakers, this is not limited to accounts that will be rewarded.": "", "Any account set as proxy will be able to perform actions in place of the proxied account": "", - "Any address, this can override other accounts": "", "Any combination of the four options may be approved of by the voter. There is no need to select only one option!": "", "Any democracy vote performed by the delegated account will result in an additional vote from the delegating account": "", "Application of slashes from era {{id}}": "", @@ -319,7 +317,6 @@ "Forget": "", "Forget this account": "", "Forget this address": "", - "Fork Locally": "", "Forks": "", "Free balance": "", "From JSON": "", @@ -384,8 +381,6 @@ "Lifetime (# of blocks)": "", "Light theme": "", "Loading": "", - "Local": "", - "Local fork powered by ": "", "Locked funds (e.g. for staking) are counted.": "", "Locked1x": "", "Locked2x": "", @@ -928,7 +923,6 @@ "The minimum balance allowed for the asset.": "", "The minimum balance for the asset. This is specified in the units and decimals as requested.": "", "The moment of enactment, either at a specific block, or after a specific number of blocks.": "", - "The name for this account": "", "The name for this account and how it will appear under your addresses. With an on-chain identity, it can be made available to others.": "", "The name for this account as it will appear under your accounts.": "", "The name for this teyrchain, the id and the allocated/requested balance.": "", @@ -1329,7 +1323,6 @@ "chain specifications": "", "challenge": "", "children": "", - "chopsticks": "", "claim to account": "", "claimable": "", "click to copy": "", @@ -1452,7 +1445,6 @@ "dissolve crowdloan": "", "do not include empty strings in the generated file": "", "does not appear to have a valid claim. Please double check that you have signed the transaction correctly on the correct ETH account.": "", - "e.g. 5Gg3...": "", "ed25519, Edwards": "", "elapsed": "", "elected stake": "", @@ -1602,8 +1594,6 @@ "lifetime": "", "link": "", "links": "", - "local account name": "", - "local accounts added via chopsticks fork": "", "lock": "", "lock expired": "", "lock periods": "", diff --git a/packages/apps/public/locales/en/app-accounts.json b/packages/apps/public/locales/en/app-accounts.json index e9191fd..713eeef 100644 --- a/packages/apps/public/locales/en/app-accounts.json +++ b/packages/apps/public/locales/en/app-accounts.json @@ -14,7 +14,6 @@ "Account type {{index}}": "Account type {{index}}", "Accounts injected from any of these extensions will appear in this application and be available for use. The above list is updated as more extensions with external signing capability become available.": "Accounts injected from any of these extensions will appear in this application and be available for use. The above list is updated as more extensions with external signing capability become available.", "Add": "Add", - "Add a mock account to chopsticks": "Add a mock account to chopsticks", "Add account via Ledger": "Add account via Ledger", "Add account via Qr": "Add account via Qr", "Add an account via seed {{step}}/{{STEPS_COUNT}}": "Add an account via seed {{step}}/{{STEPS_COUNT}}", @@ -28,7 +27,6 @@ "After Asset Hub migration, all funds have been moved to Asset Hub. Please switch to the ": "After Asset Hub migration, all funds have been moved to Asset Hub. Please switch to the ", "An encrypted backup file will be created once you have pressed the \"Download\" button. This can be used to re-import your account on any other machine.": "An encrypted backup file will be created once you have pressed the \"Download\" button. This can be used to re-import your account on any other machine.", "Any account set as proxy will be able to perform actions in place of the proxied account": "Any account set as proxy will be able to perform actions in place of the proxied account", - "Any address, this can override other accounts": "Any address, this can override other accounts", "Any democracy vote performed by the delegated account will result in an additional vote from the delegating account": "Any democracy vote performed by the delegated account will result in an additional vote from the delegating account", "Approve this call hash": "Approve this call hash", "Asset Hub chain": "Asset Hub chain", @@ -83,7 +81,6 @@ "It is recommended that you create/store your accounts securely and externally from the app. On {{yourBrowser}} the following browser extensions are available for use -": "It is recommended that you create/store your accounts securely and externally from the app. On {{yourBrowser}} the following browser extensions are available for use -", "Learn more...": "Learn more...", "Ledger app type (originated from)": "Ledger app type (originated from)", - "Local": "Local", "Make recoverable": "Make recoverable", "Manage delegation": "Manage delegation", "Manage proxies": "Manage proxies", @@ -155,7 +152,6 @@ "The helpers should be able to verify, via an off-chain mechanism, that the account owner indeed wishes to recover access and as such provide any approvals. In the cases of malicious recovery procedures, they will have the power to stop it.": "The helpers should be able to verify, via an off-chain mechanism, that the account owner indeed wishes to recover access and as such provide any approvals. In the cases of malicious recovery procedures, they will have the power to stop it.", "The local name for this account. Changing this does not affect your on-line identity, so this is only used to indicate the name of the account locally.": "The local name for this account. Changing this does not affect your on-line identity, so this is only used to indicate the name of the account locally.", "The maximum amount you can delegate is the amount of funds available on the delegating account.": "The maximum amount you can delegate is the amount of funds available on the delegating account.", - "The name for this account": "The name for this account", "The name for this account and how it will appear under your addresses. With an on-chain identity, it can be made available to others.": "The name for this account and how it will appear under your addresses. With an on-chain identity, it can be made available to others.", "The name for this account as it will appear under your accounts.": "The name for this account as it will appear under your accounts.", "The name is for unique identification of the account in your owner lists.": "The name is for unique identification of the account in your owner lists.", @@ -225,7 +221,6 @@ "bonded": "bonded", "call data for final approval": "call data for final approval", "case sensitive": "case sensitive", - "chopsticks": "chopsticks", "conviction": "conviction", "created account": "created account", "created multisig": "created multisig", @@ -243,7 +238,6 @@ "development seed": "development seed", "discord": "discord", "display name": "display name", - "e.g. 5Gg3...": "e.g. 5Gg3...", "email": "email", "ethereum private key": "ethereum private key", "export all accounts": "export all accounts", @@ -257,8 +251,6 @@ "keypair crypto type": "keypair crypto type", "keypair type": "keypair type", "legal name": "legal name", - "local account name": "local account name", - "local accounts added via chopsticks fork": "local accounts added via chopsticks fork", "matches": "matches", "matrix name": "matrix name", "mnemonic": "mnemonic", diff --git a/packages/apps/public/locales/en/apps.json b/packages/apps/public/locales/en/apps.json index 9e313f9..3abb4a2 100644 --- a/packages/apps/public/locales/en/apps.json +++ b/packages/apps/public/locales/en/apps.json @@ -2,10 +2,8 @@ "Accounts": "Accounts", "Developer": "Developer", "Files": "Files", - "Fork Locally": "Fork Locally", "Governance": "Governance", "Initializing connection": "Initializing connection", - "Local fork powered by ": "Local fork powered by ", "Network": "Network", "Relay chain": "Relay chain", "Settings": "Settings", diff --git a/packages/apps/public/locales/en/translation.json b/packages/apps/public/locales/en/translation.json index dfea684..3457bb6 100644 --- a/packages/apps/public/locales/en/translation.json +++ b/packages/apps/public/locales/en/translation.json @@ -46,7 +46,6 @@ "Active nominations ({{count}})": "", "Add": "", "Add Bounty": "", - "Add a mock account to chopsticks": "", "Add account via Ledger": "", "Add account via Qr": "", "Add an account via seed {{step}}/{{STEPS_COUNT}}": "", @@ -97,7 +96,6 @@ "Announcements ({{count}})": "", "Any account can request payout for stakers, this is not limited to accounts that will be rewarded.": "", "Any account set as proxy will be able to perform actions in place of the proxied account": "", - "Any address, this can override other accounts": "", "Any combination of the four options may be approved of by the voter. There is no need to select only one option!": "", "Any democracy vote performed by the delegated account will result in an additional vote from the delegating account": "", "Application of slashes from era {{id}}": "", @@ -319,7 +317,6 @@ "Forget": "", "Forget this account": "", "Forget this address": "", - "Fork Locally": "", "Forks": "", "Free balance": "", "From JSON": "", @@ -384,8 +381,6 @@ "Lifetime (# of blocks)": "", "Light theme": "", "Loading": "", - "Local": "", - "Local fork powered by ": "", "Locked funds (e.g. for staking) are counted.": "", "Locked1x": "", "Locked2x": "", @@ -928,7 +923,6 @@ "The minimum balance allowed for the asset.": "", "The minimum balance for the asset. This is specified in the units and decimals as requested.": "", "The moment of enactment, either at a specific block, or after a specific number of blocks.": "", - "The name for this account": "", "The name for this account and how it will appear under your addresses. With an on-chain identity, it can be made available to others.": "", "The name for this account as it will appear under your accounts.": "", "The name for this teyrchain, the id and the allocated/requested balance.": "", @@ -1329,7 +1323,6 @@ "chain specifications": "", "challenge": "", "children": "", - "chopsticks": "", "claim to account": "", "claimable": "", "click to copy": "", @@ -1452,7 +1445,6 @@ "dissolve crowdloan": "", "do not include empty strings in the generated file": "", "does not appear to have a valid claim. Please double check that you have signed the transaction correctly on the correct ETH account.": "", - "e.g. 5Gg3...": "", "ed25519, Edwards": "", "elapsed": "", "elected stake": "", @@ -1602,8 +1594,6 @@ "lifetime": "", "link": "", "links": "", - "local account name": "", - "local accounts added via chopsticks fork": "", "lock": "", "lock expired": "", "lock periods": "", diff --git a/packages/apps/public/locales/fa/translation.json b/packages/apps/public/locales/fa/translation.json index dfea684..3457bb6 100644 --- a/packages/apps/public/locales/fa/translation.json +++ b/packages/apps/public/locales/fa/translation.json @@ -46,7 +46,6 @@ "Active nominations ({{count}})": "", "Add": "", "Add Bounty": "", - "Add a mock account to chopsticks": "", "Add account via Ledger": "", "Add account via Qr": "", "Add an account via seed {{step}}/{{STEPS_COUNT}}": "", @@ -97,7 +96,6 @@ "Announcements ({{count}})": "", "Any account can request payout for stakers, this is not limited to accounts that will be rewarded.": "", "Any account set as proxy will be able to perform actions in place of the proxied account": "", - "Any address, this can override other accounts": "", "Any combination of the four options may be approved of by the voter. There is no need to select only one option!": "", "Any democracy vote performed by the delegated account will result in an additional vote from the delegating account": "", "Application of slashes from era {{id}}": "", @@ -319,7 +317,6 @@ "Forget": "", "Forget this account": "", "Forget this address": "", - "Fork Locally": "", "Forks": "", "Free balance": "", "From JSON": "", @@ -384,8 +381,6 @@ "Lifetime (# of blocks)": "", "Light theme": "", "Loading": "", - "Local": "", - "Local fork powered by ": "", "Locked funds (e.g. for staking) are counted.": "", "Locked1x": "", "Locked2x": "", @@ -928,7 +923,6 @@ "The minimum balance allowed for the asset.": "", "The minimum balance for the asset. This is specified in the units and decimals as requested.": "", "The moment of enactment, either at a specific block, or after a specific number of blocks.": "", - "The name for this account": "", "The name for this account and how it will appear under your addresses. With an on-chain identity, it can be made available to others.": "", "The name for this account as it will appear under your accounts.": "", "The name for this teyrchain, the id and the allocated/requested balance.": "", @@ -1329,7 +1323,6 @@ "chain specifications": "", "challenge": "", "children": "", - "chopsticks": "", "claim to account": "", "claimable": "", "click to copy": "", @@ -1452,7 +1445,6 @@ "dissolve crowdloan": "", "do not include empty strings in the generated file": "", "does not appear to have a valid claim. Please double check that you have signed the transaction correctly on the correct ETH account.": "", - "e.g. 5Gg3...": "", "ed25519, Edwards": "", "elapsed": "", "elected stake": "", @@ -1602,8 +1594,6 @@ "lifetime": "", "link": "", "links": "", - "local account name": "", - "local accounts added via chopsticks fork": "", "lock": "", "lock expired": "", "lock periods": "", diff --git a/packages/apps/public/locales/id/translation.json b/packages/apps/public/locales/id/translation.json index 6e13e97..a9ccd14 100644 --- a/packages/apps/public/locales/id/translation.json +++ b/packages/apps/public/locales/id/translation.json @@ -41,7 +41,6 @@ "Accounts injected from any of these extensions will appear in this application and be available for use. The above list is updated as more extensions with external signing capability become available.": "Akun terinjeksi dari salah satu eksistensi ini akan muncul di aplikasi dan dapat digunakan. Daftar diatas diperbaharui karena lebih banyak ekstensi dengan tersedia kemampuan penandangan eksternal.", "Active nominations ({{count}})": "Nominasi aktif ({{count}})", "Add": "Tambahkan", - "Add a mock account to chopsticks": "Tambahkan akun tiruan ke sumpit", "Add a tip to this extrinsic, paying the block author for greater priority": "Tambahkan tip ke ekstrinsik ini, membayar penulis blok untuk prioritas yang lebih besar", "Add account": "Tambahkan akun", "Add account via Ledger": "Tambah akun melalui Ledger", @@ -77,7 +76,6 @@ "An encrypted backup file will be created once you have pressed the \"Download\" button. This can be used to re-import your account on any other machine.": "File cadangan terenkripsi akan dibuat setelah Anda menekan tombol \"Unduh\". Ini dapat digunakan untuk mengimpor ulang akun anda di mesin mana pun.", "Any account can request payout for stakers, this is not limited to accounts that will be rewarded.": "Akun apa pun dapat meminta pembayaran untuk pemegang taruhan, ini tidak terbatas pada akun yang akan diberi hadiah.", "Any account set as proxy will be able to perform actions in place of the proxied account": "Setiap akun yang ditetapkan sebagai proxy akan dapat melakukan tindakan sebagai pengganti akun yang diproksikan", - "Any address, this can override other accounts": "Alamat mana pun, ini dapat menggantikan akun lain.", "Any combination of the four options may be approved of by the voter. There is no need to select only one option!": "Kombinasi dari keempat opsi tersebut dapat disetujui oleh pemilih. Tidak perlu hanya memilih satu opsi!", "Any democracy vote performed by the delegated account will result in an additional vote from the delegating account": "Setiap pemungutan suara demokrasi yang dilakukan oleh akun yang didelegasikan akan menghasilkan suara tambahan dari akun yang didelegasikan", "Application of slashes from era {{id}}": "Penerapan slash dari era {{id}}", @@ -287,7 +285,6 @@ "Lifetime (# of blocks)": "Usia (# pada blok)", "Light theme (default)": "Tema Terang (default)", "Loading": "Memuat", - "Local": "Lokal", "Locked funds (e.g. for staking) are counted.": "Dana yang terkunci (misalnya untuk staking) dihitung.", "Locked1x": "Kunci1x", "Locked2x": "Kunci2x", @@ -762,7 +759,6 @@ "The minimum number of committee votes required to approve this motion": "Jumlah minimum suara komite yang diperlukan untuk menyetujui mosi ini", "The minimum number of council votes required to approve this motion": "Jumlah minimum suara dewan yang diperlukan untuk menyetujui mosi ini", "The multisig signatory for this transaction.": "Penandatangan multisig untuk transaksi ini.", - "The name for this account": "Nama untuk akun ini", "The name for this account and how it will appear under your addresses. With an on-chain identity, it can be made available to others.": "Nama untuk akun ini dan tampilannya di bawah alamat anda. Dengan identitas on-chain, itu dapat tersedia untuk yang lain.", "The name for this account as it will appear under your accounts.": "Nama untuk akun ini seperti yang akan muncul di bawah akun Anda.", "The name is for unique identification of the account in your owner lists.": "Nama ini untuk identifikasi akun unik dalam daftar pemilik anda.", @@ -1063,7 +1059,6 @@ "candidates": "kandidat", "case sensitive": "kepekaan kapital", "challenge": "tantangan", - "chopsticks": "sumpit", "claim to account": "klaim kepada akun", "click to copy": "klik untuk salin", "click to select or drag and drop a JSON ABI file": "klik untuk memilih atau drag dan drop berkas JSON ABI", @@ -1122,7 +1117,6 @@ "display name": "nama tampilan", "do not include empty strings in the generated file": "jangan menyertakan string kosong di file yang dihasilkan", "does not appear to have a valid claim. Please double check that you have signed the transaction correctly on the correct ETH account.": "tampaknya tidak memiliki klaim yang valid. Harap periksa kembali apakah anda telah menandatangani transaksi dengan benar di akun ETH yang benar.", - "e.g. 5Gg3...": "cth. 5Gg3...", "ed25519, Edwards": "ed25519, Edwards", "elected stake": "stake terpilih", "email": "email", @@ -1192,8 +1186,6 @@ "legal name": "nama resmi", "lifetime": "seumur hidup", "lng.detect": "Default bahasa browser (otomatis-deteksi)", - "local account name": "nama akun lokal", - "local accounts added via chopsticks fork": "akun lokal ditambahkan melalui fork chopsticks", "lock expired": "kunci kadaluarsa", "locked": "terkunci", "locked balance": "kunci saldo", diff --git a/packages/apps/public/locales/ku/translation.json b/packages/apps/public/locales/ku/translation.json index dfea684..3457bb6 100644 --- a/packages/apps/public/locales/ku/translation.json +++ b/packages/apps/public/locales/ku/translation.json @@ -46,7 +46,6 @@ "Active nominations ({{count}})": "", "Add": "", "Add Bounty": "", - "Add a mock account to chopsticks": "", "Add account via Ledger": "", "Add account via Qr": "", "Add an account via seed {{step}}/{{STEPS_COUNT}}": "", @@ -97,7 +96,6 @@ "Announcements ({{count}})": "", "Any account can request payout for stakers, this is not limited to accounts that will be rewarded.": "", "Any account set as proxy will be able to perform actions in place of the proxied account": "", - "Any address, this can override other accounts": "", "Any combination of the four options may be approved of by the voter. There is no need to select only one option!": "", "Any democracy vote performed by the delegated account will result in an additional vote from the delegating account": "", "Application of slashes from era {{id}}": "", @@ -319,7 +317,6 @@ "Forget": "", "Forget this account": "", "Forget this address": "", - "Fork Locally": "", "Forks": "", "Free balance": "", "From JSON": "", @@ -384,8 +381,6 @@ "Lifetime (# of blocks)": "", "Light theme": "", "Loading": "", - "Local": "", - "Local fork powered by ": "", "Locked funds (e.g. for staking) are counted.": "", "Locked1x": "", "Locked2x": "", @@ -928,7 +923,6 @@ "The minimum balance allowed for the asset.": "", "The minimum balance for the asset. This is specified in the units and decimals as requested.": "", "The moment of enactment, either at a specific block, or after a specific number of blocks.": "", - "The name for this account": "", "The name for this account and how it will appear under your addresses. With an on-chain identity, it can be made available to others.": "", "The name for this account as it will appear under your accounts.": "", "The name for this teyrchain, the id and the allocated/requested balance.": "", @@ -1329,7 +1323,6 @@ "chain specifications": "", "challenge": "", "children": "", - "chopsticks": "", "claim to account": "", "claimable": "", "click to copy": "", @@ -1452,7 +1445,6 @@ "dissolve crowdloan": "", "do not include empty strings in the generated file": "", "does not appear to have a valid claim. Please double check that you have signed the transaction correctly on the correct ETH account.": "", - "e.g. 5Gg3...": "", "ed25519, Edwards": "", "elapsed": "", "elected stake": "", @@ -1602,8 +1594,6 @@ "lifetime": "", "link": "", "links": "", - "local account name": "", - "local accounts added via chopsticks fork": "", "lock": "", "lock expired": "", "lock periods": "", diff --git a/packages/apps/public/locales/tr/translation.json b/packages/apps/public/locales/tr/translation.json index dfea684..3457bb6 100644 --- a/packages/apps/public/locales/tr/translation.json +++ b/packages/apps/public/locales/tr/translation.json @@ -46,7 +46,6 @@ "Active nominations ({{count}})": "", "Add": "", "Add Bounty": "", - "Add a mock account to chopsticks": "", "Add account via Ledger": "", "Add account via Qr": "", "Add an account via seed {{step}}/{{STEPS_COUNT}}": "", @@ -97,7 +96,6 @@ "Announcements ({{count}})": "", "Any account can request payout for stakers, this is not limited to accounts that will be rewarded.": "", "Any account set as proxy will be able to perform actions in place of the proxied account": "", - "Any address, this can override other accounts": "", "Any combination of the four options may be approved of by the voter. There is no need to select only one option!": "", "Any democracy vote performed by the delegated account will result in an additional vote from the delegating account": "", "Application of slashes from era {{id}}": "", @@ -319,7 +317,6 @@ "Forget": "", "Forget this account": "", "Forget this address": "", - "Fork Locally": "", "Forks": "", "Free balance": "", "From JSON": "", @@ -384,8 +381,6 @@ "Lifetime (# of blocks)": "", "Light theme": "", "Loading": "", - "Local": "", - "Local fork powered by ": "", "Locked funds (e.g. for staking) are counted.": "", "Locked1x": "", "Locked2x": "", @@ -928,7 +923,6 @@ "The minimum balance allowed for the asset.": "", "The minimum balance for the asset. This is specified in the units and decimals as requested.": "", "The moment of enactment, either at a specific block, or after a specific number of blocks.": "", - "The name for this account": "", "The name for this account and how it will appear under your addresses. With an on-chain identity, it can be made available to others.": "", "The name for this account as it will appear under your accounts.": "", "The name for this teyrchain, the id and the allocated/requested balance.": "", @@ -1329,7 +1323,6 @@ "chain specifications": "", "challenge": "", "children": "", - "chopsticks": "", "claim to account": "", "claimable": "", "click to copy": "", @@ -1452,7 +1445,6 @@ "dissolve crowdloan": "", "do not include empty strings in the generated file": "", "does not appear to have a valid claim. Please double check that you have signed the transaction correctly on the correct ETH account.": "", - "e.g. 5Gg3...": "", "ed25519, Edwards": "", "elapsed": "", "elected stake": "", @@ -1602,8 +1594,6 @@ "lifetime": "", "link": "", "links": "", - "local account name": "", - "local accounts added via chopsticks fork": "", "lock": "", "lock expired": "", "lock periods": "", diff --git a/packages/apps/public/locales/zh/translation.json b/packages/apps/public/locales/zh/translation.json index 2c06c3e..b52626f 100644 --- a/packages/apps/public/locales/zh/translation.json +++ b/packages/apps/public/locales/zh/translation.json @@ -219,7 +219,6 @@ "Forget this asset": "忘记这个资产", "Forget this code hash": "忘记这个代码哈希", "Forget this contract": "忘记该合约", - "Fork Locally": "本地分叉", "Forks": "(Forks)分叉", "Full Legal Name": "法定全称", "Future versions of the web-only interface will drop support for non-external accounts, much like the IPFS version.": "未来版本的纯 web 界面将不再支持非外部帐户,这与 IPFS 版本非常相似。", diff --git a/packages/apps/src/Endpoints/index.tsx b/packages/apps/src/Endpoints/index.tsx index 7c339a4..16837d5 100644 --- a/packages/apps/src/Endpoints/index.tsx +++ b/packages/apps/src/Endpoints/index.tsx @@ -164,31 +164,11 @@ function loadAffinities (groups: Group[]): Record { }), {}); } -function isSwitchDisabled (hasUrlChanged: boolean, apiUrl: string, isUrlValid: boolean, isLocalFork?: boolean): boolean { +function isSwitchDisabled (hasUrlChanged: boolean, apiUrl: string, isUrlValid: boolean): boolean { if (!hasUrlChanged) { - if (isLocalFork) { - return false; - } else { - return true; - } - } else if (apiUrl.startsWith('light://')) { - return false; - } else if (isUrlValid) { - return false; - } - - return true; -} - -function isLocalForkDisabled (hasUrlChanged: boolean, apiUrl: string, isUrlValid: boolean, isLocalFork?: boolean): boolean { - if (!hasUrlChanged) { - if (isLocalFork) { - return true; - } else { - return false; - } - } else if (apiUrl.startsWith('light://')) { return true; + } else if (apiUrl.startsWith('light://')) { + return false; } else if (isUrlValid) { return false; } @@ -199,7 +179,7 @@ function isLocalForkDisabled (hasUrlChanged: boolean, apiUrl: string, isUrlValid function Endpoints ({ className = '', offset, onClose }: Props): React.ReactElement { const { t } = useTranslation(); const linkOptions = createWsEndpoints(t); - const { apiEndpoint, isLocalFork } = useApi(); + const { apiEndpoint } = useApi(); const [favoriteChains, setFavoriteChains] = useState(() => getFavoriteChains()); const [groups, setGroups] = useState(() => combineEndpoints(linkOptions)); const [{ apiUrl, groupIndex, hasUrlChanged, isUrlValid }, setApiUrl] = useState(() => extractUrlState(settings.get().apiUrl, groups)); @@ -297,22 +277,6 @@ function Endpoints ({ className = '', offset, onClose }: Props): React.ReactElem const _onApply = useCallback( (): void => { - store.set('localFork', ''); - settings.set({ ...(settings.get()), apiUrl }); - window.location.assign(`${window.location.origin}${window.location.pathname}?rpc=${encodeURIComponent(apiUrl)}${window.location.hash}`); - - if (!hasUrlChanged) { - window.location.reload(); - } - - onClose(); - }, - [apiUrl, onClose, hasUrlChanged] - ); - - const _onLocalFork = useCallback( - (): void => { - store.set('localFork', apiUrl); settings.set({ ...(settings.get()), apiUrl }); window.location.assign(`${window.location.origin}${window.location.pathname}?rpc=${encodeURIComponent(apiUrl)}${window.location.hash}`); @@ -339,33 +303,19 @@ function Endpoints ({ className = '', offset, onClose }: Props): React.ReactElem ); const canSwitch = useMemo( - () => isSwitchDisabled(hasUrlChanged, apiUrl, isUrlValid, isLocalFork), - [hasUrlChanged, apiUrl, isUrlValid, isLocalFork] - ); - - const canLocalFork = useMemo( - () => isLocalForkDisabled(hasUrlChanged, apiUrl, isUrlValid, isLocalFork), - [hasUrlChanged, apiUrl, isUrlValid, isLocalFork] + () => isSwitchDisabled(hasUrlChanged, apiUrl, isUrlValid), + [hasUrlChanged, apiUrl, isUrlValid] ); return ( -