-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bitcoin should only return the correct implementation depending on th… (
#754) * Bitcoin should only return the correct implementation depending on the chainId * Created a separated ChainStorage as when the app restarts the MainStorage is lost - chainId should never change!
- Loading branch information
1 parent
5970a35
commit 2e7a7fa
Showing
3 changed files
with
25 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import { ChainTypesByIdType } from 'shared/constants/chainConstants' | ||
import { MMKVStorage } from 'storage/MMKVStorage' | ||
|
||
import { MainStorage } from './MainStorage' | ||
const ChainStorage = new MMKVStorage('chainStorage') | ||
|
||
export const getCurrentChainId: () => ChainTypesByIdType = () => | ||
MainStorage.get('chainId') || 31 | ||
ChainStorage.get('chainId') || 31 | ||
|
||
export const setCurrentChainId = (chainId: ChainTypesByIdType) => | ||
MainStorage.set('chainId', chainId) | ||
ChainStorage.set('chainId', chainId) |