problem: manual integration tests don't work

This commit is contained in:
Vyacheslav Shebanov
2022-06-04 01:30:17 +03:00
committed by GitHub
parent 1b3e35eb1e
commit aeea27bb70
3 changed files with 14 additions and 14 deletions

View File

@@ -31,11 +31,10 @@ cache:
redis: redis:
enabled: false enabled: false
signature: signed-response:
enabled: true enabled: true
algorithm: ECDSA algorithm: SECP256K1
signatureScheme: SHA256withECDSA private-key: "./test_key"
privateKey: "./test_key"
proxy: proxy:
port: 18080 port: 18080

View File

@@ -17,19 +17,13 @@ dependencies {
implementation "com.fasterxml.jackson.core:jackson-databind:2.9.8" implementation "com.fasterxml.jackson.core:jackson-databind:2.9.8"
implementation "io.grpc:grpc-netty:1.46.0" implementation "io.grpc:grpc-netty:1.46.0"
implementation "org.bouncycastle:bcprov-jdk15on:1.61" implementation "org.bouncycastle:bcprov-jdk15on:1.61"
implementation("io.emeraldpay:emerald-api:0.11.1") { implementation("io.emeraldpay:emerald-api:0.12-alpha.1") {
exclude group: 'com.salesforce.servicelibs', module: 'reactor-grpc' exclude group: 'com.salesforce.servicelibs', module: 'reactor-grpc'
} }
testImplementation "org.spockframework:spock-core:2.0-M3-groovy-3.0" testImplementation "org.spockframework:spock-core:2.0-M3-groovy-3.0"
} }
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module("io.emeraldpay:emerald-api") using project(":api") because "we work with the unreleased development version"
}
}
test { test {
systemProperty "trialMode", project.getProperty("dshackleTrialMode") systemProperty "trialMode", project.getProperty("dshackleTrialMode")

View File

@@ -144,16 +144,23 @@ class StandardCallsSpec extends Specification {
def sep = "/".bytes def sep = "/".bytes
def digest = MessageDigest.getInstance("SHA-256") def digest = MessageDigest.getInstance("SHA-256")
def messageHash = digest.digest(act.payload.toByteArray()) def messageHash = digest.digest(act.payload.toByteArray())
sig.update(Bytes.concat("DSHACKLESIG".bytes, sep, Longs.toByteArray(10), sep, messageHash)) def sigmessage = Bytes.concat("DSHACKLESIG".bytes,
sep,
10L.toString().bytes,
sep,
act.signature.upstreamId.bytes,
sep,
Hex.encodeHexString(messageHash).bytes)
sig.update(sigmessage)
then: then:
(new String(act.payload.toByteArray())) == "\"0x100001\"" (new String(act.payload.toByteArray())) == "\"0x100001\""
sig.verify(act.signature.sig.toByteArray()) sig.verify(act.signature.signature.toByteArray())
} }
def "check response signature without nonce"() { def "check response signature without nonce"() {
when: when:
def act = client_proto.executeNative("eth_blockNumber", [], 0L) def act = client_proto.executeNative("eth_blockNumber", [], 0L)
then: then:
act.signature.sig.isEmpty() act.signature.signature.isEmpty()
} }
} }