Skip to content

Commit 9d112d2

Browse files
test: test the retrievability of data uploaded with stamper (#1086)
* test: test the retrievability of data uploaded with stamper * test: update test coverage * test: undo * test: update test coverage --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 1482a85 commit 9d112d2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/integration/stamper.spec.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Types } from 'cafe-utility'
1+
import { Strings, Types } from 'cafe-utility'
22
import { Bytes, MerkleTree, Stamper } from '../../src'
33
import { makeBee } from '../utils'
44

5-
test('Stamper', async () => {
5+
test('Stamper utilization state', async () => {
66
const bee = makeBee()
77

88
const stamper = Stamper.fromBlank(
@@ -11,7 +11,9 @@ test('Stamper', async () => {
1111
17,
1212
)
1313

14-
const payload = Bytes.fromUtf8('Hello, client side stamper!')
14+
const payload = Bytes.fromUtf8(
15+
`Hello, client side stamper! This is a unique test payload: ${Strings.randomAlphanumeric(32)}`,
16+
)
1517

1618
const tree = new MerkleTree(async chunk => {
1719
await bee.uploadChunk(stamper.stamp(chunk), chunk.build())
@@ -33,4 +35,7 @@ test('Stamper', async () => {
3335

3436
nextStamper.stamp(rootChunk)
3537
expect(() => nextStamper.stamp(rootChunk)).toThrow('Bucket is full')
38+
39+
const data = await bee.downloadData(rootChunk.hash())
40+
expect(data.toUtf8()).toEqual(payload.toUtf8())
3641
})

0 commit comments

Comments
 (0)