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

feat: add null_topic and null_stamp #958

Merged
merged 1 commit into from
Oct 24, 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
15 changes: 10 additions & 5 deletions src/utils/expose.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
import { BatchId, Topic } from '..'

export { getCollectionSize } from './collection'
export { getFolderSize } from './collection.node'

export {
Bytes,
FlexBytes,
assertBytes,
assertFlexBytes,
Bytes,
bytesAtOffset,
bytesEqual,
FlexBytes,
flexBytesAtOffset,
isBytes,
isFlexBytes,
} from './bytes'

export {
HexString,
PrefixedHexString,
assertHexString,
assertPrefixedHexString,
bytesToHex,
HexString,
hexToBytes,
intToHex,
isHexString,
makeHexString,
PrefixedHexString,
} from './hex'

export {
EthAddress,
capitalizeAddressERC55,
EthAddress,
ethToSwarmAddress,
fromLittleEndian,
isHexEthAddress,
Expand All @@ -52,3 +54,6 @@ export {
} from './stamps'

export { approximateOverheadForRedundancyLevel, getRedundancyStat, getRedundancyStats } from './redundancy'

export const NULL_STAMP: BatchId = '0000000000000000000000000000000000000000000000000000000000000000' as BatchId
export const NULL_TOPIC: Topic = '0000000000000000000000000000000000000000000000000000000000000000' as Topic
3 changes: 2 additions & 1 deletion test/integration/feed/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as chunkAPI from '../../../src/modules/chunk'
import { fetchLatestFeedUpdate } from '../../../src/modules/feed'
import type { BeeRequestOptions, BytesReference, PrivateKeyBytes, Signer, Topic } from '../../../src/types'
import { assertBytes, Bytes } from '../../../src/utils/bytes'
import { NULL_TOPIC } from '../../../src/utils/expose'
import { hexToBytes, makeHexString } from '../../../src/utils/hex'
import { beeKyOptions, getPostageBatch, testIdentity } from '../../utils'

Expand Down Expand Up @@ -44,7 +45,7 @@ describe('feed', () => {
const BEE_REQUEST_OPTIONS = beeKyOptions()
const owner = makeHexString(testIdentity.address, 40)
const signer = makePrivateKeySigner(hexToBytes(testIdentity.privateKey) as PrivateKeyBytes)
const topic = '0000000000000000000000000000000000000000000000000000000000000000' as Topic
const topic = NULL_TOPIC

it('empty feed update', async function () {
const emptyTopic = '1000000000000000000000000000000000000000000000000000000000000000' as Topic
Expand Down
3 changes: 2 additions & 1 deletion test/integration/modules/feed.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createFeedManifest, fetchLatestFeedUpdate } from '../../../src/modules/feed'
import { upload as uploadSOC } from '../../../src/modules/soc'
import type { Topic } from '../../../src/types'
import { NULL_TOPIC } from '../../../src/utils/expose'
import { HexString, hexToBytes, makeHexString } from '../../../src/utils/hex'
import { beeKyOptions, commonMatchers, getPostageBatch, testIdentity } from '../../utils'

Expand All @@ -9,7 +10,7 @@ commonMatchers()
describe('modules/feed', () => {
const BEE_REQUEST_OPTIONS = beeKyOptions()
const owner = makeHexString(testIdentity.address, 40)
const topic = '0000000000000000000000000000000000000000000000000000000000000000' as Topic
const topic = NULL_TOPIC

it('feed manifest creation', async function () {
const reference = '92442c3e08a308aeba8e2d231733ec57011a203354cad24129e7e0c37bac0cbe'
Expand Down
Loading