Page MenuHomePhabricator

D9524.id32153.diff
No OneTemporary

D9524.id32153.diff

diff --git a/lib/components/ens-cache-provider.react.js b/lib/components/ens-cache-provider.react.js
--- a/lib/components/ens-cache-provider.react.js
+++ b/lib/components/ens-cache-provider.react.js
@@ -2,7 +2,8 @@
import * as React from 'react';
-import { ENSCache, type EthersProvider } from '../utils/ens-cache.js';
+import type { EthersProvider } from '../types/ethers-types.js';
+import { ENSCache } from '../utils/ens-cache.js';
import {
getENSNames as baseGetENSNames,
type GetENSNames,
diff --git a/lib/types/ethers-types.js b/lib/types/ethers-types.js
new file mode 100644
--- /dev/null
+++ b/lib/types/ethers-types.js
@@ -0,0 +1,8 @@
+// @flow
+
+export type EthersProvider = {
+ +lookupAddress: (address: string) => Promise<?string>,
+ +resolveName: (name: string) => Promise<?string>,
+ +getAvatar: (name: string) => Promise<?string>,
+ ...
+};
diff --git a/lib/utils/ens-cache.js b/lib/utils/ens-cache.js
--- a/lib/utils/ens-cache.js
+++ b/lib/utils/ens-cache.js
@@ -3,6 +3,7 @@
import namehash from 'eth-ens-namehash';
import sleep from './sleep.js';
+import type { EthersProvider } from '../types/ethers-types.js';
const cacheTimeout = 24 * 60 * 60 * 1000; // one day
const failedQueryCacheTimeout = 5 * 60 * 1000; // five minutes
@@ -13,12 +14,6 @@
throw new Error(`ENS fetch for ${identifier} timed out`);
}
-export type EthersProvider = {
- +lookupAddress: (address: string) => Promise<?string>,
- +resolveName: (name: string) => Promise<?string>,
- +getAvatar: (name: string) => Promise<?string>,
- ...
-};
type ENSNameQueryCacheEntry = {
// We normalize ETH addresses to lowercase characters
+normalizedETHAddress: string,
diff --git a/native/utils/ethers-utils.js b/native/utils/ethers-utils.js
--- a/native/utils/ethers-utils.js
+++ b/native/utils/ethers-utils.js
@@ -4,7 +4,7 @@
import { ethers } from 'ethers';
-import type { EthersProvider } from 'lib/utils/ens-cache.js';
+import type { EthersProvider } from 'lib/types/ethers-types.js';
let alchemyKey;
try {

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 1:31 AM (20 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609330
Default Alt Text
D9524.id32153.diff (1 KB)

Event Timeline