Skip to content

Commit

Permalink
FAB-3153 Whitespace fixes (core)
Browse files Browse the repository at this point in the history
Change-Id: I3851d82386d5563ebf10bc2a27c574fa2db71df1
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
Signed-off-by: Ry Jones <rjones@linuxfoundation.org>
  • Loading branch information
jwagantall committed Apr 18, 2017
1 parent eba4a20 commit 6bc8604
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
Expand Up @@ -33,7 +33,7 @@

public abstract class ChaincodeHelper {
public static final int UNKNOWN_VALUE = 0;

public static Response newResponse(Status status, String message, byte[] payload) {
final Builder builder = Response.newBuilder();
builder.setStatus(status.getNumber());
Expand All @@ -45,15 +45,15 @@ public static Response newResponse(Status status, String message, byte[] payload
}
return builder.build();
}

public static Response newSuccessResponse(String message, byte[] payload) {
return newResponse(SUCCESS, message, payload);
}

public static Response newSuccessResponse() {
return newSuccessResponse(null, null);
}

public static Response newSuccessResponse(String message) {
return newSuccessResponse(message, null);
}
Expand All @@ -65,11 +65,11 @@ public static Response newSuccessResponse(byte[] payload) {
public static Response newBadRequestResponse(String message, byte[] payload) {
return newResponse(BAD_REQUEST, message, payload);
}

public static Response newBadRequestResponse() {
return newBadRequestResponse(null, null);
}

public static Response newBadRequestResponse(String message) {
return newBadRequestResponse(message, null);
}
Expand All @@ -85,75 +85,75 @@ public static Response newForbiddenResponse(byte[] payload) {
public static Response newForbiddenResponse(String message, byte[] payload) {
return newResponse(FORBIDDEN, message, payload);
}

public static Response newForbiddenResponse() {
return newForbiddenResponse(null, null);
}

public static Response newForbiddenResponse(String message) {
return newForbiddenResponse(message, null);
}

public static Response newNotFoundResponse(String message, byte[] payload) {
return newResponse(NOT_FOUND, message, payload);
}

public static Response newNotFoundResponse() {
return newNotFoundResponse(null, null);
}

public static Response newNotFoundResponse(String message) {
return newNotFoundResponse(message, null);
}

public static Response newNotFoundResponse(byte[] payload) {
return newNotFoundResponse(null, payload);
}

public static Response newRequestEntityTooLargeResponse(String message, byte[] payload) {
return newResponse(REQUEST_ENTITY_TOO_LARGE, message, payload);
}

public static Response newRequestEntityTooLargeResponse() {
return newRequestEntityTooLargeResponse(null, null);
}

public static Response newRequestEntityTooLargeResponse(String message) {
return newRequestEntityTooLargeResponse(message, null);
}

public static Response newRequestEntityTooLargeResponse(byte[] payload) {
return newRequestEntityTooLargeResponse(null, payload);
}

public static Response newInternalServerErrorResponse(String message, byte[] payload) {
return newResponse(INTERNAL_SERVER_ERROR, message, payload);
}

public static Response newInternalServerErrorResponse() {
return newInternalServerErrorResponse(null, null);
}

public static Response newInternalServerErrorResponse(String message) {
return newInternalServerErrorResponse(message, null);
}

public static Response newInternalServerErrorResponse(byte[] payload) {
return newInternalServerErrorResponse(null, payload);
}

public static Response newInternalServerErrorResponse(Throwable throwable) {
return newInternalServerErrorResponse(throwable.getMessage(), printStackTrace(throwable));
}

public static Response newServiceUnavailableErrorResponse(String message, byte[] payload) {
return newResponse(SERVICE_UNAVAILABLE, message, payload);
}

public static Response newServiceUnavailableErrorResponse() {
return newServiceUnavailableErrorResponse(null, null);
}

public static Response newServiceUnavailableErrorResponse(String message) {
return newServiceUnavailableErrorResponse(message, null);
}
Expand All @@ -168,5 +168,5 @@ static byte[] printStackTrace(Throwable throwable) {
throwable.printStackTrace(new PrintWriter(buffer));
return buffer.toString().getBytes(StandardCharsets.UTF_8);
}

}
Expand Up @@ -32,15 +32,15 @@ private static ChaincodeMessage newEventMessage(final Type type, final String tx
.setPayload(payload)
.build();
}

static ChaincodeMessage newGetStateEventMessage(final String txid, final String key) {
return newEventMessage(GET_STATE, txid, ByteString.copyFromUtf8(key));
}

static ChaincodeMessage newErrorEventMessage(final String txid, final Response payload) {
return newEventMessage(ERROR, txid, payload.toByteString());
}

static ChaincodeMessage newErrorEventMessage(final String txid, final Throwable throwable) {
return newErrorEventMessage(txid, ChaincodeHelper.newInternalServerErrorResponse(throwable));
}
Expand Down
2 changes: 1 addition & 1 deletion core/comm/testdata/grpc/test.proto
Expand Up @@ -21,7 +21,7 @@ option go_package = "github.com/hyperledger/fabric/core/comm/testdata/grpc";
message Empty {}

service TestService {

rpc EmptyCall(Empty) returns (Empty);

}

0 comments on commit 6bc8604

Please sign in to comment.