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
401eedc8
Unverified
Commit
401eedc8
authored
Aug 07, 2023
by
Wyatt Barnes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add zod devDep. Add validation for provider URL in tests
parent
adfcb134
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
package.json
packages/web3.js-plugin-fee-estimation/package.json
+2
-1
plugin.spec.ts
packages/web3.js-plugin-fee-estimation/src/plugin.spec.ts
+4
-1
pnpm-lock.yaml
pnpm-lock.yaml
+3
-0
No files found.
packages/web3.js-plugin-fee-estimation/package.json
View file @
401eedc8
...
...
@@ -33,7 +33,8 @@
"typescript"
:
"^5.1.6"
,
"viem"
:
"^1.3.1"
,
"vite"
:
"^4.4.6"
,
"vitest"
:
"^0.33.0"
"vitest"
:
"^0.33.0"
,
"zod"
:
"^3.21.4"
},
"dependencies"
:
{
"@ethereumjs/rlp"
:
"^4.0.1"
,
...
...
packages/web3.js-plugin-fee-estimation/src/plugin.spec.ts
View file @
401eedc8
import
{
beforeAll
,
describe
,
expect
,
test
}
from
'
vitest
'
import
{
z
}
from
'
zod
'
import
Web3
,
{
Contract
,
FMT_BYTES
,
FMT_NUMBER
}
from
'
web3
'
import
{
l2StandardBridgeABI
,
...
...
@@ -9,7 +10,9 @@ import {
import
OptimismFeeEstimationPlugin
from
'
./plugin
'
const
provider
=
process
.
env
.
VITE_L2_RPC_URL
??
'
https://mainnet.optimism.io
'
const
defaultProvider
=
'
https://mainnet.optimism.io
'
const
provider
=
z
.
string
().
url
().
default
(
defaultProvider
).
parse
(
process
.
env
[
'
VITE_L2_RPC_URL
'
])
if
(
provider
===
defaultProvider
)
console
.
warn
(
'
Warning: Using default public provider, this could cause tests to fail due to rate limits. Set the VITE_L2_RPC_URL env to override default provider
'
)
describe
(
'
OptimismFeeEstimationPlugin
'
,
()
=>
{
let
web3
:
Web3
...
...
pnpm-lock.yaml
View file @
401eedc8
...
...
@@ -568,6 +568,9 @@ importers:
vitest
:
specifier
:
^0.33.0
version
:
0.33.0(jsdom@22.1.0)
zod
:
specifier
:
^3.21.4
version
:
3.21.4
packages
:
...
...
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