From aeea27bb702b1d81591dddd1cae468ffdc3b4327 Mon Sep 17 00:00:00 2001 From: Vyacheslav Shebanov Date: Sat, 4 Jun 2022 01:30:17 +0300 Subject: [PATCH] problem: manual integration tests don't work --- testing/dshackle/dshackle-basic.yaml | 7 +++---- testing/trial/build.gradle | 8 +------- .../trial/basicproxy/StandardCallsSpec.groovy | 13 ++++++++++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/testing/dshackle/dshackle-basic.yaml b/testing/dshackle/dshackle-basic.yaml index 3e1a6dad..51318221 100644 --- a/testing/dshackle/dshackle-basic.yaml +++ b/testing/dshackle/dshackle-basic.yaml @@ -31,11 +31,10 @@ cache: redis: enabled: false -signature: +signed-response: enabled: true - algorithm: ECDSA - signatureScheme: SHA256withECDSA - privateKey: "./test_key" + algorithm: SECP256K1 + private-key: "./test_key" proxy: port: 18080 diff --git a/testing/trial/build.gradle b/testing/trial/build.gradle index 420a6ca1..2b880154 100644 --- a/testing/trial/build.gradle +++ b/testing/trial/build.gradle @@ -17,19 +17,13 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:2.9.8" implementation "io.grpc:grpc-netty:1.46.0" 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' } 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 { systemProperty "trialMode", project.getProperty("dshackleTrialMode") diff --git a/testing/trial/src/test/groovy/io/emeraldpay/dshackle/testing/trial/basicproxy/StandardCallsSpec.groovy b/testing/trial/src/test/groovy/io/emeraldpay/dshackle/testing/trial/basicproxy/StandardCallsSpec.groovy index ec24e40d..bf11f266 100644 --- a/testing/trial/src/test/groovy/io/emeraldpay/dshackle/testing/trial/basicproxy/StandardCallsSpec.groovy +++ b/testing/trial/src/test/groovy/io/emeraldpay/dshackle/testing/trial/basicproxy/StandardCallsSpec.groovy @@ -144,16 +144,23 @@ class StandardCallsSpec extends Specification { def sep = "/".bytes def digest = MessageDigest.getInstance("SHA-256") 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: (new String(act.payload.toByteArray())) == "\"0x100001\"" - sig.verify(act.signature.sig.toByteArray()) + sig.verify(act.signature.signature.toByteArray()) } def "check response signature without nonce"() { when: def act = client_proto.executeNative("eth_blockNumber", [], 0L) then: - act.signature.sig.isEmpty() + act.signature.signature.isEmpty() } }