From c97076413eb7b7a3aef3e57561dbdc74a30d021f Mon Sep 17 00:00:00 2001 From: sagar sapkota Date: Fri, 29 Nov 2024 14:49:17 +0545 Subject: [PATCH] re-fix the previous update --- .../balanced/score/core/router/RouterImpl.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core-contracts/Router/src/main/java/network/balanced/score/core/router/RouterImpl.java b/core-contracts/Router/src/main/java/network/balanced/score/core/router/RouterImpl.java index a321f6f53..fd767e3bb 100644 --- a/core-contracts/Router/src/main/java/network/balanced/score/core/router/RouterImpl.java +++ b/core-contracts/Router/src/main/java/network/balanced/score/core/router/RouterImpl.java @@ -261,8 +261,11 @@ private void executeRoute(String _from, byte[] data) { } else { receiver = _from; } - - route(receiver, fromToken, routeData.actions, minimumReceive, EMPTY_DATA); + byte[] _data = EMPTY_DATA; + if(routeData.data!=null){ + _data = routeData.data; + } + route(receiver, fromToken, routeData.actions, minimumReceive, _data); } private void jsonRoute(String _from, byte[] data) { @@ -308,7 +311,11 @@ private void jsonRoute(String _from, byte[] data) { } Address fromToken = Context.getCaller(); - route(receiver, fromToken, actions, minimumReceive, EMPTY_DATA); + byte[] _data = EMPTY_DATA; + if(params.get("data")!=null){ + _data = params.get("data").asString().getBytes(); + } + route(receiver, fromToken, actions, minimumReceive, _data); } @Payable @@ -318,4 +325,4 @@ public void fallback() { @EventLog(indexed = 1) public void Route(Address from, BigInteger fromAmount, Address to, BigInteger toAmount) { } -} +} \ No newline at end of file