@@ -660,12 +660,15 @@ describe("PolymarketNotifier", function () {
660660
661661 describe ( "getPolymarketProposedPriceRequestsOO Filtering" , function ( ) {
662662 it ( "should return only events that are close enough to expiration (current time > expirationTimestamp - checkBeforeExpirationSeconds)" , async function ( ) {
663- const fakeRequester = "0xFAKE_REQUESTER" ;
663+ const fakeRequester = "0x0000000000000000000000000000000000000000" ; // Address 0
664664 // Set a fixed current time (in seconds)
665665 const fakeTime = 1600000000 ;
666666 // Stub Date.now() to return fakeTime * 1000
667667 const dateNowStub = sandbox . stub ( Date , "now" ) . returns ( fakeTime * 1000 ) ;
668668
669+ const identifier = formatBytes32String ( "TEST_IDENTIFIER" ) ;
670+ const ancillaryData = formatBytes32String ( "data" ) ;
671+
669672 // Create two fake events:
670673 // Event 1: expires at fakeTime + 100 seconds.
671674 // Calculation: (fakeTime + 100) - 120 = fakeTime - 20, so current time (fakeTime) > fakeTime - 20 => condition satisfied.
@@ -677,8 +680,9 @@ describe("PolymarketNotifier", function () {
677680 requester : fakeRequester ,
678681 expirationTimestamp : ethers . BigNumber . from ( fakeTime + 100 ) ,
679682 timestamp : ethers . BigNumber . from ( fakeTime - 50 ) ,
680- ancillaryData : "data" ,
683+ ancillaryData,
681684 proposedPrice : ethers . BigNumber . from ( 123 ) ,
685+ identifier,
682686 } ,
683687 } ;
684688 // Event 2: expires at fakeTime + 200 seconds.
@@ -691,15 +695,21 @@ describe("PolymarketNotifier", function () {
691695 requester : fakeRequester ,
692696 expirationTimestamp : ethers . BigNumber . from ( fakeTime + 200 ) ,
693697 timestamp : ethers . BigNumber . from ( fakeTime - 50 ) ,
694- ancillaryData : "data" ,
698+ ancillaryData,
695699 proposedPrice : ethers . BigNumber . from ( 456 ) ,
700+ identifier,
696701 } ,
697702 } ;
698703
699- // Stub paginatedEventQuery to return both fake events .
704+ // Stub paginatedEventQuery to return different results based on the filter type .
700705 const paginatedEventQueryStub = sandbox
701706 . stub ( commonModule , "paginatedEventQuery" )
702- . callsFake ( async ( ) => [ fakeEventBelow as any , fakeEventAbove as any ] ) ;
707+ . callsFake ( async ( oo , filter ) => {
708+ if ( filter . topics ?. [ 0 ] === oo . filters . DisputePrice ( null , null , null , null , null , null , null ) . topics ?. [ 0 ] ) {
709+ return [ ] ; // Return an empty array for DisputePrice filter
710+ }
711+ return [ fakeEventBelow as any , fakeEventAbove as any ] ; // Return existing data for ProposePrice filter
712+ } ) ;
703713
704714 const params = await createMonitoringParams ( ) ;
705715 // Set the parameter to 120 seconds.
0 commit comments