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:
enabled: false
signature:
signed-response:
enabled: true
algorithm: ECDSA
signatureScheme: SHA256withECDSA
privateKey: "./test_key"
algorithm: SECP256K1
private-key: "./test_key"
proxy:
port: 18080

View File

@@ -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")

View File

@@ -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()
}
}