solution: WS-only Ethereum upstream
This commit is contained in:
@@ -74,6 +74,32 @@ class UpstreamsConfigReaderSpec extends Specification {
|
||||
}
|
||||
}
|
||||
|
||||
def "Parse websocket-only config"() {
|
||||
setup:
|
||||
def config = this.class.getClassLoader().getResourceAsStream("upstreams-ws-only.yaml")
|
||||
when:
|
||||
def act = reader.read(config)
|
||||
then:
|
||||
act != null
|
||||
act.upstreams.size() == 1
|
||||
with(act.upstreams.get(0)) {
|
||||
id == "local"
|
||||
chain == "ethereum"
|
||||
connection instanceof UpstreamsConfig.EthereumConnection
|
||||
with((UpstreamsConfig.EthereumConnection) connection) {
|
||||
rpc == null
|
||||
ws != null
|
||||
ws.url == new URI("ws://localhost:8546")
|
||||
ws.basicAuth != null
|
||||
with(ws.basicAuth) {
|
||||
username == "9c199ad8f281f20154fc258fe41a6814"
|
||||
password == "258fe4149c199ad8f2811a68f20154fc"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def "Parse bitcoin upstreams"() {
|
||||
setup:
|
||||
def config = this.class.getClassLoader().getResourceAsStream("upstreams-bitcoin.yaml")
|
||||
|
||||
13
src/test/resources/upstreams-ws-only.yaml
Normal file
13
src/test/resources/upstreams-ws-only.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
version: v1
|
||||
|
||||
upstreams:
|
||||
- id: local
|
||||
chain: ethereum
|
||||
connection:
|
||||
ethereum:
|
||||
ws:
|
||||
url: "ws://localhost:8546"
|
||||
origin: "http://localhost"
|
||||
basic-auth:
|
||||
username: 9c199ad8f281f20154fc258fe41a6814
|
||||
password: 258fe4149c199ad8f2811a68f20154fc
|
||||
Reference in New Issue
Block a user