from bigchaindb.util import verify_vote_signature
[docs]class BaseConsensusRules():
"""Base consensus rules for Bigchain.
"""
@staticmethod
[docs] def validate_transaction(bigchain, transaction):
"""See :meth:`bigchaindb.models.Transaction.validate`
for documentation.
"""
return transaction.validate(bigchain)
@staticmethod
[docs] def validate_block(bigchain, block):
"""See :meth:`bigchaindb.models.Block.validate` for documentation."""
return block.validate(bigchain)
@staticmethod
[docs] def verify_vote_signature(voters, signed_vote):
"""Verify the signature of a vote.
Refer to the documentation of
:func:`bigchaindb.util.verify_signature`.
"""
return verify_vote_signature(voters, signed_vote)