2020-04-26 16:26:53 +00:00
|
|
|
{.used.}
|
|
|
|
|
2020-03-24 11:13:07 +00:00
|
|
|
import
|
|
|
|
unittest,
|
|
|
|
chronos, web3/ethtypes,
|
2020-11-03 19:02:43 +00:00
|
|
|
../beacon_chain/eth1_monitor
|
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"
|
|
|
|
gethUrl = "ws://localhost:8545"
|
|
|
|
|
|
|
|
fixupInfuraUrls mainnetWssUrl
|
|
|
|
fixupInfuraUrls mainnetHttpUrl
|
|
|
|
fixupInfuraUrls mainnetHttpsUrl
|
|
|
|
fixupInfuraUrls goerliWssUrl
|
|
|
|
fixupInfuraUrls goerliHttpUrl
|
|
|
|
fixupInfuraUrls goerliHttpsUrl
|
|
|
|
fixupInfuraUrls gethUrl
|
|
|
|
|
|
|
|
check:
|
|
|
|
mainnetWssUrl == "wss://mainnet.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e"
|
|
|
|
mainnetHttpUrl == mainnetWssUrl
|
|
|
|
mainnetHttpsUrl == mainnetWssUrl
|
|
|
|
|
|
|
|
goerliWssUrl == "wss://goerli.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e"
|
|
|
|
goerliHttpUrl == goerliWssUrl
|
|
|
|
goerliHttpsUrl == goerliWssUrl
|
|
|
|
|
|
|
|
gethUrl == "ws://localhost:8545"
|
|
|
|
|