diff options
author | Frankie <frankie.diamond@gmail.com> | 2019-01-30 02:13:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-30 02:13:51 +0800 |
commit | df3169d1c7250d13bb8bc123dc91f7913ad75a81 (patch) | |
tree | 266721dc67ae2079543f9ba78e7c546e24f1d068 /test | |
parent | 98d5b4d63217094db9dfc535d0baaed7f8ab0520 (diff) | |
download | tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.gz tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.bz2 tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.lz tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.xz tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.zst tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.zip |
I#5956 fix2 dont overwrite existing rpc settings (#6044)
* mm-controller - dont overwrite existing rpc settings
* ui-networkDropdown - dont pass old network as chainId
* add methods preferencesController.updateRpc and metamaskController.updateAndSetCustomRpc
* use updateAndSetCustomRpc in settings to allow rpcs to be updated
* use new rpc as nickname if no nick name has been supplied
* fix update rpc method
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/app/controllers/preferences-controller-test.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/app/controllers/preferences-controller-test.js b/test/unit/app/controllers/preferences-controller-test.js index 67d1875c1..558597ae7 100644 --- a/test/unit/app/controllers/preferences-controller-test.js +++ b/test/unit/app/controllers/preferences-controller-test.js @@ -511,6 +511,18 @@ describe('preferences controller', function () { }) }) + describe('#updateRpc', function () { + it('should update the rpcDetails properly', () => { + preferencesController.store.updateState({frequentRpcListDetail: [{}, { rpcUrl: 'test' }, {}]}) + preferencesController.updateRpc({ rpcUrl: 'test', chainId: 1 }) + preferencesController.updateRpc({ rpcUrl: 'test/1', chainId: 1 }) + preferencesController.updateRpc({ rpcUrl: 'test/2', chainId: 1 }) + preferencesController.updateRpc({ rpcUrl: 'test/3', chainId: 1 }) + const list = preferencesController.getFrequentRpcListDetail() + assert.deepEqual(list[1], { rpcUrl: 'test', chainId: 1 }) + }) + }) + describe('on updateFrequentRpcList', function () { it('should add custom RPC url to state', function () { preferencesController.addToFrequentRpcList('rpc_url', 1) |