# Path: hydrachain/utils.py
# def sha3(seed):
#     return sha3_256(bytes(seed)).digest()
# 
# def phx(x):
#     return x.encode('hex')[:8]


from collections import Counter
from bitcoin.main import encode_privkey
from ethereum.blocks import Block
from ethereum.utils import big_endian_to_int, zpad, int_to_32bytearray
from bitcoin import encode_pubkey, N, P
from rlp.sedes import big_endian_int, binary
from rlp.sedes import CountableList
from rlp.utils import encode_hex
from ethereum.blocks import BlockHeader
from ethereum.transactions import Transaction
from secp256k1 import PrivateKey, PublicKey, ALL_FLAGS
from hydrachain.utils import sha3, phx
import rlp
    fields = [
        ('height', big_endian_int),
        ('round', big_endian_int),
        ('round_lockset', LockSet)
    ] + Signed.fields

    def __init__(self, height, round, round_lockset, v=0, r=0, s=0):
        super(VotingInstruction, self).__init__(height, round, round_lockset, v, r, s)
        if not round > 0:
            raise InvalidProposalError('VotingInstructions must have R>0')
        if not self.lockset.has_quorum_possible:
            raise InvalidProposalError('VotingInstruction requires quorum possible')
        if not (round == self.lockset.round + 1):
            raise InvalidProposalError('Rn round lockset must be from previous round')
        if not (height == self.lockset.height):
            raise InvalidProposalError('height mismatch')
        if not round > 0:
            raise InvalidProposalError('VotingInstructions must have R>0')
        assert round == round_lockset.round + 1
        assert height == round_lockset.height

    @property
    def blockhash(self):
        return self.round_lockset.has_quorum_possible

    @property
    def lockset(self):
        return self.round_lockset

    def __repr__(self):

# Path: hydrachain/utils.py
# def sha3(seed):
#     return sha3_256(bytes(seed)).digest()
# 
# def phx(x):
#     return x.encode('hex')[:8]


# Path: hydrachain/consensus/base.py
from collections import Counter
from bitcoin.main import encode_privkey
from ethereum.blocks import Block
from ethereum.utils import big_endian_to_int, zpad, int_to_32bytearray
from bitcoin import encode_pubkey, N, P
from rlp.sedes import big_endian_int, binary
from rlp.sedes import CountableList
from rlp.utils import encode_hex
from ethereum.blocks import BlockHeader
from ethereum.transactions import Transaction
from secp256k1 import PrivateKey, PublicKey, ALL_FLAGS
from hydrachain.utils import sha3, phx
import rlp

    fields = [
        ('height', big_endian_int),
        ('round', big_endian_int),
        ('round_lockset', LockSet)
    ] + Signed.fields

    def __init__(self, height, round, round_lockset, v=0, r=0, s=0):
        super(VotingInstruction, self).__init__(height, round, round_lockset, v, r, s)
        if not round > 0:
            raise InvalidProposalError('VotingInstructions must have R>0')
        if not self.lockset.has_quorum_possible:
            raise InvalidProposalError('VotingInstruction requires quorum possible')
        if not (round == self.lockset.round + 1):
            raise InvalidProposalError('Rn round lockset must be from previous round')
        if not (height == self.lockset.height):
            raise InvalidProposalError('height mismatch')
        if not round > 0:
            raise InvalidProposalError('VotingInstructions must have R>0')
        assert round == round_lockset.round + 1
        assert height == round_lockset.height

    @property
    def blockhash(self):
        return self.round_lockset.has_quorum_possible

    @property
    def lockset(self):
        return self.round_lockset

    def __repr__(self):

        return "<%s %r BH:%s>" % (self.__class__.__name__, phx(self.sender), phx(self.blockhash))