-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support sepolia testnet #61
Merged
Merged
Changes from 35 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
26ab5a9
chore: change ropsten to sepolia
zixiang2018 abfd48e
feat: bump ethers version
zixiang2018 6641afe
chore: update typings
zixiang2018 0f3f3ce
chore: validate gasPrice and nonce existence
zixiang2018 aa3bccc
chore: attempt to use older puppeteer-headful
zixiang2018 b18d0f0
Revert "chore: attempt to use older puppeteer-headful"
zixiang2018 04c71f7
chore: node 18
zixiang2018 7327c3e
chore: factory requires an address param
zixiang2018 e0ab149
chore: use chainsafe/dappeteer
zixiang2018 9861920
chore: use latest puppeteer related packages
zixiang2018 c3211b9
chore: refine errors
zixiang2018 834bf88
chore: add openssl legacy provider
zixiang2018 5d32005
chore: check for node >=17
zixiang2018 eab4d01
chore: openssl legacy provider
zixiang2018 6aaccbf
chore: add env var into command directly
zixiang2018 5a16512
chore: remove openssl legacy provider
zixiang2018 545e92f
chore: use ganache
zixiang2018 95a6b69
chore: remove react-scripts
zixiang2018 d88b027
chore: update wait-on
zixiang2018 72d00c8
chore: update actions
zixiang2018 f168b0b
chore: npm i
zixiang2018 4af93ec
chore: upgrade vite
zixiang2018 fbff2ca
chore: add timeout
zixiang2018 065f4ac
chore: update port
zixiang2018 50286b5
chore add verbose wait-on
zixiang2018 fac6537
chore: fix package import
zixiang2018 f625c4e
chore: fix tests
zixiang2018 1d25648
chore: npm run test
zixiang2018 efbe326
chore: tweak metamask init
zixiang2018 879ba54
chore: tweak
zixiang2018 79361a9
chore: refine
zixiang2018 8bda9a2
chore: add browser close
zixiang2018 238f13e
chore: change ports
zixiang2018 a8c63cd
chore: remove comment
zixiang2018 a9146e7
chore: add port to dev
zixiang2018 6abac24
chore: update error handling
zixiang2018 86f852b
chore: refactor
zixiang2018 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export const addNetwork = async () => { | ||
const addNetworkRequest = window.ethereum.request({ | ||
method: "wallet_addEthereumChain", | ||
params: [ | ||
{ | ||
chainId: "0x539", | ||
chainName: "Localhost 8545", | ||
nativeCurrency: { | ||
name: "ETH", | ||
symbol: "ETH", | ||
decimals: 18, | ||
}, | ||
rpcUrls: ["http://localhost:8545"], | ||
}, | ||
], | ||
}); | ||
|
||
return new Promise((resolve) => { | ||
addNetworkRequest | ||
.then(() => { | ||
resolve(true); | ||
}) | ||
.catch(() => { | ||
resolve(false); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const waitForAndClickElement = async (page, query) => { | ||
await waitForElement(page, query); | ||
const element = await page.$(query); | ||
await element.click(); | ||
}; | ||
|
||
export const waitForElement = async (page, query) => { | ||
await page.waitForSelector(query, { | ||
visible: true, | ||
}); | ||
}; | ||
|
||
export const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); | ||
HJunyuan marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too sure about this section. Should we be using
await sleep(2000)
instead ofsetTimeout()
?Furthermore, the last line can be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow, if I add the
await
, it won't work... 🤔Ill either have to separate the code (like the Dappeteer testcase) or just call
dappPage.evaluate(addNetwork)
beforeawait metamask.acceptAddNetwork(true);
Anyway I removed the
setTimeout
from the codeawait metamask.acceptAddNetwork(true);
as its no longer neededThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI about what the 2 code does,
dappPage.evaluate(addNetwork)
opens a page to add the new network as per our configurationmetamask.acceptAddNetwork(true)
will supposedly click on the button "Approve" to add the new network, and then do a switch of network to the new network (reference)