def validate(self, blockchain_state, is_test_net=False):
    '\n        Validate block\n        1. check block index (is the next block in the blockchain state)\n        2. check previous hash (is the hash of the previous block)\n        3. check forger wallet (is lottery member?)\n        4. check block signature\n        5. validate transactions\n\n        :param is_test_net: if True ignore InsufficientBalanceError and NonLotteryMemberError\n        :param blockchain_state: Blockchain state object\n        :raises ValidationError\n        :return: None\n        '
    if ((self.index == 0) and (blockchain_state.length == 0)):
        genesis_is_valid = ((self.forger == DEVELOPER_KEY) and self.is_signature_verified())
        if (not genesis_is_valid):
            raise GenesisIsNotValidError()
        return
    if (self.index != blockchain_state.length):
        raise NonSequentialBlockIndexError(f'block index not sequential index: {self.index} chain: {blockchain_state.length}')
    if (self.previous_hash != blockchain_state.last_block_hash):
        raise NonMatchingHashError('previous hash not match previous block hash')
    forger_wallet = blockchain_state.wallets.get(self.forger, None)
    if ((forger_wallet is None) or (forger_wallet.balance < 100)):
        if (not is_test_net):
            raise NonLotteryMemberError()
    if (not self.is_signature_verified()):
        raise ValidationError('invalid signature')
    for transaction in self.transactions:
        transaction.validate(blockchain_state=blockchain_state, is_test_net=is_test_net)
Validate block
1. check block index (is the next block in the blockchain state)
2. check previous hash (is the hash of the previous block)
3. check forger wallet (is lottery member?)
4. check block signature
5. validate transactions

:param is_test_net: if True ignore InsufficientBalanceError and NonLotteryMemberError
:param blockchain_state: Blockchain state object
:raises ValidationError
:return: None
def validate(self, blockchain_state, is_test_net=False):
    '\n        Validate block\n        1. check block index (is the next block in the blockchain state)\n        2. check previous hash (is the hash of the previous block)\n        3. check forger wallet (is lottery member?)\n        4. check block signature\n        5. validate transactions\n\n        :param is_test_net: if True ignore InsufficientBalanceError and NonLotteryMemberError\n        :param blockchain_state: Blockchain state object\n        :raises ValidationError\n        :return: None\n        '
    if ((self.index == 0) and (blockchain_state.length == 0)):
        genesis_is_valid = ((self.forger == DEVELOPER_KEY) and self.is_signature_verified())
        if (not genesis_is_valid):
            raise GenesisIsNotValidError()
        return
    if (self.index != blockchain_state.length):
        raise NonSequentialBlockIndexError(f'block index not sequential index: {self.index} chain: {blockchain_state.length}')
    if (self.previous_hash != blockchain_state.last_block_hash):
        raise NonMatchingHashError('previous hash not match previous block hash')
    forger_wallet = blockchain_state.wallets.get(self.forger, None)
    if ((forger_wallet is None) or (forger_wallet.balance < 100)):
        if (not is_test_net):
            raise NonLotteryMemberError()
    if (not self.is_signature_verified()):
        raise ValidationError('invalid signature')
    for transaction in self.transactions:
        transaction.validate(blockchain_state=blockchain_state, is_test_net=is_test_net)