From 8970b2cd7061e520b34befe1ddd7006bcf5555f2 Mon Sep 17 00:00:00 2001 From: Lean Mendoza Date: Fri, 12 Jan 2024 16:04:13 -0300 Subject: [PATCH] fix: sendAsync format the response as jsonRPC (#164) --- .../src/dcl/js/js_modules/EthereumController.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rust/decentraland-godot-lib/src/dcl/js/js_modules/EthereumController.js b/rust/decentraland-godot-lib/src/dcl/js/js_modules/EthereumController.js index 59a9be0a..91684c58 100644 --- a/rust/decentraland-godot-lib/src/dcl/js/js_modules/EthereumController.js +++ b/rust/decentraland-godot-lib/src/dcl/js/js_modules/EthereumController.js @@ -32,7 +32,17 @@ module.exports.sendAsync = async function (message) { throw new Error(`The Ethereum method "${message.method}" is not allowed on Decentraland Provider`) } - return Deno.core.ops.op_send_async(message.method, message.jsonParams) + const resValue = await Deno.core.ops.op_send_async(message.method, message.jsonParams) + + const result = { + id: message.id, + jsonrpc: "2.0", + result: resValue + } + + return { + jsonAnyResponse: JSON.stringify(result) + } } module.exports.requirePayment = async function (body) {