Skip to content

Commit

Permalink
fix: temporarily always-allow archive uploading (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
lautarodragan authored Jul 26, 2019
1 parent b7665eb commit 2e8913c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions src/controllers/ArchiveController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ export const ArchiveController = ({
if (!poeAddressVerified)
throw new PoeAddressNotVerified()

const poeBalance = await fetchPoeBalance(poeAddress)

if (poeBalance < poeBalanceMinimum)
throw new PoeBalanceInsufficient(poeBalanceMinimum, poeBalance)
// const poeBalance = await fetchPoeBalance(poeAddress)
//
// if (poeBalance < poeBalanceMinimum)
// throw new PoeBalanceInsufficient(poeBalanceMinimum, poeBalance)

return node.postArchive(archive)
}
Expand Down
46 changes: 23 additions & 23 deletions tests/integration/upload-archive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,29 +233,29 @@ describe('Try to upload an archive with Proof of POE but without POE balance', a

const fileStream = createReadStream(__filename)

const uploadArchiveOptions = {
method: 'post',
headers: {
token: apiKey,
},
body: fileStream,
}

const uploadResponse = await fetch(`${FROST_URL}${Path.ARCHIVES}`, uploadArchiveOptions)

assert({
given: `valid input and a "${uploadArchiveOptions.method}" request to ${Path.ARCHIVES}`,
should: 'fail',
actual: uploadResponse.ok,
expected: false,
})

assert({
given: `valid input and a "${uploadArchiveOptions.method}" request to ${Path.ARCHIVES}`,
should: 'fail',
actual: await uploadResponse.text(),
expected: 'Insufficient POE balance. You need at least 1000 POE. You currently have 0.',
})
// const uploadArchiveOptions = {
// method: 'post',
// headers: {
// token: apiKey,
// },
// body: fileStream,
// }

// const uploadResponse = await fetch(`${FROST_URL}${Path.ARCHIVES}`, uploadArchiveOptions)
//
// assert({
// given: `valid input and a "${uploadArchiveOptions.method}" request to ${Path.ARCHIVES}`,
// should: 'fail',
// actual: uploadResponse.ok,
// expected: false,
// })
//
// assert({
// given: `valid input and a "${uploadArchiveOptions.method}" request to ${Path.ARCHIVES}`,
// should: 'fail',
// actual: await uploadResponse.text(),
// expected: 'Insufficient POE balance. You need at least 1000 POE. You currently have 0.',
// })

await server.stop()
await db.teardown()
Expand Down

0 comments on commit 2e8913c

Please sign in to comment.