mirror of
https://github.com/getwax/bls-wallet.git
synced 2026-01-14 08:17:59 -05:00
auditIssue7
1 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9cc3db2fce |
The Big One (#243)
* More stuff wasn't needed * Quill api is not used * Remove init and just put that in the constructor (🤯) * More tidying up * Cleanup config * Remove commented location.reload * Fix address selection * Replace block tracking * Remove unused code * Remove unused code * Remove unused code * Delete unused code * Delete commented code * Deduplicate currency default config * Enable strictPropertyInitialization * Remove commented code * Remove unused methods * Remove AccountTrackerController and other unused things * Remove unnecessary method * Move CurrencyController setup inside CurrencyController's constructor * Inline preferences cell * Move NetworkController initialization inside NetworkController's constructor * Move block tracking inside NetworkController * Remove unused interfaces, define defaultCurrencyControllerState inside ICurrencyController * Controllers set up their own cells * Fix redundant storage of nativeCurrency * Remove unnecessary handling of missing config in CurrencyController * Common definition of QuillCells * Inline unnecessary ICurrencyController.ts * Remove unnecessary IKeyringController (but keep docs) * Remove IPreferencesController (but keep docs) * Move utils from IPreferencesController into PreferencesController (and delete the empty file) * Remove redundant call to lookupNetwork * Remove unused changeProvider method (but capture the idea by watching providerConfig in the networkController), also getSelectedAddress 💥 * currentCurrency -> userCurrency * nativeCurrency -> networkCurrency * Replace setDefaultCurrency * Remove unnecessary methods * Fix failing assertion * Use vanilla webextension messaging for private rpc * Remove no-longer desirable quill_ prefixes (because we're not sharing a namespace anymore) * Directly implement PrivateRpc in QuillController instead of makePrivateRpc * Ensure public and private rpc can't overlap * wip: Replacing public rpc * Remove commented code * Don't allow unused vars 😄 * Only pass message to QuillController * controller -> quillController * Replace in-page rpc * Allow public rpc to fallback to the network * Add debugMe public method * Add isQuill: true * Improve settings * Get settings routes working properly * Add developer settings * New setting: breakOnAssertionFailures * Get breakOnAssertionFailures working * Don't transpile so heavily * Make RPC errors expose in useful+safe way * Combine rpc handlers and simplify using toOkError * handleRpcMessage -> handleMessage * Add port handler for quill-events-port * Move broadcast spec into Rpc.ts, prevent registering unknown events * Simplify assertion * Allow broadcasts to be scoped by origin and rename to notifications * Emit notifications the new way * QuillInPageProvider -> OldQuillInPageProvider * QuillProvider -> QuillContextProvider * QuillProvider * Fix minor errors/warnings * Add providerId, move EventsPortInfo into Rpc, handle non-promises in toOkError, simplify decoding EventsPortInfo * Add assert docs, add softAssert, use softAssert in toOkError * wip: Connecting events * Connect events * RpcResult improvements * Move eth_requestAccounts into new rpc system * Simplify implementing rpc * Stop using the old jrpc-based system * Add some TODOs * Move makeEthereumMethods into publicRpc, delete more stuff * Move TaskQueue into helpers * Delete more unused code, add more TODOs * Add note about cells walkthrough * Remove cells demo page (preserving generic cells components) * Move contentScript to just a file (not nested in a directory) * Delete unused code * Clean up the content script and add some nice docs explaining why it maybe shouldn't exist at all * Cleanup pageContentScript/index.ts * Resolve TODO * Handle async in MemoryCell * LongPollingCell * Add some TODOs * Track provider state using long polling (replacing events) * Fix infuriating null issue * Fix FormulaCell bug * wip * No more events RPC! 🤩 * Fix emission of disconnect errors * Add fixme * Remove unused code * Replace old eth_chainId middleware * AggregatorController * Improve/simplify message passing for PublicRpc * Remove unused code * Temporary fix for chain id * wip: Simplify RPC by consolidating public&private * Simplify RPC by consolidating public&private * Remove redundant selectedAddress cell * Add ICell.update * Fix redundant update methods in controllers * Update PreferencesController to use cells properly * Remove unused method * Inline simple keyring methods * Remove unused name fields * Simplify some things * Simplify networkController.provider using a cell * Remove unused code * Use the internal provider in KeyringController * Simplify KeyringController * Inline simple functions * Fix unnecessary optionality of HDPhrase * Currency api is not optional * Simplify CurrencyController * Don't store currency conversion, userCurrency -> preferredCurrency * Fix redundant storage of preferred currency * Replace CurrencyController with a cell * Remove unused code, simplify getDefaultProviderConfig * Improve typing of constants * Move CRYPTO_COMPARE_API_KEY into env.ts * builtinProviderConfigs * Awesome docstring for ensureType * Add TODO * Temporary fix for 'loading' problem * Replace unnecessary spaghetti with a simple fetch * Prefer requestStrict * Remove unused rpc method * Delete unused code * Fix unnecessary directory nesting * Remove completed TODO * Add rtti for SendTransactionParams * Remove unused code, add TODOs * Add TODOs * QuillProvider -> QuillEthereumProvider * pageContentScript/index.ts -> ethereum.ts, and don't remove the tag * Simplify window.ethereum acquisition in quillPage * Fix (window as any) * Remove unused code * constants -> networks * Controllers/background.ts -> background/index.ts * Simplify delegation * Define keyring rpc * Add fixme * Use name of the cell instead of 'state' in controllers * Move setSelectedAddress into PreferencesController * Simplify rpc definition * Use vanilla arguments for createUser * Inline createHDAccount inside rpc * Reorganize rpcMap * Move ethersProvider into QuillController and deprecate it * Move lookupPrivateKey into rpc * Move createAccount into rpc * Move removeAccount into rpc * Move addAccount inside rpc * Fix createAccount naming issue * Add TODO * Use more entropy in random ids and encode using base58check * Don't worry about locale for now (just use the browser locale!, also we shouldn't be worried about multiple users right now, just different accounts) * Move getBuiltinRPCURL into useInputDecode * Move getDefaultProviderConfig inside QuillCells * Remove unused code * utils -> helpers/RandomId * Fix unnecessary method wrapping in background/index.ts * Add fixme * Add MEGAFIX tag * Fix redundant chainId storage (3 places -> 1 place!) * Make chainId just a FormulaCell, since we shouldn't be writing it without writing the providerConfig * Fix duplication of breakOnAssertionFailures cell * Fix theme cell * Fix RequestBody typing duplication, expose better type information for request * forEach.ts * Make use of forEach * Implement window.ethereum.rpc * Provide return type for ethereum.request * Track breakOnFailures without using window.ethereum * Capitalize io types * Output -> Response * Improve internal rpc calls * Fix redundant network calls when not finding aggregator receipt * Track HD indexes instead of using wallets.length * Simplify network cells * Reimplement time cell so that it doesn't actively update * Non-actively updating TimeCell * QuillCells -> QuillStorageCells * Cleanup QuillContext cells * Remove redundant rpc client * Fix RandomId, isQuillExtensionPage * Fix line break * wip: LongPollingController * Respond 'please-retry' after 5 minutes * Add longPollCancel * Fix request id issue * wip: Lazy long polling cell * Remove unused dependencies * Use QuillLongPollingCell for providerState * Fix incorrect usage of Stoppable * Remember to break when we have a value * Show network settings * Show block number in network settings * isPermittedOrigin, add origin restriction to longPollingCells * Add awesome logging * Improve replayability of logged rpc * quillPage -> home * Don't construct QuillEthereumProvider unless window.ethereum is actually accessed * Only relay rpc if ethereum is accessed * Fix rpc with home.html * Improve debug.reset, remove isOnboardingComplete * Fix onboarding * Remove unused code * Improving how loading is handled * Update TODOs/FIXMEs (descoping + removing completed) * Improve assertion failures by requiring new Error to be inlined * Replace all custom throws with asserts * De-scope disconnect event * EIP1193 error codes * GeneralSettings stub (testing currencyConversion cell) * Test currency polling, implement currency aliases * Make dev setting defaults good for the team for now (should be configurable) * Just open the full view * message -> request * io.literal('ok') -> io.void * Docstrings for assertType, assertTypeEcho * Move debugging and runtime interaction out of QuillController * Organize background/index.ts, 'quill-rpc-request', deduplicate rtti checking * Add startup message * Fix ok:undefined bug * Post-merge tweaks * Fix bad substitution in yarn.lock * Fix double-calculating when using long polling * Remove unused field * Use sensible modern targets for babel, upgrade to webpack 5 * Remove unnecessary babel plugins * Fix sourcemaps * Update yarn.lock * Allow /js/* * Add quillController to Debug.ts * Fix lint errors * Fix inaccurate type issue * Improve error reporting. Add console.error for button errors so they are not swalloed silently. Add versions to version mismatch write error. Duplicate page hash TODO at all component usage sites. Co-authored-by: Jacob Caban-Tomski <jacque006@users.noreply.github.com> |