sign hardcoded requests

This commit is contained in:
terminal
2022-07-08 17:18:42 +04:00
parent ede552be59
commit 3d44b99346

View File

@@ -218,7 +218,11 @@ open class NativeCall(
api.read(JsonRpcRequest(ctx.payload.method, ctx.payload.params, ctx.nonce))
.flatMap(JsonRpcResponse::requireResult)
.map {
CallResult.ok(ctx.id, ctx.nonce, it, null)
if (ctx.nonce != null) {
CallResult.ok(ctx.id, ctx.nonce, it, signer.sign(ctx.nonce, it, ctx.upstream))
} else {
CallResult.ok(ctx.id, null, it, null)
}
}
}.switchIfEmpty(
Mono.just(ctx).flatMap(this::executeOnRemote)