Skip to content

Commit

Permalink
fix(transfer): return json parseable
Browse files Browse the repository at this point in the history
  • Loading branch information
Atticus committed Jun 24, 2024
1 parent 2e10375 commit 71e2aca
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/common/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 71e2aca

Please sign in to comment.