-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧹 APPS-203: Adding stage and network parameters to validate RPCS task (…
- Loading branch information
1 parent
5d03563
commit 5b563f0
Showing
8 changed files
with
259 additions
and
9 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@layerzerolabs/devtools-evm-hardhat-test": patch | ||
"@layerzerolabs/devtools-evm-hardhat": patch | ||
--- | ||
|
||
Added optional stage and networks arguments to lz:healthcheck:validate:rpcs task |
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
36 changes: 36 additions & 0 deletions
36
tests/devtools-evm-hardhat-test/hardhat.config.with-valid-and-invalid-rpcs.ts
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,36 @@ | ||
import 'hardhat-deploy' | ||
import { EndpointId } from '@layerzerolabs/lz-definitions' | ||
import '@layerzerolabs/toolbox-hardhat' | ||
import type { HardhatUserConfig } from 'hardhat/types' | ||
|
||
import { default as baseConfig } from './hardhat.config' | ||
|
||
const MNEMONIC = process.env.MNEMONIC ?? '' | ||
|
||
/** | ||
* This is a dummy hardhat config that enables us to test | ||
* hardhat functionality without mocking too much | ||
*/ | ||
const config: HardhatUserConfig = { | ||
...baseConfig, | ||
networks: { | ||
bsc: { | ||
eid: EndpointId.BSC_V2_MAINNET, | ||
url: 'https://404-beepboop.drpc.org', | ||
accounts: { | ||
mnemonic: MNEMONIC, | ||
initialIndex: 0, | ||
}, | ||
}, | ||
arbSepolia: { | ||
eid: EndpointId.ARBSEP_V2_TESTNET, | ||
url: 'https://arbitrum-sepolia.blockpi.network/v1/rpc/public', | ||
accounts: { | ||
mnemonic: MNEMONIC, | ||
initialIndex: 0, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
export default config |
37 changes: 37 additions & 0 deletions
37
...ools-evm-hardhat-test/test/task/validate.rpcs.test.expectations/validate-all-networks.exp
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,37 @@ | ||
#!/usr/bin/expect -f | ||
# | ||
# This Expect script was generated by autoexpect on Mon Feb 12 16:57:18 2024 | ||
# Expect and autoexpect were both written by Don Libes, NIST. | ||
# | ||
# Note that autoexpect does not guarantee a working script. It | ||
# necessarily has to guess about certain things. Two reasons a script | ||
# might fail are: | ||
# | ||
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet, | ||
# etc.) and devices discard or ignore keystrokes that arrive "too | ||
# quickly" after prompts. If you find your new script hanging up at | ||
# one spot, try adding a short sleep just before the previous send. | ||
# Setting "force_conservative" to 1 (see below) makes Expect do this | ||
# automatically - pausing briefly before sending each character. This | ||
# pacifies every program I know of. The -c flag makes the script do | ||
# this in the first place. The -C flag allows you to define a | ||
# character to toggle this mode off and on. | ||
|
||
set force_conservative 0 | ||
if {$force_conservative} { | ||
set send_slow {1 .1} | ||
proc send {ignore arg} { | ||
sleep .1 | ||
exp_send -s -- $arg | ||
} | ||
} | ||
|
||
set timeout 60 | ||
|
||
match_max 100000 | ||
|
||
spawn npx hardhat --config hardhat.config.with-valid-https-rpc.ts lz:healthcheck:validate:rpcs | ||
|
||
expect "========== All RPC URLs are valid!" | ||
|
||
expect eof |
37 changes: 37 additions & 0 deletions
37
...hardhat-test/test/task/validate.rpcs.test.expectations/validate-for-specific-networks.exp
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,37 @@ | ||
#!/usr/bin/expect -f | ||
# | ||
# This Expect script was generated by autoexpect on Mon Feb 12 16:57:18 2024 | ||
# Expect and autoexpect were both written by Don Libes, NIST. | ||
# | ||
# Note that autoexpect does not guarantee a working script. It | ||
# necessarily has to guess about certain things. Two reasons a script | ||
# might fail are: | ||
# | ||
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet, | ||
# etc.) and devices discard or ignore keystrokes that arrive "too | ||
# quickly" after prompts. If you find your new script hanging up at | ||
# one spot, try adding a short sleep just before the previous send. | ||
# Setting "force_conservative" to 1 (see below) makes Expect do this | ||
# automatically - pausing briefly before sending each character. This | ||
# pacifies every program I know of. The -c flag makes the script do | ||
# this in the first place. The -C flag allows you to define a | ||
# character to toggle this mode off and on. | ||
|
||
set force_conservative 0 | ||
if {$force_conservative} { | ||
set send_slow {1 .1} | ||
proc send {ignore arg} { | ||
sleep .1 | ||
exp_send -s -- $arg | ||
} | ||
} | ||
|
||
set timeout 60 | ||
|
||
match_max 100000 | ||
|
||
spawn npx hardhat --config hardhat.config.with-valid-and-invalid-rpcs.ts lz:healthcheck:validate:rpcs --networks arbSepolia | ||
|
||
expect "========== All RPC URLs are valid!" | ||
|
||
expect eof |
37 changes: 37 additions & 0 deletions
37
...vm-hardhat-test/test/task/validate.rpcs.test.expectations/validate-for-specific-stage.exp
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,37 @@ | ||
#!/usr/bin/expect -f | ||
# | ||
# This Expect script was generated by autoexpect on Mon Feb 12 16:57:18 2024 | ||
# Expect and autoexpect were both written by Don Libes, NIST. | ||
# | ||
# Note that autoexpect does not guarantee a working script. It | ||
# necessarily has to guess about certain things. Two reasons a script | ||
# might fail are: | ||
# | ||
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet, | ||
# etc.) and devices discard or ignore keystrokes that arrive "too | ||
# quickly" after prompts. If you find your new script hanging up at | ||
# one spot, try adding a short sleep just before the previous send. | ||
# Setting "force_conservative" to 1 (see below) makes Expect do this | ||
# automatically - pausing briefly before sending each character. This | ||
# pacifies every program I know of. The -c flag makes the script do | ||
# this in the first place. The -C flag allows you to define a | ||
# character to toggle this mode off and on. | ||
|
||
set force_conservative 0 | ||
if {$force_conservative} { | ||
set send_slow {1 .1} | ||
proc send {ignore arg} { | ||
sleep .1 | ||
exp_send -s -- $arg | ||
} | ||
} | ||
|
||
set timeout 60 | ||
|
||
match_max 100000 | ||
|
||
spawn npx hardhat --config hardhat.config.with-valid-and-invalid-rpcs.ts lz:healthcheck:validate:rpcs --stage testnet | ||
|
||
expect "========== All RPC URLs are valid!" | ||
|
||
expect eof |
37 changes: 37 additions & 0 deletions
37
...ardhat-test/test/task/validate.rpcs.test.expectations/validate-with-network-and-stage.exp
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,37 @@ | ||
#!/usr/bin/expect -f | ||
# | ||
# This Expect script was generated by autoexpect on Mon Feb 12 16:57:18 2024 | ||
# Expect and autoexpect were both written by Don Libes, NIST. | ||
# | ||
# Note that autoexpect does not guarantee a working script. It | ||
# necessarily has to guess about certain things. Two reasons a script | ||
# might fail are: | ||
# | ||
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet, | ||
# etc.) and devices discard or ignore keystrokes that arrive "too | ||
# quickly" after prompts. If you find your new script hanging up at | ||
# one spot, try adding a short sleep just before the previous send. | ||
# Setting "force_conservative" to 1 (see below) makes Expect do this | ||
# automatically - pausing briefly before sending each character. This | ||
# pacifies every program I know of. The -c flag makes the script do | ||
# this in the first place. The -C flag allows you to define a | ||
# character to toggle this mode off and on. | ||
|
||
set force_conservative 0 | ||
if {$force_conservative} { | ||
set send_slow {1 .1} | ||
proc send {ignore arg} { | ||
sleep .1 | ||
exp_send -s -- $arg | ||
} | ||
} | ||
|
||
set timeout 60 | ||
|
||
match_max 100000 | ||
|
||
spawn npx hardhat --config hardhat.config.with-valid-and-invalid-rpcs.ts lz:healthcheck:validate:rpcs --stage testnet --networks arbSepolia | ||
|
||
expect "--stage testnet cannot be used in conjunction with --networks arbSepolia" | ||
|
||
expect eof |
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