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:
Mohamed Javid 2024-11-01 21:09:59 +05:30 committed by GitHub
parent f0079961f4
commit 4f40fda6a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 11 deletions

View File

@ -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)