2020-04-26 16:26:53 +00:00
|
|
|
{.used.}
|
|
|
|
|
2020-03-24 11:13:07 +00:00
|
|
|
import
|
2021-04-28 16:41:02 +00:00
|
|
|
unittest2,
|
2020-03-24 11:13:07 +00:00
|
|
|
chronos, web3/ethtypes,
|
2021-04-28 16:41:02 +00:00
|
|
|
../beacon_chain/eth1/eth1_monitor,
|
|
|
|
./testutil
|
2020-03-24 11:13:07 +00:00
|
|
|
|
|
|
|
suite "Eth1 Chain":
|
|
|
|
discard
|
|
|
|
|
2020-11-05 23:11:06 +00:00
|
|
|
suite "Eth1 monitor":
|
|
|
|
test "Rewrite HTTPS Infura URLs":
|
|
|
|
var
|
|
|
|
mainnetWssUrl = "wss://mainnet.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e"
|
|
|
|
mainnetHttpUrl = "http://mainnet.infura.io/v3/6224f3c792cc443fafb64e70a98f871e"
|
|
|
|
mainnetHttpsUrl = "https://mainnet.infura.io/v3/6224f3c792cc443fafb64e70a98f871e"
|
|
|
|
goerliWssUrl = "wss://goerli.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e"
|
|
|
|
goerliHttpUrl = "http://goerli.infura.io/v3/6224f3c792cc443fafb64e70a98f871e"
|
|
|
|
goerliHttpsUrl = "https://goerli.infura.io/v3/6224f3c792cc443fafb64e70a98f871e"
|
2020-11-12 13:49:13 +00:00
|
|
|
gethHttpUrl = "http://localhost:8545"
|
|
|
|
gethHttpsUrl = "https://localhost:8545"
|
|
|
|
gethWsUrl = "ws://localhost:8545"
|
|
|
|
unspecifiedProtocolUrl = "localhost:8545"
|
|
|
|
|
|
|
|
fixupWeb3Urls mainnetWssUrl
|
|
|
|
fixupWeb3Urls mainnetHttpUrl
|
|
|
|
fixupWeb3Urls mainnetHttpsUrl
|
|
|
|
fixupWeb3Urls goerliWssUrl
|
|
|
|
fixupWeb3Urls goerliHttpUrl
|
|
|
|
fixupWeb3Urls goerliHttpsUrl
|
|
|
|
fixupWeb3Urls gethHttpUrl
|
|
|
|
fixupWeb3Urls gethHttpsUrl
|
|
|
|
fixupWeb3Urls gethWsUrl
|
|
|
|
fixupWeb3Urls unspecifiedProtocolUrl
|
2020-11-05 23:11:06 +00:00
|
|
|
|
|
|
|
check:
|
|
|
|
mainnetWssUrl == "wss://mainnet.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e"
|
2021-12-03 12:14:21 +00:00
|
|
|
mainnetHttpUrl == mainnetWssUrl
|
|
|
|
mainnetHttpsUrl == mainnetWssUrl
|
2020-11-05 23:11:06 +00:00
|
|
|
|
|
|
|
goerliWssUrl == "wss://goerli.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e"
|
2021-12-03 12:14:21 +00:00
|
|
|
goerliHttpUrl == goerliWssUrl
|
|
|
|
goerliHttpsUrl == goerliWssUrl
|
2020-11-05 23:11:06 +00:00
|
|
|
|
2021-12-03 12:14:21 +00:00
|
|
|
gethHttpUrl == gethWsUrl
|
|
|
|
gethHttpsUrl == gethWsUrl
|
|
|
|
unspecifiedProtocolUrl == gethWsUrl
|
2020-11-12 13:49:13 +00:00
|
|
|
|
|
|
|
gethWsUrl == "ws://localhost:8545"
|