Skip to content

Conversation

MakarovS
Copy link
Contributor

@MakarovS MakarovS commented Nov 27, 2019

Overview

Update LC with DS changes.


See: https://jira.bf.local/browse/ECR-3860

Definition of Done

  • There are no TODOs left in the code
  • Change is covered by automated tests
  • The coding guidelines are followed
  • Public API has Javadoc
  • Method preconditions are checked and documented in the Javadoc of the method
  • Changelog is updated if needed (in case of notable or breaking changes)
  • The continuous integration build passes

@coveralls
Copy link

coveralls commented Nov 27, 2019

Coverage Status

Coverage increased (+0.07%) to 85.946% when pulling 41d708e on ECR-3860 into 9adb4b9 on master.

ERROR,
@SerializedName("panic")
PANIC
ERROR
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Support for this may be done in a separate PR — but in that case please document that in Jira properly.

return ExecutionStatuses.success();
case ERROR:
return TransactionResult.error(executionStatus.getCode(),
return ExecutionStatuses.serviceError(executionStatus.getCode(),
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 complete — see below.

<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protobuf.version}</version>
<scope>provided</scope>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this dependency is needed? Doesn't common bring it as a transitive?
It may be specified explicitly, but certainly not as provided. If it isn't already available — please fix the common.

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 explicitly marked as an optional dependency and is not passed on transitively - https://github.com/exonum/exonum-java-binding/blob/master/exonum-java-binding/common/pom.xml#L47

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a PR that makes protobuf dependency transitive - #1246

import com.exonum.client.response.BlocksResponse;
import com.exonum.client.response.TransactionResponse;
import com.exonum.client.response.TransactionStatus;
import com.exonum.core.messages.Runtime.ExecutionStatus;
Copy link
Contributor

Choose a reason for hiding this comment

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

how does it come here? Is it a part of exonum-java-binding-common? I mean exonum.core. package

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a part of exonum-java-binding-common?

Yes, it is, but, ideally, it mustn't be a part of it, but a dependency of it. I think we shall extract the messages into a separate module (or modules, if we believe that some messages are not needed everywhere, e.g., supervisor messages, or merkledb messages) that will have not just have its own package, but its own release cadence (since the main reason for their release is a new Exonum release).

String errorDescription = "Unexpected error";
String json = "{\n"
+ " 'type': 'committed',\n"
+ " 'content': {\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no content.debug in 0.13, please check the format in the core.

Comment on lines 136 to 139
+ " 'status': {\n"
+ " 'type': 'panic',\n"
+ " 'description': \"" + errorDescription + "\""
+ " }\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the only variable thing in this and the following tests. It seems like the main and/or test code have to be refactored to not duplicate the rest needlesly. E.g.,

  1. A template JSON for testing various results + a source of (JSONs, expected execution status) + a parameterized test asserting on the expected status (and the constants, if needed).
  2. A modification of main code that allows to test the various results independently from the transaction response.

@MakarovS MakarovS added the work-in-progress 👷‍♂️ Do not expect reviewers to provide any feedback on WIP PRs — please ask for it explicitly! label Dec 2, 2019
+ "}\n";

return Stream.of(
Arguments.of(ExecutionStatuses.success(), successStatus),
Copy link
Contributor

Choose a reason for hiding this comment

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

Arguments.arguments(...) (statically-imported)

@MakarovS MakarovS removed the work-in-progress 👷‍♂️ Do not expect reviewers to provide any feedback on WIP PRs — please ask for it explicitly! label Dec 2, 2019
TransactionLocation location;
JsonObject locationProof; //TODO: in scope of LC P3
GetTxResponseExecutionResult status;
String time;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmitry-timofeev should we add this time to the TransactionResponse? If yes, I'll create a Jira task

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I'd go with it. But if we don't add it here, please remove the String time field — it won't affect the JSON parsing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added - ECR-3942

Copy link
Contributor

Choose a reason for hiding this comment

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

+ " 'block_height': " + BLOCK_HEIGHT + ",\n"
+ " 'position_in_block': " + INDEX_IN_BLOCK + "\n"
+ " },\n"
+ " 'location_proof': {\n"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took this location_proof from some core tests. It looks weird, but we don't use it in any way, so as long as it's a valid json, we are good.

<!-- Project dependencies -->
<okhttp.version>4.2.2</okhttp.version>
<lombok.version>1.18.10</lombok.version>
<protobuf.version>3.10.0</protobuf.version>
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused.

@dmitry-timofeev dmitry-timofeev merged commit bd5b362 into master Dec 4, 2019
@MakarovS MakarovS deleted the ECR-3860 branch December 4, 2019 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants