polyswarmclient.events
¶
Module Contents¶
-
class
polyswarmclient.events.
Callback
[source]¶ Bases:
object
Abstract callback class which is the parent to a number of child callback classes to be used in different scenarios.
Note
Classes which extend Callback are expected to impliment the run method.
-
class
polyswarmclient.events.
OnRunCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon entering the event loop for the first time, use for initialization
-
class
polyswarmclient.events.
OnStopCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called when the client is stopping
This can happen on errors, or due to a signal
-
class
polyswarmclient.events.
OnNewBlockCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon receiving a new block, scheduled events triggered separately
-
class
polyswarmclient.events.
OnNewBountyCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon receiving a new bounty
-
class
polyswarmclient.events.
OnNewAssertionCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon receiving a new assertion
-
class
polyswarmclient.events.
OnRevealAssertionCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon receiving a new assertion reveal
-
class
polyswarmclient.events.
OnNewVoteCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon receiving a new arbiter vote
-
class
polyswarmclient.events.
OnQuorumReachedCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon a bounty reaching quorum
-
class
polyswarmclient.events.
OnSettledBountyCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon a bounty being settled
-
class
polyswarmclient.events.
OnDeprecatedCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon the BountyRegistry contract being deprecated
-
class
polyswarmclient.events.
OnInitializedChannelCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called upon a channel being initialized
-
class
polyswarmclient.events.
Schedule
[source]¶ Bases:
object
Generic Schedule class. Uses a PriorityQueue data structure to store Events.
-
empty
(self)[source]¶ Return True if the queue is empty.
- Returns
Is the queue empty.
- Return type
boolean
-
peek
(self)[source]¶ Return True if the queue is empty.
- Returns
Tuple at the front of the queue if the queue is full, else None.
- Return type
(block, event)
-
-
class
polyswarmclient.events.
Event
(guid)[source]¶ Bases:
object
Generic Event class. Stores GUID and can compare for equality and order Events.
- Parameters
guid (str, None) – GUID of the event.
-
class
polyswarmclient.events.
RevealAssertion
(guid, index, nonce, verdicts, metadata)[source]¶ Bases:
polyswarmclient.events.Event
An assertion scheduled to be publically revealed
- Parameters
guid (str) – GUID of the bounty being asserted on
index (int) – Index of the assertion to reveal
nonce (str) – Secret nonce used to reveal assertion
verdicts (List[bool]) – List of verdicts for each artifact in the bounty
metadata (str) – Optional metadata
-
class
polyswarmclient.events.
OnRevealAssertionDueCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called when an assertion is needing to be revealed
-
class
polyswarmclient.events.
VoteOnBounty
(guid, votes, valid_bloom)[source]¶ Bases:
polyswarmclient.events.Event
A scheduled vote from an arbiter :param guid: GUID of the bounty being voted on :type guid: str :param votes: List of votes for each artifact in the bounty :type votes: List[bool] :param valid_bloom: Is the bloom filter submitted with the bounty valid :type valid_bloom: bool
-
class
polyswarmclient.events.
OnVoteOnBountyDueCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called when a bounty is needing to be voted on
-
class
polyswarmclient.events.
SettleBounty
(guid)[source]¶ Bases:
polyswarmclient.events.Event
A bounty scheduled to be settled :param guid: GUID of the bounty being asserted on :type guid: str
-
class
polyswarmclient.events.
OnSettleBountyDueCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called when a bounty is needing to be settled
-
class
polyswarmclient.events.
WithdrawStake
(amount)[source]¶ Bases:
polyswarmclient.events.Event
A scheduled stake withdrawal from an arbiter
- Parameters
amount (int) – Amount to withdraw from stake
-
class
polyswarmclient.events.
OnWithdrawStakeDueCallback
[source]¶ Bases:
polyswarmclient.events.Callback
Called when a an arbiter needs to withdraw stake (due to deprecation)