Skip to content

Commit

Permalink
fix: change feed index type to index (#900)
Browse files Browse the repository at this point in the history
* fix: change feed index type to index

* chore: format
  • Loading branch information
Cafe137 committed Jan 17, 2024
1 parent 073a543 commit a600f12
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/bee-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ export class BeeDebug {
}
} catch (error: any) {

Check warning on line 763 in src/bee-debug.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Unexpected any. Specify a different type
const message = error?.response?.data?.message || error?.message || ''

if (!message.includes('batch not usable')) {
throw error
}
Expand Down
6 changes: 3 additions & 3 deletions src/feed/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
BatchId,
BeeRequestOptions,
BytesReference,
FEED_INDEX_HEX_LENGTH,
FeedReader,
FeedWriter,
FEED_INDEX_HEX_LENGTH,
PlainBytesReference,
Reference,
Signer,
Expand All @@ -19,7 +19,7 @@ import {
import { Bytes, bytesAtOffset, makeBytes } from '../utils/bytes'
import { EthAddress, HexEthAddress, makeHexEthAddress } from '../utils/eth'
import { keccak256Hash } from '../utils/hash'
import { bytesToHex, HexString, hexToBytes, makeHexString } from '../utils/hex'
import { HexString, bytesToHex, hexToBytes, makeHexString } from '../utils/hex'
import { makeBytesReference } from '../utils/reference'
import { assertAddress } from '../utils/type'
import { readUint64BigEndian, writeUint64BigEndian } from '../utils/uint64'
Expand Down Expand Up @@ -125,7 +125,7 @@ export function makeFeedReader(
owner,
topic,
async download(options?: FeedUpdateOptions): Promise<FetchFeedUpdateResponse> {
if (!options?.index && options?.index !== 0 {
if (!options?.index && options?.index !== 0) {
return fetchLatestFeedUpdate(requestOptions, owner, topic, { ...options, type })
}

Expand Down
5 changes: 3 additions & 2 deletions src/modules/feed.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Index } from '../feed'
import { FeedType } from '../feed/type'
import { BatchId, BeeRequestOptions, Reference, ReferenceResponse, Topic } from '../types'
import { BeeError } from '../utils/error'
Expand Down Expand Up @@ -25,14 +26,14 @@ export interface FeedUpdateOptions {
/**
* Fetch specific previous Feed's update (default fetches latest update)
*/
index?: string
index?: Index
}

interface FeedUpdateHeaders {
/**
* The current feed's index
*/
feedIndex: string
feedIndex: Index

/**
* The feed's index for next update.
Expand Down

0 comments on commit a600f12

Please sign in to comment.