Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore change golem messages from v2.12.0 to v2.13.0 #829

Closed

Conversation

rwrzesien
Copy link
Contributor

No issue for this.

Copy link
Contributor

@dybi dybi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally OK, but some small improvements would be appreciated.

@@ -480,7 +480,7 @@ def test_send_task_to_compute_without_public_key_should_return_http_400(self):

self._test_400_response(
response,
error_code=ErrorCode.MESSAGE_VALUE_WRONG_TYPE
error_message='Error in Golem Message.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it a constant, i.e. ERROR_IN_GOLEM_MESSAGE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 done

@@ -503,7 +503,7 @@ def test_send_task_to_compute_with_public_key_with_wrong_length_should_return_ht

self._test_400_response(
response,
error_code=ErrorCode.MESSAGE_VALUE_WRONG_LENGTH
error_message='Error in Golem Message.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -497,59 +498,6 @@ def test_provider_send_force_payment_with_empty_subtask_results_accepted_list_co
self._test_400_response(response)
self._assert_stored_message_counter_not_increased()

def test_provider_send_force_payment_with_empty_requestor_ethereum_public_key_concent_should_refuse(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not possible to correctly create TaskToCompute with empty requestor_ethereum_public_key as its correctness now gets validated during deserialization against eth_sig.

@@ -1645,7 +1645,7 @@ def test_provider_forces_computed_task_report_missing_key_returns_400_error(self
)
self._test_400_response(
response_1,
error_code=ErrorCode.MESSAGE_VALUE_WRONG_TYPE,
error_message='Error in Golem Message.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make it a constant

@@ -163,6 +163,13 @@ def _sign_message(self, golem_message, client_private_key = None):
self.REQUESTOR_PRIVATE_KEY if client_private_key is None else client_private_key,
)

def _generate_ethereum_signature(self, task_to_compute, requestor_ethereum_private_key=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that sometimes ethereum signature is created "manually" (by call to task_to_compute.generate_ethsig(REQUESTOR_PRIV_ETH_KEY)) and sometimes by the function above. Why not having it unified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most cases it is automatically done in _get_deserialized_task_to_compute. But in few auth tests we change something in returned TaskToCompute, so signature has to be regenerated manually.

@@ -163,6 +163,13 @@ def _sign_message(self, golem_message, client_private_key = None):
self.REQUESTOR_PRIVATE_KEY if client_private_key is None else client_private_key,
)

def _generate_ethereum_signature(self, task_to_compute, requestor_ethereum_private_key=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not described in Code-Poets/coding-style#7, if type signatures should be also in testing utils. If it is no problem please add typing to this method. In this case types are pretty obvious, but lets keep it unified (as below :) )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 good point, done.

Copy link
Contributor

@kbeker kbeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, and please also update requirements in Signing Service

Copy link
Contributor

@Jakub89 Jakub89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot about api-integration tests.

  File "/home/jakub/Documents/work/projects/concent/concent_api/api_testing_common.py", line 357, in create_signed_task_to_compute
    task_to_compute.generate_ethsig()
TypeError: generate_ethsig() missing 1 required positional argument: 'private_key'

@rwrzesien rwrzesien force-pushed the chore-change-golem-messages-from-v2.12.0-to-v2.13.0 branch from 87ebe8a to 059ef10 Compare September 17, 2018 21:15
@rwrzesien rwrzesien closed this Sep 17, 2018
@rwrzesien rwrzesien deleted the chore-change-golem-messages-from-v2.12.0-to-v2.13.0 branch September 17, 2018 21:27
@cameel
Copy link
Contributor

cameel commented Sep 20, 2018

@rwrzesien Why has this been closed without a comment?

Has this actually been merged?

@cameel cameel added this to the 0.8.1 milestone Sep 20, 2018
@rwrzesien
Copy link
Contributor Author

@cameel Yes, it looks like github handled it itself (maybe because lack of relates issue?), I don't remember closing it manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants