use ethereum address of the default wallet account for ens resolution

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
yenda 2019-08-20 11:54:08 +02:00
parent 1c475e5b1e
commit f2cf42715b
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
1 changed files with 4 additions and 7 deletions

View File

@ -59,7 +59,8 @@
(re-frame/dispatch [:ens/set-state username :unregistrable])))
(fx/defn register-name
[{:keys [db] :as cofx} contract custom-domain? username address public-key]
{:events [:ens/register]}
[{:keys [db] :as cofx} {:keys [contract custom-domain? username address public-key]}]
(let [{:keys [x y]} (ethereum/coordinates public-key)]
(signing/eth-transaction-call
cofx
@ -100,7 +101,8 @@
(assoc-state-for username state))}
(when (and name (= :valid state))
(let [{:keys [multiaccount]} db
{:keys [address public-key]} multiaccount
{:keys [public-key]} multiaccount
address (ethereum/default-address db)
registry (get ens/ens-registries (ethereum/chain-keyword db))]
{:ens/resolve-address [registry name #(on-resolve registry custom-domain? username address public-key %)]})))))
@ -156,11 +158,6 @@
[{:keys [db]} username]
{:db (assoc-state-for db username :registration-failed)})
(fx/defn register
{:events [:ens/register]}
[cofx {:keys [contract custom-domain? username address public-key]}]
(register-name cofx contract custom-domain? username address public-key))
(fx/defn store-name-detail
{:events [:ens/store-name-detail]}
[{:keys [db]} name k v]