mirror of
https://github.com/aljazceru/crawler_v2.git
synced 2025-12-17 07:24:21 +01:00
moved around stuff
This commit is contained in:
@@ -17,6 +17,21 @@ var (
|
||||
pip string = "f683e87035f7ad4f44e0b98cfbd9537e16455a92cd38cefc4cb31db7557f5ef2"
|
||||
)
|
||||
|
||||
type mockChecker struct {
|
||||
pubkey string
|
||||
}
|
||||
|
||||
func (c mockChecker) Exists(ctx context.Context, pubkey string) (bool, error) {
|
||||
return pubkey == c.pubkey, nil
|
||||
}
|
||||
|
||||
func print(e *nostr.Event) error {
|
||||
fmt.Printf("\nevent ID: %v", e.ID)
|
||||
fmt.Printf("\nevent pubkey: %v", e.PubKey)
|
||||
fmt.Printf("\nevent kind: %d\n", e.Kind)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Manually change pip's follow list and see if the events gets printed. Works only with `go test`
|
||||
func TestFirehose(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(ctx, time.Second*20)
|
||||
@@ -41,18 +56,3 @@ func TestFetch(t *testing.T) {
|
||||
t.Fatalf("expected %d events, got %d", expected, len(events))
|
||||
}
|
||||
}
|
||||
|
||||
type mockChecker struct {
|
||||
pubkey string
|
||||
}
|
||||
|
||||
func (c mockChecker) Exists(ctx context.Context, pubkey string) (bool, error) {
|
||||
return pubkey == c.pubkey, nil
|
||||
}
|
||||
|
||||
func print(e *nostr.Event) error {
|
||||
fmt.Printf("\nevent ID: %v", e.ID)
|
||||
fmt.Printf("\nevent pubkey: %v", e.PubKey)
|
||||
fmt.Printf("\nevent kind: %d\n", e.Kind)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user