Skip to content

Commit

Permalink
refactor(mu): add Type Message to all build and signs #1025
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremiahstockdale committed Oct 16, 2024
1 parent 253a9ee commit b9288ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion servers/mu/src/domain/lib/build-tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,19 @@ export function buildTxWith (env) {
.map((res) => {
const tagsIn = [
{ name: 'Data-Protocol', value: 'ao' },
{ name: 'Type', value: 'Message' },
...ctx.cachedMsg.msg.Tags?.filter((tag) => {
return ![
const isExcludedName = [
'Data-Protocol',
'Variant',
'From-Process',
'From-Module',
'Assignments'
].includes(tag.name)

const isTypeMessage = tag.name === 'Type' && tag.value === 'Message'

return !isExcludedName && !isTypeMessage
}) ?? [],
{ name: 'Variant', value: 'ao.TN.1' },
{ name: 'From-Process', value: ctx.cachedMsg.fromProcessId },
Expand Down
3 changes: 3 additions & 0 deletions servers/mu/src/domain/lib/build-tx.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ async function buildAndSign ({ processId, tags, anchor }) {
assert.equal(tags.find((tag) =>
tag.name === 'From-Process'
).value, 'process-123')
assert.equal(tags.find((tag) =>
tag.name === 'Type'
).value, 'Message')
assert.equal(tags.filter((tag) =>
tag.name === 'From-Process'
).length, 1)
Expand Down

0 comments on commit b9288ca

Please sign in to comment.