nimbus-eth2/tests/test_eth1_monitor.nim
Mamy Ratsimbazafy 2f17ac7b64
Move SSZ, deposit_contracts & eth1_monitor [reorg files 3/5] (#2371)
* move deposit_contract

* Move SSZ

* fix ssz import in tests

* move also eth1_monitor

* forgot to delete the original

* fix comma [skip ci]

* Fix "make" & tools imports

* Fix import

* Fix import again

* rename deposit_contract -> eth1

* Revert ssz move to subfolder

* path fixes [skip ci]
2021-03-03 07:23:05 +01:00

50 lines
1.7 KiB
Nim

{.used.}
import
unittest,
chronos, web3/ethtypes,
../beacon_chain/eth1/eth1_monitor
suite "Eth1 Chain":
discard
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"
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
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
gethHttpUrl == gethWsUrl
gethHttpsUrl == gethWsUrl
unspecifiedProtocolUrl == gethWsUrl
gethWsUrl == "ws://localhost:8545"