def mock_calculated(_self, _path, _block_height): invalid_block_height: int = 0 response = CalculateDoneNotification(0, True, invalid_block_height, 0, b'mocked_response') _self._calculate_done_callback(response)
def mock_calculated(_self, _path, _block_height): context: 'IconScoreContext' = IconScoreContext(IconScoreContextType.QUERY) end_block_height_of_calc: int = context.storage.iiss.get_end_block_height_of_calc(context) calc_period: int = context.storage.iiss.get_calc_period(context) response = CalculateDoneNotification(0, True, end_block_height_of_calc - calc_period, response_iscore, b'mocked_response') print(f"calculate request block height: {end_block_height_of_calc - calc_period}") _self._calculate_done_callback(response)
def mock_calculate(self, _path, _block_height): context: 'IconScoreContext' = IconScoreContext( IconScoreContextType.QUERY) end_block_height_of_calc: int = context.storage.iiss.get_end_block_height_of_calc( context) calc_period: int = context.storage.iiss.get_calc_period(context) response = CalculateDoneNotification( 0, True, end_block_height_of_calc - calc_period, 0, b'mocked_response') self._calculate_done_callback(response)
def mock_calculated(_self, _path, _block_height): response = CalculateDoneNotification(0, False, 0, 0, b'mocked_response') _self._calculate_done_callback(response)