code: def add_transaction(self,
                          block_header: BlockHeader,
                          index_key: int,
                          transaction: 'BaseTransaction') -> Hash32:
          
          transaction_db = HexaryTrie(self.db, root_hash=block_header.transaction_root)
          transaction_db[index_key] = rlp.encode(transaction)
          return transaction_db.root_hash
docs: Adds the given transaction to the provided block header.
  
          Returns the updated `transactions_root` for updated block header.