input: Write a python function to add a block to the blockchain and verify its hash.
  assert len(blockchain.chain) == 1
  assert blockchain.chain[0].hash == blockchain.chain[0].hash_it()
  
  blockchain.add_block({'name': 'Alice', 'age': 30})
  assert len(blockchain.chain) == 2
  assert blockchain.chain[1].hash == blockchain.chain[1].hash_it()
  
  blockchain.add_block({'name': 'Bob', 'age': 25})
  assert len(blockchain.chain) == 3
  assert blockchain.chain[2].hash == blockchain.chain[2].hash_it()
output: import hashlib
  import json
  
  class Block:
      def __init__(self, index, previous_hash, data, timestamp):
          self.index = index
          self.previous_hash = previous_hash
          self.data = data
          self.timestamp = timestamp
          self.hash = self.hash_it()
  
      def hash_it(self):
          block_string = json.dumps(self.__dict__, sort_keys=True).encode()
          return hashlib.sha256(block_string).hexdigest()
  
  class Blockchain:
      def __init__(self):
          self.chain = [self.create_genesis_block()]
  
      def create_genesis_block(self):
          from time import time
          return Block(0, "0", "Genesis Block", time())
  
      def get_last_block(self):
          return self.chain[-1]
  
      def add_block(self, data):
          from time import time
          previous_block = self.get_last_block()
          new_block = Block(len(self.chain), previous_block.hash, data, time())
          self.chain.append(new_block)
  
  # Testing the function
  blockchain = Blockchain()
  assert len(blockchain.chain) == 1
  assert blockchain.chain[0].hash == blockchain.chain[0].hash_it()
  
  blockchain.add_block({'name': 'Alice', 'age': 30})
  assert len(blockchain.chain) == 2
  assert blockchain.chain[1].hash == blockchain.chain[1].hash_it()
  
  blockchain.add_block({'name': 'Bob', 'age': 25})
  assert len(blockchain.chain) == 3
  assert blockchain.chain[2].hash == blockchain.chain[2].hash_it()