solution: allows to disable upstream validation
This commit is contained in:
@@ -96,6 +96,22 @@ class UpstreamsConfigReaderSpec extends Specification {
|
||||
}
|
||||
}
|
||||
|
||||
def "Parse config with options"() {
|
||||
setup:
|
||||
def config = this.class.getClassLoader().getResourceAsStream("upstreams-options.yaml")
|
||||
when:
|
||||
def act = reader.read(config)
|
||||
then:
|
||||
act != null
|
||||
act.upstreams.size() == 2
|
||||
with(act.upstreams.get(0)) {
|
||||
options.minPeers == 7
|
||||
}
|
||||
with(act.upstreams.get(1)) {
|
||||
options.disableValidation == true
|
||||
}
|
||||
}
|
||||
|
||||
def "Post process for usual strings"() {
|
||||
expect:
|
||||
s == reader.postProcess(s)
|
||||
|
||||
33
src/test/resources/upstreams-options.yaml
Normal file
33
src/test/resources/upstreams-options.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
version: v1
|
||||
|
||||
defaultOptions:
|
||||
- chains:
|
||||
- ethereum
|
||||
options:
|
||||
disable-syncing: true
|
||||
min-peers: 3
|
||||
|
||||
upstreams:
|
||||
- id: local
|
||||
chain: ethereum
|
||||
options:
|
||||
min-peers: 7
|
||||
connection:
|
||||
ethereum:
|
||||
rpc:
|
||||
url: "http://localhost:8545"
|
||||
ws:
|
||||
url: "ws://localhost:8546"
|
||||
origin: "http://localhost"
|
||||
- id: infura
|
||||
chain: ethereum
|
||||
options:
|
||||
disable-validation: true
|
||||
connection:
|
||||
ethereum:
|
||||
rpc:
|
||||
url: "https://mainnet.infura.io/v3/fa28c968191849c1aff541ad1d8511f2"
|
||||
auth:
|
||||
type: basic
|
||||
username: 4fc258fe41a68149c199ad8f281f2015
|
||||
password: 1a68f20154fc258fe4149c199ad8f281
|
||||
Reference in New Issue
Block a user