Skip to content

Commit

Permalink
re-fix the previous update
Browse files Browse the repository at this point in the history
  • Loading branch information
sagars committed Nov 29, 2024
1 parent 4c2f87a commit c970764
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -318,4 +325,4 @@ public void fallback() {
@EventLog(indexed = 1)
public void Route(Address from, BigInteger fromAmount, Address to, BigInteger toAmount) {
}
}
}

0 comments on commit c970764

Please sign in to comment.