From 71e2acabb7623efb42c0686a7e46f8d44dc34678 Mon Sep 17 00:00:00 2001 From: Atticus Date: Mon, 24 Jun 2024 07:45:52 -0600 Subject: [PATCH] fix(transfer): return json parseable --- src/common/main.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/common/main.lua b/src/common/main.lua index 946e8ac..84a8575 100644 --- a/src/common/main.lua +++ b/src/common/main.lua @@ -87,7 +87,12 @@ function ant.init() elseif not msg.Cast then ao.send(utils.notices.debit(msg)) ao.send(utils.notices.credit(msg)) + return end + ao.send({ + Target = msg.From, + Data = transferResult, + }) end ) @@ -269,16 +274,16 @@ function ant.init() local recordNotice = { Target = msg.From, - Action = 'Record-Notice', + Action = "Record-Notice", Name = msg.Tags["Sub-Domain"], - Data = nameRes + Data = nameRes, } -- Add forwarded tags to the credit and debit notice messages for tagName, tagValue in pairs(msg) do -- Tags beginning with "X-" are forwarded if string.sub(tagName, 1, 2) == "X-" then - recordNotice[tagName] = tagValue + recordNotice[tagName] = tagValue end end @@ -292,15 +297,15 @@ function ant.init() -- Credit-Notice message template, that is sent to the Recipient of the transfer local recordsNotice = { Target = msg.From, - Action = 'Records-Notice', - Data = json.encode(records) + Action = "Records-Notice", + Data = json.encode(records), } -- Add forwarded tags to the records notice messages for tagName, tagValue in pairs(msg) do -- Tags beginning with "X-" are forwarded if string.sub(tagName, 1, 2) == "X-" then - recordsNotice[tagName] = tagValue + recordsNotice[tagName] = tagValue end end