File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { dhtRoutingKey, ipnsMetadataKey } from '../src/utils.ts'
1313import { createIPNS } from './fixtures/create-ipns.js'
1414import type { IPNS } from '../src/ipns.js'
1515import type { CreateIPNSResult } from './fixtures/create-ipns.js'
16+ import { REPUBLISH_THRESHOLD } from '../src/constants.ts'
1617
1718// Helper to await until a stub is called
1819function waitForStubCall ( stub : sinon . SinonStub , callCount = 1 ) : Promise < void > {
@@ -148,8 +149,9 @@ describe('republish', () => {
148149 const record = await createIPNSRecord ( key , testCid , 1n , 24 * 60 * 60 * 1000 )
149150 const routingKey = multihashToIPNSRoutingKey ( key . publicKey . toMultihash ( ) )
150151
151- // create a dht record with a created time < now - REPUBLISH_THRESHOLD
152- const dhtRecord = new Record ( routingKey , marshalIPNSRecord ( record ) , new Date ( Date . now ( ) - 24 * 60 * 60 * 1000 ) )
152+ // create a dht record with a timeReceived < now - REPUBLISH_THRESHOLD
153+ const timeReceived = new Date ( Date . now ( ) - REPUBLISH_THRESHOLD - 60 * 60 * 1000 )
154+ const dhtRecord = new Record ( routingKey , marshalIPNSRecord ( record ) , timeReceived )
153155
154156 // Store the dht record and metadata in the real datastore
155157 await result . datastore . put ( dhtRoutingKey ( routingKey ) , dhtRecord . serialize ( ) )
You can’t perform that action at this time.
0 commit comments