コード例 #1
0
ファイル: network.py プロジェクト: whycoding126/dragonchain
 def get_phase_1_info(self, phase_1):
     """ return dictionary representation of thrift phase 1 """
     return {
         RECORD:
         thrift_record_to_dict(phase_1.record),
         VERIFICATION_INFO:
         map(thrift_transaction_to_dict, phase_1.transactions)
     }
コード例 #2
0
 def phase_1_message(self, phase_1):
     """ submit phase_1 block for phase_2 validation_phase """
     phase_1_info = {
         'record':
         thrift_record_to_dict(phase_1.record),
         'verification_info':
         map(thrift_transaction_to_dict, phase_1.transactions)
     }
     self.connection_manager.processing_node.notify(
         2, phase_1_info=phase_1_info)
コード例 #3
0
 def phase_1_message(self, phase_1):
     """ submit phase_1 block for phase_2 validation_phase """
     phase_1_info = {
         RECORD:
         thrift_record_to_dict(phase_1.record),
         VERIFICATION_INFO:
         map(thrift_transaction_to_dict, phase_1.transactions)
     }
     self.connection_manager.processing_node.notify(
         2, phase_1_info=phase_1_info)
コード例 #4
0
ファイル: network.py プロジェクト: whycoding126/dragonchain
 def get_phase_3_info(self, phase_3):
     """ return dictionary representation of thrift phase 3 """
     return {
         RECORD: thrift_record_to_dict(phase_3.record),
         VERIFICATION_INFO: {
             'lower_hashes': phase_3.lower_hashes,
             'p2_count': phase_3.p2_count,
             'businesses': phase_3.businesses,
             'deploy_locations': phase_3.deploy_locations
         }
     }
コード例 #5
0
 def phase_3_message(self, phase_3):
     phase_3_info = {
         'record': thrift_record_to_dict(phase_3.record),
         'verification_info': {
             'lower_phase_hashes': phase_3.lower_phase_hashes,
             'p2_count': phase_3.p2_count,
             'business_list': phase_3.business_list,
             'deploy_location_list': phase_3.deploy_loc_list
         }
     }
     self.connection_manager.processing_node.notify(
         4, phase_3_info=phase_3_info)
コード例 #6
0
ファイル: network.py プロジェクト: hfye/dragonchain
 def phase_3_message(self, phase_3):
     phase_3_info = {
         RECORD: thrift_record_to_dict(phase_3.record),
         VERIFICATION_INFO: {
             'lower_hashes': phase_3.lower_hashes,
             'p2_count': phase_3.p2_count,
             'businesses': phase_3.businesses,
             'deploy_locations': phase_3.deploy_locations
         }
     }
     self.connection_manager.processing_node.notify(
         4, phase_3_info=phase_3_info)
コード例 #7
0
ファイル: network.py プロジェクト: whycoding126/dragonchain
 def get_phase_2_info(self, phase_2):
     """ return dictionary representation of thrift phase 2 """
     return {
         RECORD: thrift_record_to_dict(phase_2.record),
         VERIFICATION_INFO: {
             'valid_txs': map(thrift_transaction_to_dict,
                              phase_2.valid_txs),
             'invalid_txs': map(thrift_transaction_to_dict,
                                phase_2.invalid_txs),
             'business': phase_2.business,
             'deploy_location': phase_2.deploy_location
         }
     }
コード例 #8
0
 def phase_2_message(self, phase_2):
     phase_2_info = {
         'record': thrift_record_to_dict(phase_2.record),
         'verification_info': {
             'valid_txs': map(thrift_transaction_to_dict,
                              phase_2.valid_txs),
             'invalid_txs': map(thrift_transaction_to_dict,
                                phase_2.invalid_txs),
             'business': phase_2.business,
             'deploy_location': phase_2.deploy_location
         }
     }
     self.connection_manager.processing_node.notify(
         3, phase_2_info=phase_2_info)