mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Update outdated or incorrect docstrings (#748)
This commit is contained in:
parent
2dd9249f21
commit
d93f6f873b
@ -19,14 +19,9 @@ def start_rethinkdb():
|
|||||||
"""Start RethinkDB as a child process and wait for it to be
|
"""Start RethinkDB as a child process and wait for it to be
|
||||||
available.
|
available.
|
||||||
|
|
||||||
Args:
|
|
||||||
wait_for_db (bool): wait for the database to be ready
|
|
||||||
extra_opts (list): a list of extra options to be used when
|
|
||||||
starting the db
|
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
``bigchaindb.common.exceptions.StartupError`` if RethinkDB cannot
|
:class:`~bigchaindb.common.exceptions.StartupError` if
|
||||||
be started.
|
RethinkDB cannot be started.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
proc = subprocess.Popen(['rethinkdb', '--bind', 'all'],
|
proc = subprocess.Popen(['rethinkdb', '--bind', 'all'],
|
||||||
|
@ -198,10 +198,10 @@ class Bigchain(object):
|
|||||||
the return value is then a tuple: (tx, status)
|
the return value is then a tuple: (tx, status)
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A dict with the transaction details if the transaction was found.
|
A :class:`~.models.Transaction` instance if the transaction
|
||||||
Will add the transaction status to payload ('valid', 'undecided',
|
was found, otherwise ``None``.
|
||||||
or 'backlog'). If no transaction with that `txid` was found it
|
If :attr:`include_status` is ``True``, also returns the
|
||||||
returns `None`
|
transaction's status if the transaction was found.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
response, tx_status = None, None
|
response, tx_status = None, None
|
||||||
@ -412,14 +412,14 @@ class Bigchain(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def get_owned_ids(self, owner):
|
def get_owned_ids(self, owner):
|
||||||
"""Retrieve a list of `txids` that can we used has inputs.
|
"""Retrieve a list of `txid`s that can be used as inputs.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
owner (str): base58 encoded public key.
|
owner (str): base58 encoded public key.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
list (TransactionLink): list of `txid`s and `cid`s pointing to
|
:obj:`list` of TransactionLink: list of `txid`s and `cid`s
|
||||||
another transaction's condition
|
pointing to another transaction's condition
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# get all transactions in which owner is in the `owners_after` list
|
# get all transactions in which owner is in the `owners_after` list
|
||||||
@ -587,11 +587,11 @@ class Bigchain(object):
|
|||||||
return block
|
return block
|
||||||
|
|
||||||
def vote(self, block_id, previous_block_id, decision, invalid_reason=None):
|
def vote(self, block_id, previous_block_id, decision, invalid_reason=None):
|
||||||
"""Cast your vote on the block given the previous_block_hash and the decision (valid/invalid)
|
"""Create a signed vote for a block given the
|
||||||
return the block to the updated in the database.
|
:attr:`previous_block_id` and the :attr:`decision` (valid/invalid).
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
block_id (str): The id of the block to vote.
|
block_id (str): The id of the block to vote on.
|
||||||
previous_block_id (str): The id of the previous block.
|
previous_block_id (str): The id of the previous block.
|
||||||
decision (bool): Whether the block is valid or invalid.
|
decision (bool): Whether the block is valid or invalid.
|
||||||
invalid_reason (Optional[str]): Reason the block is invalid
|
invalid_reason (Optional[str]): Reason the block is invalid
|
||||||
|
@ -26,8 +26,8 @@ class StaleTransactionMonitor:
|
|||||||
Args:
|
Args:
|
||||||
timeout: how often to check for stale tx (in sec)
|
timeout: how often to check for stale tx (in sec)
|
||||||
backlog_reassign_delay: How stale a transaction should
|
backlog_reassign_delay: How stale a transaction should
|
||||||
be before reassignment (in sec). If supplied, overrides the
|
be before reassignment (in sec). If supplied, overrides
|
||||||
Bigchain default value.
|
the Bigchain default value.
|
||||||
"""
|
"""
|
||||||
self.bigchain = Bigchain(backlog_reassign_delay=backlog_reassign_delay)
|
self.bigchain = Bigchain(backlog_reassign_delay=backlog_reassign_delay)
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
@ -13,16 +13,16 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class ChangeFeed(Node):
|
class ChangeFeed(Node):
|
||||||
"""This class wraps a RethinkDB changefeed adding a `prefeed`.
|
"""This class wraps a RethinkDB changefeed adding a ``prefeed``.
|
||||||
|
|
||||||
It extends the ``multipipes::Node`` class to make it pluggable in
|
It extends :class:`multipipes.Node` to make it pluggable in other
|
||||||
other Pipelines instances, and it makes usage of ``self.outqueue``
|
Pipelines instances, and makes usage of ``self.outqueue`` to output
|
||||||
to output the data.
|
the data.
|
||||||
|
|
||||||
A changefeed is a real time feed on inserts, updates, and deletes, and
|
A changefeed is a real time feed on inserts, updates, and deletes, and
|
||||||
it's volatile. This class is a helper to create changefeeds. Moreover
|
is volatile. This class is a helper to create changefeeds. Moreover,
|
||||||
it provides a way to specify a `prefeed`, that is a set of data (iterable)
|
it provides a way to specify a ``prefeed`` of iterable data to output
|
||||||
to output before the actual changefeed.
|
before the actual changefeed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
INSERT = 1
|
INSERT = 1
|
||||||
@ -35,8 +35,8 @@ class ChangeFeed(Node):
|
|||||||
Args:
|
Args:
|
||||||
table (str): name of the table to listen to for changes.
|
table (str): name of the table to listen to for changes.
|
||||||
operation (int): can be ChangeFeed.INSERT, ChangeFeed.DELETE, or
|
operation (int): can be ChangeFeed.INSERT, ChangeFeed.DELETE, or
|
||||||
ChangeFeed.UPDATE. Combining multiple operation is possible using
|
ChangeFeed.UPDATE. Combining multiple operation is possible
|
||||||
the bitwise ``|`` operator
|
with the bitwise ``|`` operator
|
||||||
(e.g. ``ChangeFeed.INSERT | ChangeFeed.UPDATE``)
|
(e.g. ``ChangeFeed.INSERT | ChangeFeed.UPDATE``)
|
||||||
prefeed (iterable): whatever set of data you want to be published
|
prefeed (iterable): whatever set of data you want to be published
|
||||||
first.
|
first.
|
||||||
|
@ -119,7 +119,7 @@ def condition_details_has_owner(condition_details, owner):
|
|||||||
def verify_vote_signature(voters, signed_vote):
|
def verify_vote_signature(voters, signed_vote):
|
||||||
"""Verify the signature of a vote
|
"""Verify the signature of a vote
|
||||||
|
|
||||||
A valid vote should have been signed `owner_before` corresponding private key.
|
A valid vote should have been signed by a voter's private key.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
voters (list): voters of the block that is under election
|
voters (list): voters of the block that is under election
|
||||||
|
Loading…
x
Reference in New Issue
Block a user