Dont use json-string in network config

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2018-05-25 11:50:14 +02:00
parent 5ee356fe4f
commit 638b30c443
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
3 changed files with 21 additions and 4 deletions

View File

@ -15,8 +15,7 @@
:URL upstream-url}}] :URL upstream-url}}]
{:id (string/replace random-id "-" "") {:id (string/replace random-id "-" "")
:name network-name :name network-name
:config (types/clj->json config) :config config}))
:raw-config config}))
(handlers/register-handler-fx (handlers/register-handler-fx
:save-new-network :save-new-network

View File

@ -34,7 +34,8 @@
[status-im.test.utils.async] [status-im.test.utils.async]
[status-im.test.utils.datetime] [status-im.test.utils.datetime]
[status-im.test.utils.mixpanel] [status-im.test.utils.mixpanel]
[status-im.test.utils.prices])) [status-im.test.utils.prices]
[status-im.test.ui.screens.network-settings.edit-network.events]))
(enable-console-print!) (enable-console-print!)
@ -79,4 +80,5 @@
'status-im.test.utils.transducers 'status-im.test.utils.transducers
'status-im.test.utils.datetime 'status-im.test.utils.datetime
'status-im.test.utils.mixpanel 'status-im.test.utils.mixpanel
'status-im.test.utils.prices) 'status-im.test.utils.prices
'status-im.test.ui.screens.network-settings.edit-network.events)

View File

@ -0,0 +1,16 @@
(ns status-im.test.ui.screens.network-settings.edit-network.events
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.ui.screens.network-settings.edit-network.events :as events]))
(deftest new-network
(let [actual (events/new-network {:random-id "random-id"}
"network-name"
"upstream-url"
:mainnet)]
(is (= {:id "randomid"
:name "network-name"
:config {:NetworkId 1
:DataDir "/ethereum/mainnet_rpc"
:UpstreamConfig {:Enabled true
:URL "upstream-url"}}}
actual))))