fix(wallet)_: Chain prefix for ENS resolved address (#21504)
This commit removes chain prefixes being added to ENS resolved address in send flow Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
This commit is contained in:
parent
f0079961f4
commit
4f40fda6a3
|
@ -387,23 +387,14 @@
|
||||||
(rf/dispatch [:wallet/set-ens-address nil ens])
|
(rf/dispatch [:wallet/set-ens-address nil ens])
|
||||||
(on-error-fn))))}]]]})))
|
(on-error-fn))))}]]]})))
|
||||||
|
|
||||||
(defn- resolved-address->prefixed-address
|
|
||||||
[address networks]
|
|
||||||
(let [prefixes (->> networks
|
|
||||||
(map network-utils/network->short-name)
|
|
||||||
network-utils/short-names->network-preference-prefix)]
|
|
||||||
(str prefixes (eip55/address->checksum address))))
|
|
||||||
|
|
||||||
(rf/reg-event-fx
|
(rf/reg-event-fx
|
||||||
:wallet/set-ens-address
|
:wallet/set-ens-address
|
||||||
(fn [{:keys [db]} [result ens]]
|
(fn [{:keys [db]} [result ens]]
|
||||||
(let [networks [constants/ethereum-network-name constants/optimism-network-name]
|
(let [suggestion (if result
|
||||||
suggestion (if result
|
|
||||||
[{:type item-types/address
|
[{:type item-types/address
|
||||||
:ens ens
|
:ens ens
|
||||||
:address (eip55/address->checksum result)
|
:address (eip55/address->checksum result)
|
||||||
:networks networks
|
:full-address (eip55/address->checksum result)}]
|
||||||
:full-address (resolved-address->prefixed-address result networks)}]
|
|
||||||
[])]
|
[])]
|
||||||
{:db (-> db
|
{:db (-> db
|
||||||
(assoc-in [:wallet :ui :search-address :local-suggestions] suggestion)
|
(assoc-in [:wallet :ui :search-address :local-suggestions] suggestion)
|
||||||
|
|
Loading…
Reference in New Issue