Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
54e6300a
Unverified
Commit
54e6300a
authored
Jun 12, 2023
by
Mark Tyneway
Committed by
GitHub
Jun 12, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5975 from ethereum-optimism/cleanup/ethers-fallback-provider
cleanup: delete custom ethers fallback provider
parents
eefb3f87
ca267dce
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
60 deletions
+2
-60
package.json
packages/core-utils/package.json
+1
-1
fallback-provider.ts
packages/core-utils/src/external/ethers/fallback-provider.ts
+0
-57
index.ts
packages/core-utils/src/external/ethers/index.ts
+0
-1
yarn.lock
yarn.lock
+1
-1
No files found.
packages/core-utils/package.json
View file @
54e6300a
...
...
@@ -41,7 +41,6 @@
"@ethersproject/constants"
:
"^5.7.0"
,
"@ethersproject/hash"
:
"^5.7.0"
,
"@ethersproject/keccak256"
:
"^5.7.0"
,
"@ethersproject/providers"
:
"^5.7.0"
,
"@ethersproject/rlp"
:
"^5.7.0"
,
"@ethersproject/transactions"
:
"^5.7.0"
,
"@ethersproject/properties"
:
"^5.7.0"
,
...
...
@@ -50,6 +49,7 @@
"chai"
:
"^4.3.4"
},
"devDependencies"
:
{
"@types/node"
:
"^12.12.6"
,
"mocha"
:
"^10.0.0"
}
}
packages/core-utils/src/external/ethers/fallback-provider.ts
deleted
100644 → 0
View file @
eefb3f87
/**
* Provider Utilities
*/
import
{
Provider
,
StaticJsonRpcProvider
,
FallbackProvider
as
EthersFallbackProvider
,
}
from
'
@ethersproject/providers
'
import
{
ConnectionInfo
}
from
'
@ethersproject/web
'
export
interface
HttpHeaders
{
[
key
:
string
]:
string
}
// Copied from @ethersproject/providers since it is not
// currently exported
export
interface
FallbackProviderConfig
{
// The Provider
provider
:
Provider
// The priority to favour this Provider; higher values are used first
priority
?:
number
// Timeout before also triggering the next provider; this does not stop
// this provider and if its result comes back before a quorum is reached
// it will be incorporated into the vote
// - lower values will cause more network traffic but may result in a
// faster retult.
stallTimeout
?:
number
// How much this provider contributes to the quorum; sometimes a specific
// provider may be more reliable or trustworthy than others, but usually
// this should be left as the default
weight
?:
number
}
export
const
FallbackProvider
=
(
config
:
string
|
FallbackProviderConfig
[],
headers
?:
HttpHeaders
)
=>
{
const
configs
=
[]
// Handle the case of a string of comma delimited urls
if
(
typeof
config
===
'
string
'
)
{
const
urls
=
config
.
split
(
'
,
'
)
for
(
const
[
i
,
url
]
of
urls
.
entries
())
{
const
connectionInfo
:
ConnectionInfo
=
{
url
}
if
(
typeof
headers
===
'
object
'
)
{
connectionInfo
.
headers
=
headers
}
configs
.
push
({
priority
:
i
,
provider
:
new
StaticJsonRpcProvider
(
connectionInfo
),
})
}
return
new
EthersFallbackProvider
(
configs
)
}
return
new
EthersFallbackProvider
(
config
)
}
packages/core-utils/src/external/ethers/index.ts
View file @
54e6300a
...
...
@@ -2,5 +2,4 @@
* Utilities that extend or enhance the ethers.js library
*/
export
*
from
'
./fallback-provider
'
export
*
from
'
./network
'
yarn.lock
View file @
54e6300a
...
...
@@ -1666,7 +1666,7 @@
bech32 "1.1.4"
ws "7.4.6"
"@ethersproject/providers@5.7.1"
, "@ethersproject/providers@^5.7.0"
:
"@ethersproject/providers@5.7.1":
version "5.7.1"
resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.1.tgz#b0799b616d5579cd1067a8ebf1fc1ec74c1e122c"
integrity sha512-vZveG/DLyo+wk4Ga1yx6jSEHrLPgmTt+dFv0dv8URpVCRf0jVhalps1jq/emN/oXnMRsC7cQgAF32DcXLL7BPQ==
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment