Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(connect): stop adding random bits to empty data in aoconnect #945

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions connect/src/lib/message/upload-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function buildDataWith ({ logger }) {
*/
() => Resolved(ctx),
/**
* Just generate a random value for data
* No data is provided, so replace with one space
*/
() => Resolved(Math.random().toString().slice(-4))
() => Resolved(' ')
.map(assoc('data', __, ctx))
/**
* Since we generate the data value, we know it's Content-Type,
Expand Down
4 changes: 2 additions & 2 deletions connect/src/lib/monitor/upload-monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export function uploadMonitorWith (env) {
/**
* No tags or data can be provided right now,
*
* so just randomize data and set tags to an empty array
* so just set data to single space and set tags to an empty array
*/
data: Math.random().toString().slice(-4),
data: ' ',
tags: []
})
))
Expand Down
4 changes: 2 additions & 2 deletions connect/src/lib/spawn/upload-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ function buildDataWith ({ logger }) {
*/
() => Resolved(ctx),
/**
* Just generate a random value for data
* No data is provided, so replace with one space
*/
() => Resolved(Math.random().toString().slice(-4))
() => Resolved(' ')
.map(assoc('data', __, ctx))
/**
* Since we generate the data value, we know it's Content-Type,
Expand Down
4 changes: 2 additions & 2 deletions connect/src/lib/unmonitor/upload-unmonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export function uploadUnmonitorWith (env) {
/**
* No tags or data can be provided right now,
*
* so just randomize data and set tags to an empty array
* so just set data to single space and set tags to an empty array
*/
data: Math.random().toString().slice(-4),
data: ' ',
tags: []
})
))
Expand Down
2 changes: 1 addition & 1 deletion servers/mu/src/domain/clients/signer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { createData, ArweaveSigner } = pkg

function buildAndSignWith ({ MU_WALLET }) {
return async ({ processId, data, tags, anchor }) => {
data = data || Math.random().toString().slice(-4)
data = data || ' ' // If no data, send a single space
const signer = new ArweaveSigner(MU_WALLET)

const interactionDataItem = createData(data, signer, { target: processId, anchor, tags })
Expand Down