Skip to content

Commit

Permalink
fix: remove check for pinned content in reupload (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
AuHau committed Sep 15, 2021
1 parent e58b8e8 commit 6032a22
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
10 changes: 0 additions & 10 deletions src/bee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,16 +514,6 @@ export class Bee {
async reuploadPinnedData(reference: Reference | string): Promise<void> {
assertReference(reference)

try {
// TODO: This should be detected by Bee, but until https://github.com/ethersphere/bee/issues/1803 is resolved
// it is good idea to do some input validation on our side.
await this.getPin(reference)
} catch (e) {
if (e.status === 404) {
throw new BeeArgumentError('The passed reference is not locally pinned!', reference)
}
}

await stewardship.reupload(this.ky, reference)
}

Expand Down
7 changes: 0 additions & 7 deletions test/integration/bee-class.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,6 @@ describe('Bee class', () => {
await sleep(10)
await bee.reuploadPinnedData(result.reference) // Does not return anything, but will throw exception if something is going wrong
})

it('should throw error if data is not pinned', async () => {
const content = randomByteArray(16, Date.now())

const result = await bee.uploadData(getPostageBatch(), content)
await expect(bee.reuploadPinnedData(result.reference)).rejects.toThrowError(BeeArgumentError)
})
})

describe('pss', () => {
Expand Down

0 comments on commit 6032a22

Please sign in to comment.