16 Commits

Author SHA1 Message Date
galargh
097b4671b0 chore: staticcheck 2024-08-06 19:52:49 +00:00
Steven Allen
1f5b81fb61
test: use the regular libp2p host (#565)
This removes dependencies on swarm/testing and the blank host.

1. swarm/testing really shouldn't be used at all except for internal
libp2p stuff.
2. The blank host should only be used in _very_ special cases (autonat,
mostly).
2024-07-11 10:32:18 +00:00
Marten Seemann
4f56e8f0a7
update go-libp2p to v0.22.0 (#498)
* update go-libp2p to v0.22.0

* skip TestGossipsubConnTagMessageDeliveries
2022-08-26 02:45:41 -07:00
Hlib Kanunnikov
96efa27a1a
feat: WithLocalPublication option to enable local only publishing on a topic (#481)
* feat: WithLocalPublication option to enable local only publishing on a topic

* docs: improve comment on WithLocalPublication option
2022-07-01 18:49:12 +03:00
Iulian Pascalau
0ea9140c95
Publishing option for signing a message with a custom private key (#486)
* - added PublishWithSk functionality on the Topic implementation

* - fixes after merge

* - complete refactor: used publishing options instead of a new function

* - added one more check in unit test

* - bugfix: use local variables instead of fields

* - renamed tests
2022-05-26 12:39:30 +03:00
Wondertan
be065ce051 tests: new test for WithTopicMsgIdFunction 2022-01-23 09:29:32 +02:00
Daniel Martí
5c90105738 support MinTopicSize without a discovery mechanism
That is, when MinTopicSize is used but not WithDiscovery,
Publish will keep waiting until MinTopicSize's condition is met.

At the moment, this is done by polling every 200ms.
In the future, the mechanism could be optimized to be event-based.
A TODO is left for that purpose.

Fixes #454.
2021-10-29 20:55:01 +03:00
Ian Davis
2efd313b83
cleanup: fix vet and staticcheck failures (#435)
* cleanup: fix vet failures and most staticcheck failures

* Fix remaining staticcheck failures

* Give test goroutines chance to exit early when context is canceled
2021-07-22 15:27:32 -07:00
gammazero
e25f98c402 Fix close of closed channel
This happens when there are multiple subscriptions to a topic and a single subscription is canceled twice.
2021-06-15 13:00:02 +03:00
Lukasz Zimnoch
9a0bd7ad56 Prevent multiple invocations of relay cancel function 2020-05-01 12:22:22 +03:00
Lukasz Zimnoch
f4f8f3ec12 Fix race in the TestTopicRelayReuse 2020-05-01 12:22:22 +03:00
Lukasz Zimnoch
e72d15cc90 Tests for topic relay 2020-05-01 12:22:22 +03:00
vyzo
3368bed1d4 disable flaky and irrelevant tests 2020-04-18 11:09:06 +03:00
Adin Schmahmann
ad97d9bf17 fixed closed Topic handles still being able to perform some actions on the topic 2019-11-02 19:28:44 -04:00
Adin Schmahmann
899f9cd62b fixed Topic close error 2019-11-01 17:12:23 -04:00
Adin Schmahmann
5ef7439d71 interface: New Topic + TopicEventHandlers objects.
Added PubSub.Join(topic) that returns a Topic object. This object can be Subscribed and Published to as well as to get a TopicEventHandler for topic events. This means that the Subscription object will no longer handle PeerEvents and that PubSub's Publish and Subscribe functions are deprecated.
2019-10-31 15:37:44 -04:00