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

Multi-Tenancy: Do not specify a public key anymore when requesting a … #185

Merged
merged 5 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update after review
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
  • Loading branch information
pinges committed Nov 14, 2019
commit c400d771ddfef4cac20662391f40d9a818f81659
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public ReceiveRequest(
this.to = to;
}

public ReceiveRequest(final String key) {
this(key, null);
}

public String getKey() {
return key;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
@JsonPropertyOrder({"payload", "privacyGroupId"})
public class ReceiveResponse {

private byte[] payload;
private String privacyGroupId;
private final byte[] payload;
private final String privacyGroupId;

@JsonCreator
public ReceiveResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public Gas gasRequirement(final BytesValue input) {
@Override
public BytesValue compute(final BytesValue input, final MessageFrame messageFrame) {
final String key = BytesValues.asBase64String(input);
final ReceiveRequest receiveRequest = new ReceiveRequest(key, null);
final ReceiveRequest receiveRequest = new ReceiveRequest(key);

final ReceiveResponse receiveResponse;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public String getPrivacyGroup(final String key, final PrivateTransaction private
try {
receiveResponse = enclave.receive(receiveRequest);
return receiveResponse.getPrivacyGroupId();
} catch (final Exception e) {
} catch (final RuntimeException e) {
LOG.error("Failed to retrieve private transaction in enclave", e);
throw e;
}
Expand Down