Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
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
LuckySwap
interface
Commits
dcb660d0
Unverified
Commit
dcb660d0
authored
Mar 03, 2023
by
Vignesh Mohankumar
Committed by
GitHub
Mar 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: variable for goerli in test (#6066)
parent
1f0b8ffa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
ethereum.ts
cypress/support/ethereum.ts
+7
-3
No files found.
cypress/support/ethereum.ts
View file @
dcb660d0
...
@@ -7,17 +7,21 @@ import { Eip1193Bridge } from '@ethersproject/experimental/lib/eip1193-bridge'
...
@@ -7,17 +7,21 @@ import { Eip1193Bridge } from '@ethersproject/experimental/lib/eip1193-bridge'
import
{
JsonRpcProvider
}
from
'
@ethersproject/providers
'
import
{
JsonRpcProvider
}
from
'
@ethersproject/providers
'
import
{
Wallet
}
from
'
@ethersproject/wallet
'
import
{
Wallet
}
from
'
@ethersproject/wallet
'
import
{
SupportedChainId
}
from
'
../../src/constants/chains
'
// todo: figure out how env vars actually work in CI
// todo: figure out how env vars actually work in CI
// const TEST_PRIVATE_KEY = Cypress.env('INTEGRATION_TEST_PRIVATE_KEY')
// const TEST_PRIVATE_KEY = Cypress.env('INTEGRATION_TEST_PRIVATE_KEY')
const
TEST_PRIVATE_KEY
=
'
0xe580410d7c37d26c6ad1a837bbae46bc27f9066a466fb3a66e770523b4666d19
'
const
TEST_PRIVATE_KEY
=
'
0xe580410d7c37d26c6ad1a837bbae46bc27f9066a466fb3a66e770523b4666d19
'
// address of the above key
// address of the above key
const
TEST_ADDRESS_NEVER_USE
=
new
Wallet
(
TEST_PRIVATE_KEY
).
address
const
TEST_ADDRESS_NEVER_USE
=
new
Wallet
(
TEST_PRIVATE_KEY
).
address
const
CHAIN_ID
=
SupportedChainId
.
GOERLI
const
HEXLIFIED_CHAIN_ID
=
`$0x
${
CHAIN_ID
}
`
const
provider
=
new
JsonRpcProvider
(
'
https://goerli.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847
'
,
5
)
const
provider
=
new
JsonRpcProvider
(
'
https://goerli.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847
'
,
5
)
const
signer
=
new
Wallet
(
TEST_PRIVATE_KEY
,
provider
)
const
signer
=
new
Wallet
(
TEST_PRIVATE_KEY
,
provider
)
export
const
injected
=
new
(
class
extends
Eip1193Bridge
{
export
const
injected
=
new
(
class
extends
Eip1193Bridge
{
chainId
=
/* GOERLI= */
5
chainId
=
CHAIN_ID
async
sendAsync
(...
args
:
any
[])
{
async
sendAsync
(...
args
:
any
[])
{
console
.
debug
(
'
sendAsync called
'
,
...
args
)
console
.
debug
(
'
sendAsync called
'
,
...
args
)
...
@@ -46,9 +50,9 @@ export const injected = new (class extends Eip1193Bridge {
...
@@ -46,9 +50,9 @@ export const injected = new (class extends Eip1193Bridge {
}
}
if
(
method
===
'
eth_chainId
'
)
{
if
(
method
===
'
eth_chainId
'
)
{
if
(
isCallbackForm
)
{
if
(
isCallbackForm
)
{
callback
(
null
,
{
result
:
'
0x5
'
})
callback
(
null
,
{
result
:
HEXLIFIED_CHAIN_ID
})
}
else
{
}
else
{
return
Promise
.
resolve
(
'
0x5
'
)
return
Promise
.
resolve
(
HEXLIFIED_CHAIN_ID
)
}
}
}
}
try
{
try
{
...
...
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