@@ -478,7 +478,7 @@ describe('EventMessageHandler', () => {
478478 expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . be . undefined
479479 } )
480480
481- it ( 'returns undefined if pubkey is not blacklisted by prefix ' , ( ) => {
481+ it ( 'returns undefined if pubkey is not blacklisted if list entry is not exact match ' , ( ) => {
482482 eventLimits . pubkey . blacklist = [ 'aa55' ]
483483 event . pubkey = 'aabbcc'
484484 expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . be . undefined
@@ -490,10 +490,10 @@ describe('EventMessageHandler', () => {
490490 expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . equal ( 'blocked: pubkey not allowed' )
491491 } )
492492
493- it ( 'returns reason if pubkey is blacklisted by prefix ' , ( ) => {
493+ it ( 'returns undefined if pubkey extends a blacklist entry but is not an exact match ' , ( ) => {
494494 eventLimits . pubkey . blacklist = [ 'aa55' ]
495495 event . pubkey = 'aa55ccddeeff'
496- expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . equal ( 'blocked: pubkey not allowed' )
496+ expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . be . undefined
497497 } )
498498 } )
499499
@@ -509,10 +509,10 @@ describe('EventMessageHandler', () => {
509509 expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . be . undefined
510510 } )
511511
512- it ( 'returns undefined if pubkey is whitelisted by prefix ' , ( ) => {
512+ it ( 'returns reason if pubkey extends a whitelist entry but is not an exact match ' , ( ) => {
513513 eventLimits . pubkey . whitelist = [ 'aa55' ]
514514 event . pubkey = 'aa55ccddeeff'
515- expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . be . undefined
515+ expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . equal ( 'blocked: pubkey not allowed' )
516516 } )
517517
518518 it ( 'returns reason if pubkey is not whitelisted' , ( ) => {
@@ -521,7 +521,7 @@ describe('EventMessageHandler', () => {
521521 expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . equal ( 'blocked: pubkey not allowed' )
522522 } )
523523
524- it ( 'returns reason if pubkey is not whitelisted by prefix ' , ( ) => {
524+ it ( 'returns reason if pubkey is not whitelisted by exact match ' , ( ) => {
525525 eventLimits . pubkey . whitelist = [ 'aa55' ]
526526 event . pubkey = 'aabbccddeeff'
527527 expect ( ( handler as any ) . canAcceptEvent ( event ) ) . to . equal ( 'blocked: pubkey not allowed' )
0 commit comments