diff --git a/acceptance-tests/build.gradle b/acceptance-tests/build.gradle index fadf49dd12..73ae1a4144 100644 --- a/acceptance-tests/build.gradle +++ b/acceptance-tests/build.gradle @@ -25,7 +25,7 @@ dependencies { testImplementation project(':ethereum:core') testImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts') testImplementation project(':ethereum:eth') - testImplementation project(':ethereum:graphqlrpc') + testImplementation project(':ethereum:graphql') testImplementation project(':ethereum:jsonrpc') testImplementation project(':ethereum:permissioning') testImplementation project(':ethereum:rlp') diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/ThreadPantheonNodeRunner.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/ThreadPantheonNodeRunner.java index 237a0ae405..591dd6baf3 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/ThreadPantheonNodeRunner.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/ThreadPantheonNodeRunner.java @@ -23,7 +23,7 @@ import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration; import tech.pegasys.pantheon.ethereum.eth.sync.SynchronizerConfiguration; import tech.pegasys.pantheon.ethereum.eth.transactions.PendingTransactions; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLRpcConfiguration; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLConfiguration; import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.metrics.noop.NoOpMetricsSystem; import tech.pegasys.pantheon.services.kvstore.RocksDbConfiguration; @@ -110,7 +110,7 @@ public void startNode(final PantheonNode node) { .metricsSystem(noOpMetricsSystem) .metricsConfiguration(node.metricsConfiguration()) .p2pEnabled(node.isP2pEnabled()) - .graphQLRpcConfiguration(GraphQLRpcConfiguration.createDefault()) + .graphQLConfiguration(GraphQLConfiguration.createDefault()) .build(); runner.start(); diff --git a/docs/Reference/Pantheon-API-Methods.md b/docs/Reference/Pantheon-API-Methods.md index 5010c26eaf..57a4037fe4 100644 --- a/docs/Reference/Pantheon-API-Methods.md +++ b/docs/Reference/Pantheon-API-Methods.md @@ -447,7 +447,7 @@ None !!! note Methods with an equivalent [GraphQL](../Pantheon-API/GraphQL.md) query include a GraphQL request and result in the method example. - The parameter and result descriptions apply to the JSON-RPC requests. The GraphQL specification is defined in the [schema](https://github.com/PegaSysEng/pantheon/blob/master/ethereum/graphqlrpc/src/main/resources/schema.graphqls). + The parameter and result descriptions apply to the JSON-RPC requests. The GraphQL specification is defined in the [schema](https://github.com/PegaSysEng/pantheon/blob/master/ethereum/graphql/src/main/resources/schema.graphqls). ### eth_syncing diff --git a/ethereum/graphqlrpc/build.gradle b/ethereum/graphql/build.gradle similarity index 97% rename from ethereum/graphqlrpc/build.gradle rename to ethereum/graphql/build.gradle index 8ef1c88018..c8b25e1703 100644 --- a/ethereum/graphqlrpc/build.gradle +++ b/ethereum/graphql/build.gradle @@ -14,7 +14,7 @@ apply plugin: 'java-library' jar { - baseName 'pantheon-graphql-rpc' + baseName 'pantheon-graphql' manifest { attributes( 'Specification-Title': baseName, diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcConfiguration.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLConfiguration.java similarity index 83% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcConfiguration.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLConfiguration.java index 0bcf1703a2..3b44fe5e38 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcConfiguration.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLConfiguration.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static com.google.common.base.Preconditions.checkNotNull; @@ -22,9 +22,9 @@ import com.google.common.base.MoreObjects; -public class GraphQLRpcConfiguration { - private static final String DEFAULT_GRAPHQL_RPC_HOST = "127.0.0.1"; - public static final int DEFAULT_GRAPHQL_RPC_PORT = 8547; +public class GraphQLConfiguration { + private static final String DEFAULT_GRAPHQL_HTTP_HOST = "127.0.0.1"; + public static final int DEFAULT_GRAPHQL_HTTP_PORT = 8547; private boolean enabled; private int port; @@ -32,15 +32,15 @@ public class GraphQLRpcConfiguration { private List corsAllowedDomains = Collections.emptyList(); private List hostsWhitelist = Arrays.asList("localhost", "127.0.0.1"); - public static GraphQLRpcConfiguration createDefault() { - final GraphQLRpcConfiguration config = new GraphQLRpcConfiguration(); + public static GraphQLConfiguration createDefault() { + final GraphQLConfiguration config = new GraphQLConfiguration(); config.setEnabled(false); - config.setPort(DEFAULT_GRAPHQL_RPC_PORT); - config.setHost(DEFAULT_GRAPHQL_RPC_HOST); + config.setPort(DEFAULT_GRAPHQL_HTTP_PORT); + config.setHost(DEFAULT_GRAPHQL_HTTP_HOST); return config; } - private GraphQLRpcConfiguration() {} + private GraphQLConfiguration() {} public boolean isEnabled() { return enabled; @@ -103,7 +103,7 @@ public boolean equals(final Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final GraphQLRpcConfiguration that = (GraphQLRpcConfiguration) o; + final GraphQLConfiguration that = (GraphQLConfiguration) o; return enabled == that.enabled && port == that.port && Objects.equals(host, that.host) diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLDataFetcherContext.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLDataFetcherContext.java similarity index 94% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLDataFetcherContext.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLDataFetcherContext.java index e6ca6e1f81..497f042160 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLDataFetcherContext.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLDataFetcherContext.java @@ -10,13 +10,13 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import tech.pegasys.pantheon.ethereum.blockcreation.MiningCoordinator; import tech.pegasys.pantheon.ethereum.chain.Blockchain; import tech.pegasys.pantheon.ethereum.core.Synchronizer; import tech.pegasys.pantheon.ethereum.eth.transactions.TransactionPool; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.pantheon.ethereum.worldstate.WorldStateArchive; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLDataFetchers.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLDataFetchers.java similarity index 86% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLDataFetchers.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLDataFetchers.java index 25ed4e9435..c2794acb6a 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLDataFetchers.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLDataFetchers.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static com.google.common.base.Preconditions.checkArgument; @@ -24,15 +24,15 @@ import tech.pegasys.pantheon.ethereum.core.WorldState; import tech.pegasys.pantheon.ethereum.eth.EthProtocol; import tech.pegasys.pantheon.ethereum.eth.transactions.TransactionPool; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockWithMetadata; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.TransactionWithMetadata; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter.AccountAdapter; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter.NormalBlockAdapter; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter.PendingStateAdapter; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter.SyncStateAdapter; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter.TransactionAdapter; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response.GraphQLRpcError; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.TransactionWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter.AccountAdapter; +import tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter.NormalBlockAdapter; +import tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter.PendingStateAdapter; +import tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter.SyncStateAdapter; +import tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter.TransactionAdapter; +import tech.pegasys.pantheon.ethereum.graphql.internal.response.GraphQLError; import tech.pegasys.pantheon.ethereum.mainnet.TransactionValidator.TransactionInvalidReason; import tech.pegasys.pantheon.ethereum.mainnet.ValidationResult; import tech.pegasys.pantheon.ethereum.p2p.wire.Capability; @@ -80,9 +80,9 @@ DataFetcher> getSendRawTransactionDataFetcher() { return Optional.of(transaction.hash()); } } catch (final IllegalArgumentException | RLPException e) { - throw new GraphQLRpcException(GraphQLRpcError.INVALID_PARAMS); + throw new GraphQLException(GraphQLError.INVALID_PARAMS); } - throw new GraphQLRpcException(GraphQLRpcError.INVALID_PARAMS); + throw new GraphQLException(GraphQLError.INVALID_PARAMS); }; } @@ -126,7 +126,7 @@ DataFetcher> getRangeBlockDataFetcher() { to = blockchainQuery.latestBlock().map(block -> block.getHeader().getNumber()).orElse(0L); } if (from > to) { - throw new GraphQLRpcException(GraphQLRpcError.INVALID_PARAMS); + throw new GraphQLException(GraphQLError.INVALID_PARAMS); } final List results = new ArrayList<>(); @@ -147,7 +147,7 @@ public DataFetcher> getBlockDataFetcher() { final Long number = dataFetchingEnvironment.getArgument("number"); final Bytes32 hash = dataFetchingEnvironment.getArgument("hash"); if ((number != null) && (hash != null)) { - throw new GraphQLRpcException(GraphQLRpcError.INVALID_PARAMS); + throw new GraphQLException(GraphQLError.INVALID_PARAMS); } final Optional> block; @@ -176,10 +176,10 @@ DataFetcher> getAccountDataFetcher() { return Optional.of(new AccountAdapter(account)); } else if (bn > blockchainQuery.getBlockchain().getChainHeadBlockNumber()) { // block is past chainhead - throw new GraphQLRpcException(GraphQLRpcError.INVALID_PARAMS); + throw new GraphQLException(GraphQLError.INVALID_PARAMS); } else { // we don't have that block - throw new GraphQLRpcException(GraphQLRpcError.CHAIN_HEAD_WORLD_STATE_NOT_AVAILABLE); + throw new GraphQLException(GraphQLError.CHAIN_HEAD_WORLD_STATE_NOT_AVAILABLE); } } else { // return account on latest block diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcException.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLException.java similarity index 80% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcException.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLException.java index b3ba721cdf..ab04925f4c 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcException.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLException.java @@ -10,22 +10,21 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response.GraphQLRpcError; +import tech.pegasys.pantheon.ethereum.graphql.internal.response.GraphQLError; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import graphql.ErrorType; -import graphql.GraphQLError; import graphql.language.SourceLocation; -class GraphQLRpcException extends RuntimeException implements GraphQLError { - private final GraphQLRpcError error; +class GraphQLException extends RuntimeException implements graphql.GraphQLError { + private final GraphQLError error; - GraphQLRpcException(final GraphQLRpcError error) { + GraphQLException(final GraphQLError error) { super(error.getMessage()); diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpService.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpService.java similarity index 83% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpService.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpService.java index 5a0a0e5ff6..86521bdc67 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpService.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpService.java @@ -10,17 +10,17 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.Streams.stream; import static tech.pegasys.pantheon.util.NetworkUtility.urlForSocketAddress; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response.GraphQLJsonRequest; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response.GraphQLRpcErrorResponse; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response.GraphQLRpcResponse; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response.GraphQLRpcResponseType; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response.GraphQLRpcSuccessResponse; +import tech.pegasys.pantheon.ethereum.graphql.internal.response.GraphQLErrorResponse; +import tech.pegasys.pantheon.ethereum.graphql.internal.response.GraphQLJsonRequest; +import tech.pegasys.pantheon.ethereum.graphql.internal.response.GraphQLResponse; +import tech.pegasys.pantheon.ethereum.graphql.internal.response.GraphQLResponseType; +import tech.pegasys.pantheon.ethereum.graphql.internal.response.GraphQLSuccessResponse; import tech.pegasys.pantheon.util.NetworkUtility; import java.net.InetSocketAddress; @@ -59,7 +59,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -public class GraphQLRpcHttpService { +public class GraphQLHttpService { private static final Logger LOG = LogManager.getLogger(); @@ -71,7 +71,7 @@ public class GraphQLRpcHttpService { new TypeReference>() {}; private final Vertx vertx; - private final GraphQLRpcConfiguration config; + private final GraphQLConfiguration config; private final Path dataDir; private HttpServer httpServer; @@ -81,7 +81,7 @@ public class GraphQLRpcHttpService { private final GraphQLDataFetcherContext dataFetcherContext; /** - * Construct a GraphQLRpcHttpService handler + * Construct a GraphQLHttpService handler * * @param vertx The vertx process that will be running this service * @param dataDir The data directory where requests can be buffered @@ -89,10 +89,10 @@ public class GraphQLRpcHttpService { * @param graphQL GraphQL engine * @param dataFetcherContext DataFetcherContext required by GraphQL to finish it's job */ - public GraphQLRpcHttpService( + public GraphQLHttpService( final Vertx vertx, final Path dataDir, - final GraphQLRpcConfiguration config, + final GraphQLConfiguration config, final GraphQL graphQL, final GraphQLDataFetcherContext dataFetcherContext) { this.dataDir = dataDir; @@ -104,7 +104,7 @@ public GraphQLRpcHttpService( this.dataFetcherContext = dataFetcherContext; } - private void validateConfig(final GraphQLRpcConfiguration config) { + private void validateConfig(final GraphQLConfiguration config) { checkArgument( config.getPort() == 0 || NetworkUtility.isValidPort(config.getPort()), "Invalid port configuration."); @@ -112,13 +112,13 @@ private void validateConfig(final GraphQLRpcConfiguration config) { } public CompletableFuture start() { - LOG.info("Starting GraphQLRPC service on {}:{}", config.getHost(), config.getPort()); + LOG.info("Starting GraphQL HTTP service on {}:{}", config.getHost(), config.getPort()); // Create the HTTP server and a router object. httpServer = vertx.createHttpServer( new HttpServerOptions().setHost(config.getHost()).setPort(config.getPort())); - // Handle graphql rpc requests + // Handle graphql http requests final Router router = Router.router(vertx); // Verify Host header to avoid rebind attack. @@ -142,7 +142,7 @@ public CompletableFuture start() { .method(HttpMethod.GET) .method(HttpMethod.POST) .produces(APPLICATION_JSON) - .handler(this::handleGraphQLRPCRequest); + .handler(this::handleGraphQLRequest); final CompletableFuture resultFuture = new CompletableFuture<>(); httpServer @@ -152,7 +152,7 @@ public CompletableFuture start() { if (!res.failed()) { resultFuture.complete(null); LOG.info( - "GraphQL RPC service started and listening on {}:{}", + "GraphQL HTTP service started and listening on {}:{}", config.getHost(), httpServer.actualPort()); return; @@ -161,9 +161,9 @@ public CompletableFuture start() { final Throwable cause = res.cause(); if (cause instanceof SocketException) { resultFuture.completeExceptionally( - new GraphQLRpcServiceException( + new GraphQLServiceException( String.format( - "Failed to bind Ethereum GraphQL RPC listener to %s:%s: %s", + "Failed to bind Ethereum GraphQL HTTP listener to %s:%s: %s", config.getHost(), config.getPort(), cause.getMessage()))); return; } @@ -244,7 +244,7 @@ private void handleEmptyRequest(final RoutingContext routingContext) { routingContext.response().setStatusCode(201).end(); } - private void handleGraphQLRPCRequest(final RoutingContext routingContext) { + private void handleGraphQLRequest(final RoutingContext routingContext) { try { final String query; final String operationName; @@ -290,9 +290,8 @@ private void handleGraphQLRPCRequest(final RoutingContext routingContext) { vertx.executeBlocking( future -> { try { - final GraphQLRpcResponse graphQLRpcResponse = - process(query, operationName, variables); - future.complete(graphQLRpcResponse); + final GraphQLResponse graphQLResponse = process(query, operationName, variables); + future.complete(graphQLResponse); } catch (final Exception e) { future.fail(e); } @@ -304,25 +303,25 @@ private void handleGraphQLRPCRequest(final RoutingContext routingContext) { response.setStatusCode(HttpResponseStatus.INTERNAL_SERVER_ERROR.code()); response.end( serialise( - new GraphQLRpcErrorResponse( + new GraphQLErrorResponse( Collections.singletonMap( "errors", Collections.singletonList( Collections.singletonMap( "message", res.cause().getMessage())))))); } else { - final GraphQLRpcResponse graphQLRpcResponse = (GraphQLRpcResponse) res.result(); - response.setStatusCode(status(graphQLRpcResponse).code()); - response.end(serialise(graphQLRpcResponse)); + final GraphQLResponse graphQLResponse = (GraphQLResponse) res.result(); + response.setStatusCode(status(graphQLResponse).code()); + response.end(serialise(graphQLResponse)); } }); } catch (final DecodeException ex) { - handleGraphQLRpcError(routingContext, ex); + handleGraphQLError(routingContext, ex); } } - private HttpResponseStatus status(final GraphQLRpcResponse response) { + private HttpResponseStatus status(final GraphQLResponse response) { switch (response.getType()) { case UNAUTHORIZED: @@ -336,16 +335,16 @@ private HttpResponseStatus status(final GraphQLRpcResponse response) { } } - private String serialise(final GraphQLRpcResponse response) { + private String serialise(final GraphQLResponse response) { - if (response.getType() == GraphQLRpcResponseType.NONE) { + if (response.getType() == GraphQLResponseType.NONE) { return EMPTY_RESPONSE; } return Json.encodePrettily(response.getResult()); } - private GraphQLRpcResponse process( + private GraphQLResponse process( final String requestJson, final String operationName, final Map variables) { final ExecutionInput executionInput = ExecutionInput.newExecutionInput() @@ -358,18 +357,18 @@ private GraphQLRpcResponse process( final Map toSpecificationResult = result.toSpecification(); final List errors = result.getErrors(); if (errors.size() == 0) { - return new GraphQLRpcSuccessResponse(toSpecificationResult); + return new GraphQLSuccessResponse(toSpecificationResult); } else { - return new GraphQLRpcErrorResponse(toSpecificationResult); + return new GraphQLErrorResponse(toSpecificationResult); } } - private void handleGraphQLRpcError(final RoutingContext routingContext, final Exception ex) { + private void handleGraphQLError(final RoutingContext routingContext, final Exception ex) { LOG.debug("Error handling GraphQL request", ex); routingContext .response() .setStatusCode(HttpResponseStatus.BAD_REQUEST.code()) - .end(Json.encode(new GraphQLRpcErrorResponse(ex.getMessage()))); + .end(Json.encode(new GraphQLErrorResponse(ex.getMessage()))); } private String buildCorsRegexFromConfig() { diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLProvider.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLProvider.java similarity index 87% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLProvider.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLProvider.java index d87a24454e..4e316c064d 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLProvider.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLProvider.java @@ -10,15 +10,15 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static graphql.schema.idl.TypeRuntimeWiring.newTypeWiring; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar.AddressScalar; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar.BigIntScalar; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar.Bytes32Scalar; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar.BytesScalar; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar.LongScalar; +import tech.pegasys.pantheon.ethereum.graphql.internal.scalar.AddressScalar; +import tech.pegasys.pantheon.ethereum.graphql.internal.scalar.BigIntScalar; +import tech.pegasys.pantheon.ethereum.graphql.internal.scalar.Bytes32Scalar; +import tech.pegasys.pantheon.ethereum.graphql.internal.scalar.BytesScalar; +import tech.pegasys.pantheon.ethereum.graphql.internal.scalar.LongScalar; import java.io.IOException; import java.net.URL; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcServiceException.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLServiceException.java similarity index 78% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcServiceException.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLServiceException.java index 7bb8a2a2de..5189d8360e 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcServiceException.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLServiceException.java @@ -10,11 +10,11 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; -class GraphQLRpcServiceException extends RuntimeException { +class GraphQLServiceException extends RuntimeException { - public GraphQLRpcServiceException(final String message) { + public GraphQLServiceException(final String message) { super(message); } } diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/BlockWithMetadata.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/BlockWithMetadata.java similarity index 96% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/BlockWithMetadata.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/BlockWithMetadata.java index c298fb09b5..12a3a2d0ac 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/BlockWithMetadata.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/BlockWithMetadata.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal; +package tech.pegasys.pantheon.ethereum.graphql.internal; import tech.pegasys.pantheon.ethereum.core.BlockHeader; import tech.pegasys.pantheon.util.uint.UInt256; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/BlockchainQuery.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/BlockchainQuery.java similarity index 99% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/BlockchainQuery.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/BlockchainQuery.java index 29b99de9cc..ed9fdd63bd 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/BlockchainQuery.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/BlockchainQuery.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal; +package tech.pegasys.pantheon.ethereum.graphql.internal; import tech.pegasys.pantheon.ethereum.chain.Blockchain; import tech.pegasys.pantheon.ethereum.chain.TransactionLocation; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/LogWithMetadata.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/LogWithMetadata.java similarity index 97% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/LogWithMetadata.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/LogWithMetadata.java index 0de573b91e..7ef808d1c7 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/LogWithMetadata.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/LogWithMetadata.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal; +package tech.pegasys.pantheon.ethereum.graphql.internal; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.Hash; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/LogsQuery.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/LogsQuery.java similarity index 98% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/LogsQuery.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/LogsQuery.java index 958876ec69..c66e854658 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/LogsQuery.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/LogsQuery.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal; +package tech.pegasys.pantheon.ethereum.graphql.internal; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.Log; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/TopicsParameter.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/TopicsParameter.java similarity index 96% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/TopicsParameter.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/TopicsParameter.java index 2cf20ffd3c..93dac3c0cc 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/TopicsParameter.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/TopicsParameter.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal; +package tech.pegasys.pantheon.ethereum.graphql.internal; import tech.pegasys.pantheon.ethereum.core.LogTopic; import tech.pegasys.pantheon.util.bytes.BytesValue; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/TransactionReceiptWithMetadata.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/TransactionReceiptWithMetadata.java similarity index 97% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/TransactionReceiptWithMetadata.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/TransactionReceiptWithMetadata.java index ce4faaba7c..5936a855c2 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/TransactionReceiptWithMetadata.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/TransactionReceiptWithMetadata.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal; +package tech.pegasys.pantheon.ethereum.graphql.internal; import tech.pegasys.pantheon.ethereum.core.Hash; import tech.pegasys.pantheon.ethereum.core.Transaction; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/TransactionWithMetadata.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/TransactionWithMetadata.java similarity index 96% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/TransactionWithMetadata.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/TransactionWithMetadata.java index 8dd67c1f73..ed83a1373f 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/TransactionWithMetadata.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/TransactionWithMetadata.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal; +package tech.pegasys.pantheon.ethereum.graphql.internal; import tech.pegasys.pantheon.ethereum.core.Hash; import tech.pegasys.pantheon.ethereum.core.Transaction; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/AccountAdapter.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/AccountAdapter.java similarity index 96% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/AccountAdapter.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/AccountAdapter.java index 50e0530c46..eea734b953 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/AccountAdapter.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/AccountAdapter.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; import tech.pegasys.pantheon.ethereum.core.Account; import tech.pegasys.pantheon.ethereum.core.Address; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/AdapterBase.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/AdapterBase.java similarity index 79% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/AdapterBase.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/AdapterBase.java index 60846d9efc..a92609b463 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/AdapterBase.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/AdapterBase.java @@ -10,10 +10,10 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLDataFetcherContext; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLDataFetcherContext; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; import graphql.schema.DataFetchingEnvironment; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/BlockAdapterBase.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/BlockAdapterBase.java similarity index 93% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/BlockAdapterBase.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/BlockAdapterBase.java index 3fa2b8f3d0..d0f636af95 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/BlockAdapterBase.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/BlockAdapterBase.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.BlockHeader; @@ -18,12 +18,12 @@ import tech.pegasys.pantheon.ethereum.core.LogTopic; import tech.pegasys.pantheon.ethereum.core.Wei; import tech.pegasys.pantheon.ethereum.core.WorldState; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLDataFetcherContext; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockWithMetadata; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.LogWithMetadata; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.LogsQuery; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.TransactionWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLDataFetcherContext; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.LogWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.LogsQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.TransactionWithMetadata; import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.pantheon.ethereum.transaction.CallParameter; import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/CallResult.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/CallResult.java similarity index 93% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/CallResult.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/CallResult.java index d9fbe78c6d..6a1a06d196 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/CallResult.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/CallResult.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; import tech.pegasys.pantheon.util.bytes.BytesValue; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/LogAdapter.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/LogAdapter.java similarity index 88% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/LogAdapter.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/LogAdapter.java index a8624126df..8775f99936 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/LogAdapter.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/LogAdapter.java @@ -10,13 +10,13 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; import tech.pegasys.pantheon.ethereum.core.Hash; import tech.pegasys.pantheon.ethereum.core.LogTopic; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.LogWithMetadata; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.TransactionWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.LogWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.TransactionWithMetadata; import tech.pegasys.pantheon.util.bytes.Bytes32; import tech.pegasys.pantheon.util.bytes.BytesValue; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/NormalBlockAdapter.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/NormalBlockAdapter.java similarity index 91% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/NormalBlockAdapter.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/NormalBlockAdapter.java index 69a3f37bd7..2bd48dfa5b 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/NormalBlockAdapter.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/NormalBlockAdapter.java @@ -10,13 +10,13 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; import tech.pegasys.pantheon.ethereum.core.BlockHeader; import tech.pegasys.pantheon.ethereum.core.Hash; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockWithMetadata; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.TransactionWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.TransactionWithMetadata; import tech.pegasys.pantheon.util.uint.UInt256; import java.util.ArrayList; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/PendingStateAdapter.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/PendingStateAdapter.java similarity index 94% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/PendingStateAdapter.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/PendingStateAdapter.java index 68f305c5d2..629af75059 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/PendingStateAdapter.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/PendingStateAdapter.java @@ -10,15 +10,15 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.Wei; import tech.pegasys.pantheon.ethereum.core.WorldState; import tech.pegasys.pantheon.ethereum.eth.transactions.PendingTransactions; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLDataFetcherContext; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.TransactionWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLDataFetcherContext; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.TransactionWithMetadata; import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.pantheon.ethereum.transaction.CallParameter; import tech.pegasys.pantheon.ethereum.transaction.TransactionSimulator; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/SyncStateAdapter.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/SyncStateAdapter.java similarity index 95% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/SyncStateAdapter.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/SyncStateAdapter.java index c7f2170807..9aa1505d13 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/SyncStateAdapter.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/SyncStateAdapter.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; import tech.pegasys.pantheon.ethereum.core.SyncStatus; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/TransactionAdapter.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/TransactionAdapter.java similarity index 94% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/TransactionAdapter.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/TransactionAdapter.java index bc52391671..5c22de75b6 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/TransactionAdapter.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/TransactionAdapter.java @@ -10,17 +10,17 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.Hash; import tech.pegasys.pantheon.ethereum.core.Transaction; import tech.pegasys.pantheon.ethereum.core.TransactionReceipt; import tech.pegasys.pantheon.ethereum.core.WorldState; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.LogWithMetadata; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.TransactionReceiptWithMetadata; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.TransactionWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.LogWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.TransactionReceiptWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.TransactionWithMetadata; import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.uint.UInt256; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/UncleBlockAdapter.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/UncleBlockAdapter.java similarity index 95% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/UncleBlockAdapter.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/UncleBlockAdapter.java index 9c2a1ae150..6fe5319be9 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/pojoadapter/UncleBlockAdapter.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/pojoadapter/UncleBlockAdapter.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter; +package tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter; import tech.pegasys.pantheon.ethereum.core.BlockHeader; import tech.pegasys.pantheon.util.uint.UInt256; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcError.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLError.java similarity index 88% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcError.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLError.java index 2440094e5a..8e11dd9ef7 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcError.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLError.java @@ -10,13 +10,13 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response; +package tech.pegasys.pantheon.ethereum.graphql.internal.response; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonGetter; @JsonFormat(shape = JsonFormat.Shape.OBJECT) -public enum GraphQLRpcError { +public enum GraphQLError { // Standard errors INVALID_PARAMS(-32602, "Invalid params"), INTERNAL_ERROR(-32603, "Internal error"), @@ -26,7 +26,7 @@ public enum GraphQLRpcError { private final int code; private final String message; - GraphQLRpcError(final int code, final String message) { + GraphQLError(final int code, final String message) { this.code = code; this.message = message; } diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcErrorResponse.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLErrorResponse.java similarity index 71% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcErrorResponse.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLErrorResponse.java index f7b87b5741..620e4d670f 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcErrorResponse.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLErrorResponse.java @@ -10,19 +10,19 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response; +package tech.pegasys.pantheon.ethereum.graphql.internal.response; import com.fasterxml.jackson.annotation.JsonIgnore; -public class GraphQLRpcErrorResponse extends GraphQLRpcResponse { +public class GraphQLErrorResponse extends GraphQLResponse { - public GraphQLRpcErrorResponse(final Object errors) { + public GraphQLErrorResponse(final Object errors) { super(errors); } @Override @JsonIgnore - public GraphQLRpcResponseType getType() { - return GraphQLRpcResponseType.ERROR; + public GraphQLResponseType getType() { + return GraphQLResponseType.ERROR; } } diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLJsonRequest.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLJsonRequest.java similarity index 95% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLJsonRequest.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLJsonRequest.java index 401ded84db..3abd5c1403 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLJsonRequest.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLJsonRequest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response; +package tech.pegasys.pantheon.ethereum.graphql.internal.response; import java.util.Map; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcNoResponse.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLNoResponse.java similarity index 71% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcNoResponse.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLNoResponse.java index f55e9bb8c6..6a66a8c4cd 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcNoResponse.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLNoResponse.java @@ -10,16 +10,16 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response; +package tech.pegasys.pantheon.ethereum.graphql.internal.response; -public class GraphQLRpcNoResponse extends GraphQLRpcResponse { +public class GraphQLNoResponse extends GraphQLResponse { - public GraphQLRpcNoResponse() { + public GraphQLNoResponse() { super(null); } @Override - public GraphQLRpcResponseType getType() { - return GraphQLRpcResponseType.NONE; + public GraphQLResponseType getType() { + return GraphQLResponseType.NONE; } } diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcResponse.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLResponse.java similarity index 79% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcResponse.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLResponse.java index d429587339..cedf0dd9b1 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcResponse.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLResponse.java @@ -10,16 +10,16 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response; +package tech.pegasys.pantheon.ethereum.graphql.internal.response; import java.util.Objects; -public abstract class GraphQLRpcResponse { - public abstract GraphQLRpcResponseType getType(); +public abstract class GraphQLResponse { + public abstract GraphQLResponseType getType(); private final Object result; - GraphQLRpcResponse(final Object result) { + GraphQLResponse(final Object result) { this.result = result; } @@ -35,7 +35,7 @@ public boolean equals(final Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final GraphQLRpcResponse that = (GraphQLRpcResponse) o; + final GraphQLResponse that = (GraphQLResponse) o; return Objects.equals(result, that.result); } diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcResponseType.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLResponseType.java similarity index 86% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcResponseType.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLResponseType.java index 2343e172a2..7ae40a088d 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcResponseType.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLResponseType.java @@ -10,10 +10,10 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response; +package tech.pegasys.pantheon.ethereum.graphql.internal.response; /** Various types of responses that the JSON-RPC component may produce. */ -public enum GraphQLRpcResponseType { +public enum GraphQLResponseType { NONE, SUCCESS, ERROR, diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcSuccessResponse.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLSuccessResponse.java similarity index 71% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcSuccessResponse.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLSuccessResponse.java index 81b793847c..324a13405a 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/response/GraphQLRpcSuccessResponse.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/response/GraphQLSuccessResponse.java @@ -10,19 +10,19 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.response; +package tech.pegasys.pantheon.ethereum.graphql.internal.response; import com.fasterxml.jackson.annotation.JsonIgnore; -public class GraphQLRpcSuccessResponse extends GraphQLRpcResponse { +public class GraphQLSuccessResponse extends GraphQLResponse { - public GraphQLRpcSuccessResponse(final Object data) { + public GraphQLSuccessResponse(final Object data) { super(data); } @Override @JsonIgnore - public GraphQLRpcResponseType getType() { - return GraphQLRpcResponseType.SUCCESS; + public GraphQLResponseType getType() { + return GraphQLResponseType.SUCCESS; } } diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/AddressScalar.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/AddressScalar.java similarity index 97% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/AddressScalar.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/AddressScalar.java index 0d8fccbb78..ee2f94e986 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/AddressScalar.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/AddressScalar.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import tech.pegasys.pantheon.ethereum.core.Address; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BigIntScalar.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BigIntScalar.java similarity index 97% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BigIntScalar.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BigIntScalar.java index dfd4d60dbb..b8d679fa7a 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BigIntScalar.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BigIntScalar.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import tech.pegasys.pantheon.util.uint.UInt256; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/Bytes32Scalar.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/Bytes32Scalar.java similarity index 97% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/Bytes32Scalar.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/Bytes32Scalar.java index 81a8b2ec5b..1396cd7cf6 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/Bytes32Scalar.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/Bytes32Scalar.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import tech.pegasys.pantheon.util.bytes.Bytes32; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BytesScalar.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BytesScalar.java similarity index 97% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BytesScalar.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BytesScalar.java index 0dbebe3dba..c6917dc3d0 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BytesScalar.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BytesScalar.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import tech.pegasys.pantheon.util.bytes.BytesValue; diff --git a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/LongScalar.java b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/LongScalar.java similarity index 98% rename from ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/LongScalar.java rename to ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/LongScalar.java index 8a2e830c02..30a108fc84 100644 --- a/ethereum/graphqlrpc/src/main/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/LongScalar.java +++ b/ethereum/graphql/src/main/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/LongScalar.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import tech.pegasys.pantheon.util.bytes.Bytes32; diff --git a/ethereum/graphqlrpc/src/main/resources/schema.graphqls b/ethereum/graphql/src/main/resources/schema.graphqls similarity index 100% rename from ethereum/graphqlrpc/src/main/resources/schema.graphqls rename to ethereum/graphql/src/main/resources/schema.graphqls diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/AbstractDataFetcherTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/AbstractDataFetcherTest.java similarity index 88% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/AbstractDataFetcherTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/AbstractDataFetcherTest.java index 026a0e394f..36c63288cd 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/AbstractDataFetcherTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/AbstractDataFetcherTest.java @@ -10,12 +10,12 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.mockito.Mockito.when; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.pojoadapter.NormalBlockAdapter; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.pojoadapter.NormalBlockAdapter; import tech.pegasys.pantheon.ethereum.p2p.wire.Capability; import java.util.Optional; diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/AbstractEthGraphQLRpcHttpServiceTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/AbstractEthGraphQLHttpServiceTest.java similarity index 93% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/AbstractEthGraphQLRpcHttpServiceTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/AbstractEthGraphQLHttpServiceTest.java index 8c97d40d0e..3b780f21bb 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/AbstractEthGraphQLRpcHttpServiceTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/AbstractEthGraphQLHttpServiceTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -65,7 +65,7 @@ import org.junit.Rule; import org.junit.rules.TemporaryFolder; -public abstract class AbstractEthGraphQLRpcHttpServiceTest { +public abstract class AbstractEthGraphQLHttpServiceTest { @Rule public final TemporaryFolder folder = new TemporaryFolder(); private static ProtocolSchedule PROTOCOL_SCHEDULE; @@ -78,7 +78,7 @@ public abstract class AbstractEthGraphQLRpcHttpServiceTest { private final Vertx vertx = Vertx.vertx(); - private GraphQLRpcHttpService service; + private GraphQLHttpService service; OkHttpClient client; @@ -97,15 +97,14 @@ public static void setupConstants() throws Exception { PROTOCOL_SCHEDULE = MainnetProtocolSchedule.create(); final URL blocksUrl = - EthGraphQLRpcHttpBySpecTest.class + EthGraphQLHttpBySpecTest.class .getClassLoader() - .getResource( - "tech/pegasys/pantheon/ethereum/graphqlrpc/graphQLRpcTestBlockchain.blocks"); + .getResource("tech/pegasys/pantheon/ethereum/graphql/graphQLTestBlockchain.blocks"); final URL genesisJsonUrl = - EthGraphQLRpcHttpBySpecTest.class + EthGraphQLHttpBySpecTest.class .getClassLoader() - .getResource("tech/pegasys/pantheon/ethereum/graphqlrpc/graphQLRpcTestGenesis.json"); + .getResource("tech/pegasys/pantheon/ethereum/graphql/graphQLTestGenesis.json"); assertThat(blocksUrl).isNotNull(); assertThat(genesisJsonUrl).isNotNull(); @@ -159,7 +158,7 @@ public void setupTest() throws Exception { supportedCapabilities.add(EthProtocol.ETH62); supportedCapabilities.add(EthProtocol.ETH63); - final GraphQLRpcConfiguration config = GraphQLRpcConfiguration.createDefault(); + final GraphQLConfiguration config = GraphQLConfiguration.createDefault(); config.setPort(0); final GraphQLDataFetcherContext dataFetcherContext = @@ -175,7 +174,7 @@ public void setupTest() throws Exception { final GraphQL graphQL = GraphQLProvider.buildGraphQL(dataFetchers); service = - new GraphQLRpcHttpService( + new GraphQLHttpService( vertx, folder.newFolder().toPath(), config, graphQL, dataFetcherContext); service.start().join(); diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/BlockDataFetcherTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/BlockDataFetcherTest.java similarity index 94% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/BlockDataFetcherTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/BlockDataFetcherTest.java index fbd6acf884..a78d64564e 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/BlockDataFetcherTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/BlockDataFetcherTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @@ -31,7 +31,7 @@ public void bothNumberAndHashThrows() throws Exception { when(environment.getArgument(eq("number"))).thenReturn(1L); when(environment.getArgument(eq("hash"))).thenReturn(fakedHash); - thrown.expect(GraphQLRpcException.class); + thrown.expect(GraphQLException.class); fetcher.get(environment); } diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/EthGraphQLRpcHttpBySpecErrorCaseTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/EthGraphQLHttpBySpecErrorCaseTest.java similarity index 84% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/EthGraphQLRpcHttpBySpecErrorCaseTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/EthGraphQLHttpBySpecErrorCaseTest.java index 0e780c1878..2644eddf5d 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/EthGraphQLRpcHttpBySpecErrorCaseTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/EthGraphQLHttpBySpecErrorCaseTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.assertj.core.api.Assertions.assertThat; @@ -31,11 +31,11 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) -public class EthGraphQLRpcHttpBySpecErrorCaseTest extends AbstractEthGraphQLRpcHttpServiceTest { +public class EthGraphQLHttpBySpecErrorCaseTest extends AbstractEthGraphQLHttpServiceTest { private final String specFileName; - public EthGraphQLRpcHttpBySpecErrorCaseTest(final String specFileName) { + public EthGraphQLHttpBySpecErrorCaseTest(final String specFileName) { this.specFileName = specFileName; } @@ -51,15 +51,15 @@ public static Collection specs() { } @Test - public void graphQLRPCCallWithSpecFile() throws Exception { - graphQLRPCCall(specFileName); + public void graphQLCallWithSpecFile() throws Exception { + graphQLCall(specFileName); } - private void graphQLRPCCall(final String name) throws IOException { + private void graphQLCall(final String name) throws IOException { final String testSpecFile = name + ".json"; final String json = Resources.toString( - EthGraphQLRpcHttpBySpecTest.class.getResource(testSpecFile), Charsets.UTF_8); + EthGraphQLHttpBySpecTest.class.getResource(testSpecFile), Charsets.UTF_8); final JsonObject spec = new JsonObject(json); final String rawRequestBody = spec.getString("request"); diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/EthGraphQLRpcHttpBySpecTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/EthGraphQLHttpBySpecTest.java similarity index 89% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/EthGraphQLRpcHttpBySpecTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/EthGraphQLHttpBySpecTest.java index d981bbc10a..e874c3c384 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/EthGraphQLRpcHttpBySpecTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/EthGraphQLHttpBySpecTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.assertj.core.api.Assertions.assertThat; @@ -31,11 +31,11 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) -public class EthGraphQLRpcHttpBySpecTest extends AbstractEthGraphQLRpcHttpServiceTest { +public class EthGraphQLHttpBySpecTest extends AbstractEthGraphQLHttpServiceTest { private final String specFileName; - public EthGraphQLRpcHttpBySpecTest(final String specFileName) { + public EthGraphQLHttpBySpecTest(final String specFileName) { this.specFileName = specFileName; } @@ -93,15 +93,15 @@ public static Collection specs() { } @Test - public void graphQLRPCCallWithSpecFile() throws Exception { - graphQLRPCCall(specFileName); + public void graphQLCallWithSpecFile() throws Exception { + graphQLCall(specFileName); } - private void graphQLRPCCall(final String name) throws IOException { + private void graphQLCall(final String name) throws IOException { final String testSpecFile = name + ".json"; final String json = Resources.toString( - EthGraphQLRpcHttpBySpecTest.class.getResource(testSpecFile), Charsets.UTF_8); + EthGraphQLHttpBySpecTest.class.getResource(testSpecFile), Charsets.UTF_8); final JsonObject spec = new JsonObject(json); final String rawRequestBody = spec.getString("request"); final RequestBody requestBody = RequestBody.create(JSON, rawRequestBody); diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcConfigurationTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLConfigurationTest.java similarity index 82% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcConfigurationTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLConfigurationTest.java index d36f8f7d56..61faaaeab5 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcConfigurationTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLConfigurationTest.java @@ -10,17 +10,17 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; -public class GraphQLRpcConfigurationTest { +public class GraphQLConfigurationTest { @Test public void defaultConfiguration() { - final GraphQLRpcConfiguration configuration = GraphQLRpcConfiguration.createDefault(); + final GraphQLConfiguration configuration = GraphQLConfiguration.createDefault(); assertThat(configuration.isEnabled()).isFalse(); assertThat(configuration.getHost()).isEqualTo("127.0.0.1"); diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpServiceCorsTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpServiceCorsTest.java similarity index 73% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpServiceCorsTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpServiceCorsTest.java index 63ac4b9c93..2d48e8270d 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpServiceCorsTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpServiceCorsTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -20,7 +20,7 @@ import tech.pegasys.pantheon.ethereum.core.Synchronizer; import tech.pegasys.pantheon.ethereum.eth.EthProtocol; import tech.pegasys.pantheon.ethereum.eth.transactions.TransactionPool; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; import tech.pegasys.pantheon.ethereum.p2p.wire.Capability; import java.util.HashSet; @@ -38,16 +38,16 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; -public class GraphQLRpcHttpServiceCorsTest { +public class GraphQLHttpServiceCorsTest { @Rule public final TemporaryFolder folder = new TemporaryFolder(); private final Vertx vertx = Vertx.vertx(); private final OkHttpClient client = new OkHttpClient(); - private GraphQLRpcHttpService graphQLRpcHttpService; + private GraphQLHttpService graphQLHttpService; @Before public void before() { - final GraphQLRpcConfiguration configuration = GraphQLRpcConfiguration.createDefault(); + final GraphQLConfiguration configuration = GraphQLConfiguration.createDefault(); configuration.setPort(0); } @@ -55,17 +55,17 @@ public void before() { public void after() { client.dispatcher().executorService().shutdown(); client.connectionPool().evictAll(); - graphQLRpcHttpService.stop().join(); + graphQLHttpService.stop().join(); vertx.close(); } @Test public void requestWithNonAcceptedOriginShouldFail() throws Exception { - graphQLRpcHttpService = createGraphQLRpcHttpServiceWithAllowedDomains("http://foo.io"); + graphQLHttpService = createGraphQLHttpServiceWithAllowedDomains("http://foo.io"); final Request request = new Request.Builder() - .url(graphQLRpcHttpService.url() + "/graphql?query={protocolVersion}") + .url(graphQLHttpService.url() + "/graphql?query={protocolVersion}") .header("Origin", "http://bar.me") .build(); @@ -76,11 +76,11 @@ public void requestWithNonAcceptedOriginShouldFail() throws Exception { @Test public void requestWithAcceptedOriginShouldSucceed() throws Exception { - graphQLRpcHttpService = createGraphQLRpcHttpServiceWithAllowedDomains("http://foo.io"); + graphQLHttpService = createGraphQLHttpServiceWithAllowedDomains("http://foo.io"); final Request request = new Request.Builder() - .url(graphQLRpcHttpService.url() + "/graphql?query={protocolVersion}") + .url(graphQLHttpService.url() + "/graphql?query={protocolVersion}") .header("Origin", "http://foo.io") .build(); @@ -92,12 +92,12 @@ public void requestWithAcceptedOriginShouldSucceed() throws Exception { @Test public void requestWithOneOfMultipleAcceptedOriginsShouldSucceed() throws Exception { - graphQLRpcHttpService = - createGraphQLRpcHttpServiceWithAllowedDomains("http://foo.io", "http://bar.me"); + graphQLHttpService = + createGraphQLHttpServiceWithAllowedDomains("http://foo.io", "http://bar.me"); final Request request = new Request.Builder() - .url(graphQLRpcHttpService.url() + "/graphql?query={protocolVersion}") + .url(graphQLHttpService.url() + "/graphql?query={protocolVersion}") .header("Origin", "http://bar.me") .build(); @@ -108,12 +108,12 @@ public void requestWithOneOfMultipleAcceptedOriginsShouldSucceed() throws Except @Test public void requestWithNoneOfMultipleAcceptedOriginsShouldFail() throws Exception { - graphQLRpcHttpService = - createGraphQLRpcHttpServiceWithAllowedDomains("http://foo.io", "http://bar.me"); + graphQLHttpService = + createGraphQLHttpServiceWithAllowedDomains("http://foo.io", "http://bar.me"); final Request request = new Request.Builder() - .url(graphQLRpcHttpService.url() + "/graphql?query={protocolVersion}") + .url(graphQLHttpService.url() + "/graphql?query={protocolVersion}") .header("Origin", "http://hel.lo") .build(); @@ -124,11 +124,11 @@ public void requestWithNoneOfMultipleAcceptedOriginsShouldFail() throws Exceptio @Test public void requestWithNoOriginShouldSucceedWhenNoCorsConfigSet() throws Exception { - graphQLRpcHttpService = createGraphQLRpcHttpServiceWithAllowedDomains(); + graphQLHttpService = createGraphQLHttpServiceWithAllowedDomains(); final Request request = new Request.Builder() - .url(graphQLRpcHttpService.url() + "/graphql?query={protocolVersion}") + .url(graphQLHttpService.url() + "/graphql?query={protocolVersion}") .build(); try (final Response response = client.newCall(request).execute()) { @@ -138,9 +138,9 @@ public void requestWithNoOriginShouldSucceedWhenNoCorsConfigSet() throws Excepti @Test public void requestWithNoOriginShouldSucceedWhenCorsIsSet() throws Exception { - graphQLRpcHttpService = createGraphQLRpcHttpServiceWithAllowedDomains("http://foo.io"); + graphQLHttpService = createGraphQLHttpServiceWithAllowedDomains("http://foo.io"); - final Request request = new Request.Builder().url(graphQLRpcHttpService.url()).build(); + final Request request = new Request.Builder().url(graphQLHttpService.url()).build(); try (final Response response = client.newCall(request).execute()) { assertThat(response.isSuccessful()).isTrue(); @@ -149,11 +149,11 @@ public void requestWithNoOriginShouldSucceedWhenCorsIsSet() throws Exception { @Test public void requestWithAnyOriginShouldNotSucceedWhenCorsIsEmpty() throws Exception { - graphQLRpcHttpService = createGraphQLRpcHttpServiceWithAllowedDomains(""); + graphQLHttpService = createGraphQLHttpServiceWithAllowedDomains(""); final Request request = new Request.Builder() - .url(graphQLRpcHttpService.url() + "/graphql?query={protocolVersion}") + .url(graphQLHttpService.url() + "/graphql?query={protocolVersion}") .header("Origin", "http://bar.me") .build(); @@ -164,11 +164,11 @@ public void requestWithAnyOriginShouldNotSucceedWhenCorsIsEmpty() throws Excepti @Test public void requestWithAnyOriginShouldSucceedWhenCorsIsStart() throws Exception { - graphQLRpcHttpService = createGraphQLRpcHttpServiceWithAllowedDomains("*"); + graphQLHttpService = createGraphQLHttpServiceWithAllowedDomains("*"); final Request request = new Request.Builder() - .url(graphQLRpcHttpService.url() + "/graphql?query={protocolVersion}") + .url(graphQLHttpService.url() + "/graphql?query={protocolVersion}") .header("Origin", "http://bar.me") .build(); @@ -179,11 +179,11 @@ public void requestWithAnyOriginShouldSucceedWhenCorsIsStart() throws Exception @Test public void requestWithAccessControlRequestMethodShouldReturnAllowedHeaders() throws Exception { - graphQLRpcHttpService = createGraphQLRpcHttpServiceWithAllowedDomains("http://foo.io"); + graphQLHttpService = createGraphQLHttpServiceWithAllowedDomains("http://foo.io"); final Request request = new Request.Builder() - .url(graphQLRpcHttpService.url() + "/graphql?query={protocolVersion}") + .url(graphQLHttpService.url() + "/graphql?query={protocolVersion}") .method("OPTIONS", null) .header("Access-Control-Request-Method", "OPTIONS") .header("Origin", "http://foo.io") @@ -194,9 +194,9 @@ public void requestWithAccessControlRequestMethodShouldReturnAllowedHeaders() th } } - private GraphQLRpcHttpService createGraphQLRpcHttpServiceWithAllowedDomains( + private GraphQLHttpService createGraphQLHttpServiceWithAllowedDomains( final String... corsAllowedDomains) throws Exception { - final GraphQLRpcConfiguration config = GraphQLRpcConfiguration.createDefault(); + final GraphQLConfiguration config = GraphQLConfiguration.createDefault(); config.setPort(0); if (corsAllowedDomains != null) { config.setCorsAllowedDomains(Lists.newArrayList(corsAllowedDomains)); @@ -220,11 +220,11 @@ private GraphQLRpcHttpService createGraphQLRpcHttpServiceWithAllowedDomains( final GraphQLDataFetchers dataFetchers = new GraphQLDataFetchers(supportedCapabilities); final GraphQL graphQL = GraphQLProvider.buildGraphQL(dataFetchers); - final GraphQLRpcHttpService graphQLRpcHttpService = - new GraphQLRpcHttpService( + final GraphQLHttpService graphQLHttpService = + new GraphQLHttpService( vertx, folder.newFolder().toPath(), config, graphQL, dataFetcherContext); - graphQLRpcHttpService.start().join(); + graphQLHttpService.start().join(); - return graphQLRpcHttpService; + return graphQLHttpService; } } diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpServiceHostWhitelistTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpServiceHostWhitelistTest.java similarity index 83% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpServiceHostWhitelistTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpServiceHostWhitelistTest.java index 715a9e8da0..56699e93e2 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpServiceHostWhitelistTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpServiceHostWhitelistTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -20,7 +20,7 @@ import tech.pegasys.pantheon.ethereum.core.Synchronizer; import tech.pegasys.pantheon.ethereum.eth.EthProtocol; import tech.pegasys.pantheon.ethereum.eth.transactions.TransactionPool; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; import tech.pegasys.pantheon.ethereum.p2p.wire.Capability; import java.io.IOException; @@ -42,31 +42,31 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; -public class GraphQLRpcHttpServiceHostWhitelistTest { +public class GraphQLHttpServiceHostWhitelistTest { @ClassRule public static final TemporaryFolder folder = new TemporaryFolder(); protected static Vertx vertx; - private static GraphQLRpcHttpService service; + private static GraphQLHttpService service; private static OkHttpClient client; private static String baseUrl; private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); - private final GraphQLRpcConfiguration graphQLRpcConfig = createGraphQLRpcConfig(); + private final GraphQLConfiguration graphQLConfig = createGraphQLConfig(); private final List hostsWhitelist = Arrays.asList("ally", "friend"); @Before public void initServerAndClient() throws Exception { vertx = Vertx.vertx(); - service = createGraphQLRpcHttpService(); + service = createGraphQLHttpService(); service.start().join(); client = new OkHttpClient(); baseUrl = service.url(); } - private GraphQLRpcHttpService createGraphQLRpcHttpService() throws Exception { + private GraphQLHttpService createGraphQLHttpService() throws Exception { final BlockchainQuery blockchainQueries = mock(BlockchainQuery.class); final Synchronizer synchronizer = mock(Synchronizer.class); @@ -85,12 +85,12 @@ private GraphQLRpcHttpService createGraphQLRpcHttpService() throws Exception { final GraphQLDataFetchers dataFetchers = new GraphQLDataFetchers(supportedCapabilities); final GraphQL graphQL = GraphQLProvider.buildGraphQL(dataFetchers); - return new GraphQLRpcHttpService( - vertx, folder.newFolder().toPath(), graphQLRpcConfig, graphQL, dataFetcherContext); + return new GraphQLHttpService( + vertx, folder.newFolder().toPath(), graphQLConfig, graphQL, dataFetcherContext); } - private static GraphQLRpcConfiguration createGraphQLRpcConfig() { - final GraphQLRpcConfiguration config = GraphQLRpcConfiguration.createDefault(); + private static GraphQLConfiguration createGraphQLConfig() { + final GraphQLConfiguration config = GraphQLConfiguration.createDefault(); config.setPort(0); return config; } @@ -115,14 +115,14 @@ public void requestWithEmptyHeaderAndDefaultConfigIsRejected() throws IOExceptio @Test public void requestWithAnyHostnameAndWildcardConfigIsAccepted() throws IOException { - graphQLRpcConfig.setHostsWhitelist(Collections.singletonList("*")); + graphQLConfig.setHostsWhitelist(Collections.singletonList("*")); assertThat(doRequest("ally")).isEqualTo(200); assertThat(doRequest("foe")).isEqualTo(200); } @Test public void requestWithWhitelistedHostIsAccepted() throws IOException { - graphQLRpcConfig.setHostsWhitelist(hostsWhitelist); + graphQLConfig.setHostsWhitelist(hostsWhitelist); assertThat(doRequest("ally")).isEqualTo(200); assertThat(doRequest("ally:12345")).isEqualTo(200); assertThat(doRequest("friend")).isEqualTo(200); @@ -130,7 +130,7 @@ public void requestWithWhitelistedHostIsAccepted() throws IOException { @Test public void requestWithUnknownHostIsRejected() throws IOException { - graphQLRpcConfig.setHostsWhitelist(hostsWhitelist); + graphQLConfig.setHostsWhitelist(hostsWhitelist); assertThat(doRequest("foe")).isEqualTo(403); } @@ -148,7 +148,7 @@ private int doRequest(final String hostname) throws IOException { @Test public void requestWithMalformedHostIsRejected() throws IOException { - graphQLRpcConfig.setHostsWhitelist(hostsWhitelist); + graphQLConfig.setHostsWhitelist(hostsWhitelist); assertThat(doRequest("ally:friend")).isEqualTo(403); assertThat(doRequest("ally:123456")).isEqualTo(403); assertThat(doRequest("ally:friend:1234")).isEqualTo(403); diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpServiceTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpServiceTest.java similarity index 85% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpServiceTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpServiceTest.java index dc3cd2a59f..9d4ef41d08 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcHttpServiceTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLHttpServiceTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.anyLong; @@ -24,9 +24,9 @@ import tech.pegasys.pantheon.ethereum.core.Wei; import tech.pegasys.pantheon.ethereum.eth.EthProtocol; import tech.pegasys.pantheon.ethereum.eth.transactions.TransactionPool; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockWithMetadata; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.BlockchainQuery; -import tech.pegasys.pantheon.ethereum.graphqlrpc.internal.TransactionWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockWithMetadata; +import tech.pegasys.pantheon.ethereum.graphql.internal.BlockchainQuery; +import tech.pegasys.pantheon.ethereum.graphql.internal.TransactionWithMetadata; import tech.pegasys.pantheon.ethereum.p2p.wire.Capability; import tech.pegasys.pantheon.util.bytes.BytesValue; @@ -51,13 +51,13 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; -public class GraphQLRpcHttpServiceTest { +public class GraphQLHttpServiceTest { @ClassRule public static final TemporaryFolder folder = new TemporaryFolder(); private static final Vertx vertx = Vertx.vertx(); - private static GraphQLRpcHttpService service; + private static GraphQLHttpService service; private static OkHttpClient client; private static String baseUrl; protected static final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); @@ -68,7 +68,7 @@ public class GraphQLRpcHttpServiceTest { private static GraphQLDataFetcherContext dataFetcherContext; private static EthHashMiningCoordinator miningCoordinatorMock; - private final GraphQLRpcTestHelper testHelper = new GraphQLRpcTestHelper(); + private final GraphQLTestHelper testHelper = new GraphQLTestHelper(); @BeforeClass public static void initServerAndClient() throws Exception { @@ -90,26 +90,26 @@ public static void initServerAndClient() throws Exception { supportedCapabilities.add(EthProtocol.ETH63); dataFetchers = new GraphQLDataFetchers(supportedCapabilities); graphQL = GraphQLProvider.buildGraphQL(dataFetchers); - service = createGraphQLRpcHttpService(); + service = createGraphQLHttpService(); service.start().join(); // Build an OkHttp client. client = new OkHttpClient(); baseUrl = service.url() + "/graphql/"; } - private static GraphQLRpcHttpService createGraphQLRpcHttpService( - final GraphQLRpcConfiguration config) throws Exception { - return new GraphQLRpcHttpService( + private static GraphQLHttpService createGraphQLHttpService(final GraphQLConfiguration config) + throws Exception { + return new GraphQLHttpService( vertx, folder.newFolder().toPath(), config, graphQL, dataFetcherContext); } - private static GraphQLRpcHttpService createGraphQLRpcHttpService() throws Exception { - return new GraphQLRpcHttpService( - vertx, folder.newFolder().toPath(), createGraphQLRpcConfig(), graphQL, dataFetcherContext); + private static GraphQLHttpService createGraphQLHttpService() throws Exception { + return new GraphQLHttpService( + vertx, folder.newFolder().toPath(), createGraphQLConfig(), graphQL, dataFetcherContext); } - private static GraphQLRpcConfiguration createGraphQLRpcConfig() { - final GraphQLRpcConfiguration config = GraphQLRpcConfiguration.createDefault(); + private static GraphQLConfiguration createGraphQLConfig() { + final GraphQLConfiguration config = GraphQLConfiguration.createDefault(); config.setPort(0); return config; } @@ -118,15 +118,14 @@ private static GraphQLRpcConfiguration createGraphQLRpcConfig() { public static void setupConstants() { final URL blocksUrl = - GraphQLRpcHttpServiceTest.class + GraphQLHttpServiceTest.class .getClassLoader() - .getResource( - "tech/pegasys/pantheon/ethereum/graphqlrpc/graphQLRpcTestBlockchain.blocks"); + .getResource("tech/pegasys/pantheon/ethereum/graphql/graphQLTestBlockchain.blocks"); final URL genesisJsonUrl = - GraphQLRpcHttpServiceTest.class + GraphQLHttpServiceTest.class .getClassLoader() - .getResource("tech/pegasys/pantheon/ethereum/graphqlrpc/graphQLRpcTestGenesis.json"); + .getResource("tech/pegasys/pantheon/ethereum/graphql/graphQLTestGenesis.json"); assertThat(blocksUrl).isNotNull(); assertThat(genesisJsonUrl).isNotNull(); @@ -171,7 +170,7 @@ public void handleInvalidQuerySchema() throws Exception { try (final Response resp = client.newCall(buildPostRequest(body)).execute()) { // assertThat(resp.code()).isEqualTo(200); // Check general format of result final JsonObject json = new JsonObject(resp.body().string()); - testHelper.assertValidGraphQLRpcError(json); // Check result final + testHelper.assertValidGraphQLError(json); // Check result final } } @@ -184,7 +183,7 @@ public void getGasprice() throws Exception { try (final Response resp = client.newCall(buildPostRequest(body)).execute()) { assertThat(resp.code()).isEqualTo(200); // Check general format of result final JsonObject json = new JsonObject(resp.body().string()); - testHelper.assertValidGraphQLRpcResult(json); + testHelper.assertValidGraphQLResult(json); final String result = json.getJsonObject("data").getString("gasPrice"); assertThat(result).isEqualTo("0x10"); } @@ -199,7 +198,7 @@ public void getSocketAddressWhenActive() { @Test public void getSocketAddressWhenStoppedIsEmpty() throws Exception { - final GraphQLRpcHttpService service = createGraphQLRpcHttpService(); + final GraphQLHttpService service = createGraphQLHttpService(); final InetSocketAddress socketAddress = service.socketAddress(); assertThat("0.0.0.0").isEqualTo(socketAddress.getAddress().getHostAddress()); @@ -209,9 +208,9 @@ public void getSocketAddressWhenStoppedIsEmpty() throws Exception { @Test public void getSocketAddressWhenBindingToAllInterfaces() throws Exception { - final GraphQLRpcConfiguration config = createGraphQLRpcConfig(); + final GraphQLConfiguration config = createGraphQLConfig(); config.setHost("0.0.0.0"); - final GraphQLRpcHttpService service = createGraphQLRpcHttpService(config); + final GraphQLHttpService service = createGraphQLHttpService(config); service.start().join(); try { @@ -254,7 +253,7 @@ public void ethGetUncleCountByBlockHash() throws Exception { assertThat(resp.code()).isEqualTo(200); final String jsonStr = resp.body().string(); final JsonObject json = new JsonObject(jsonStr); - testHelper.assertValidGraphQLRpcResult(json); + testHelper.assertValidGraphQLResult(json); final int result = json.getJsonObject("data").getJsonObject("block").getInteger("ommerCount"); assertThat(result).isEqualTo(uncleCount); } @@ -278,7 +277,7 @@ public void ethGetUncleCountByBlockNumber() throws Exception { assertThat(resp.code()).isEqualTo(200); final String jsonStr = resp.body().string(); final JsonObject json = new JsonObject(jsonStr); - testHelper.assertValidGraphQLRpcResult(json); + testHelper.assertValidGraphQLResult(json); final int result = json.getJsonObject("data").getJsonObject("block").getInteger("ommerCount"); assertThat(result).isEqualTo(uncleCount); } @@ -302,7 +301,7 @@ public void ethGetUncleCountByBlockLatest() throws Exception { assertThat(resp.code()).isEqualTo(200); final String jsonStr = resp.body().string(); final JsonObject json = new JsonObject(jsonStr); - testHelper.assertValidGraphQLRpcResult(json); + testHelper.assertValidGraphQLResult(json); final int result = json.getJsonObject("data").getJsonObject("block").getInteger("ommerCount"); assertThat(result).isEqualTo(uncleCount); } diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcTestHelper.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLTestHelper.java similarity index 84% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcTestHelper.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLTestHelper.java index 01286b919d..614474b5a2 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/GraphQLRpcTestHelper.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/GraphQLTestHelper.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc; +package tech.pegasys.pantheon.ethereum.graphql; import static org.assertj.core.api.Assertions.assertThat; @@ -18,16 +18,16 @@ import io.vertx.core.json.JsonObject; -class GraphQLRpcTestHelper { +class GraphQLTestHelper { - void assertValidGraphQLRpcResult(final JsonObject json) { + void assertValidGraphQLResult(final JsonObject json) { // Check all expected fieldnames are set final Set fieldNames = json.fieldNames(); assertThat(fieldNames.size()).isEqualTo(1); assertThat(fieldNames.contains("data")).isTrue(); } - void assertValidGraphQLRpcError(final JsonObject json) { + void assertValidGraphQLError(final JsonObject json) { // Check all expected fieldnames are set final Set fieldNames = json.fieldNames(); assertThat(fieldNames.size()).isEqualTo(1); diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/AddressScalarTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/AddressScalarTest.java similarity index 97% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/AddressScalarTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/AddressScalarTest.java index 84bfcec6b8..de2fc983e0 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/AddressScalarTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/AddressScalarTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BigIntScalarTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BigIntScalarTest.java similarity index 97% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BigIntScalarTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BigIntScalarTest.java index a1a176d6f5..0769a5cfe4 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BigIntScalarTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BigIntScalarTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/Bytes32ScalarTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/Bytes32ScalarTest.java similarity index 97% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/Bytes32ScalarTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/Bytes32ScalarTest.java index d60dfd53bc..f88834fe1a 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/Bytes32ScalarTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/Bytes32ScalarTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BytesScalarTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BytesScalarTest.java similarity index 97% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BytesScalarTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BytesScalarTest.java index 19892117c6..52e7686e29 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/BytesScalarTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/BytesScalarTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/LongScalarTest.java b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/LongScalarTest.java similarity index 97% rename from ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/LongScalarTest.java rename to ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/LongScalarTest.java index b01abf11e6..a7ef1f9d71 100644 --- a/ethereum/graphqlrpc/src/test/java/tech/pegasys/pantheon/ethereum/graphqlrpc/internal/scalar/LongScalarTest.java +++ b/ethereum/graphql/src/test/java/tech/pegasys/pantheon/ethereum/graphql/internal/scalar/LongScalarTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.graphqlrpc.internal.scalar; +package tech.pegasys.pantheon.ethereum.graphql.internal.scalar; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_blockNumber.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_blockNumber.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_blockNumber.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_blockNumber.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_call_Block8.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_call_Block8.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_call_Block8.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_call_Block8.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_call_BlockLatest.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_call_BlockLatest.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_call_BlockLatest.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_call_BlockLatest.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_estimateGas_contractDeploy.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_estimateGas_contractDeploy.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_estimateGas_contractDeploy.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_estimateGas_contractDeploy.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_estimateGas_noParams.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_estimateGas_noParams.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_estimateGas_noParams.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_estimateGas_noParams.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_estimateGas_transfer.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_estimateGas_transfer.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_estimateGas_transfer.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_estimateGas_transfer.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_gasPrice.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_gasPrice.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_gasPrice.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_gasPrice.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_0x19.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_0x19.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_0x19.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_0x19.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_invalidAccountBlockNumber.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_invalidAccountBlockNumber.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_invalidAccountBlockNumber.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_invalidAccountBlockNumber.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_invalidAccountLatest.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_invalidAccountLatest.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_invalidAccountLatest.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_invalidAccountLatest.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_latest.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_latest.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_latest.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_latest.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_toobig_bn.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_toobig_bn.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_toobig_bn.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_toobig_bn.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_without_addr.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_without_addr.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBalance_without_addr.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBalance_without_addr.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockByHash.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockByHash.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockByHash.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockByHash.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockByNumber.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockByNumber.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockByNumber.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockByNumber.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockTransactionCountByHash.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockTransactionCountByHash.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockTransactionCountByHash.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockTransactionCountByHash.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockTransactionCountByNumber.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockTransactionCountByNumber.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockTransactionCountByNumber.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockTransactionCountByNumber.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockWrongParams.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockWrongParams.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlockWrongParams.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlockWrongParams.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlocksByRange.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlocksByRange.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlocksByRange.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlocksByRange.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlocksByWrongRange.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlocksByWrongRange.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getBlocksByWrongRange.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getBlocksByWrongRange.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getCode.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getCode.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getCode.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getCode.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getCode_noCode.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getCode_noCode.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getCode_noCode.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getCode_noCode.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getLogs_matchTopic.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getLogs_matchTopic.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getLogs_matchTopic.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getLogs_matchTopic.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getStorageAt.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getStorageAt.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getStorageAt.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getStorageAt.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getStorageAt_illegalRangeGreaterThan.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getStorageAt_illegalRangeGreaterThan.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getStorageAt_illegalRangeGreaterThan.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getStorageAt_illegalRangeGreaterThan.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByBlockHashAndIndex.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByBlockHashAndIndex.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByBlockHashAndIndex.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByBlockHashAndIndex.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByBlockNumberAndIndex.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByBlockNumberAndIndex.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByBlockNumberAndIndex.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByBlockNumberAndIndex.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByBlockNumberAndInvalidIndex.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByBlockNumberAndInvalidIndex.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByBlockNumberAndInvalidIndex.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByBlockNumberAndInvalidIndex.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByHash.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByHash.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByHash.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByHash.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByHashNull.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByHashNull.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionByHashNull.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionByHashNull.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionCount.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionCount.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionCount.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionCount.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionReceipt.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionReceipt.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_getTransactionReceipt.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_getTransactionReceipt.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_sendRawTransaction_contractCreation.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_sendRawTransaction_contractCreation.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_sendRawTransaction_contractCreation.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_sendRawTransaction_contractCreation.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_sendRawTransaction_messageCall.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_sendRawTransaction_messageCall.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_sendRawTransaction_messageCall.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_sendRawTransaction_messageCall.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_sendRawTransaction_transferEther.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_sendRawTransaction_transferEther.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_sendRawTransaction_transferEther.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_sendRawTransaction_transferEther.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_sendRawTransaction_unsignedTransaction.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_sendRawTransaction_unsignedTransaction.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_sendRawTransaction_unsignedTransaction.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_sendRawTransaction_unsignedTransaction.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_syncing.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_syncing.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/eth_syncing.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/eth_syncing.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/graphQLRpcTestBlockchain.blocks b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/graphQLTestBlockchain.blocks similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/graphQLRpcTestBlockchain.blocks rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/graphQLTestBlockchain.blocks diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/graphQLRpcTestGenesis.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/graphQLTestGenesis.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/graphQLRpcTestGenesis.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/graphQLTestGenesis.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/graphql_blocks_noTo.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/graphql_blocks_noTo.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/graphql_blocks_noTo.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/graphql_blocks_noTo.json diff --git a/ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/graphql_pending.json b/ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/graphql_pending.json similarity index 100% rename from ethereum/graphqlrpc/src/test/resources/tech/pegasys/pantheon/ethereum/graphqlrpc/graphql_pending.json rename to ethereum/graphql/src/test/resources/tech/pegasys/pantheon/ethereum/graphql/graphql_pending.json diff --git a/pantheon/build.gradle b/pantheon/build.gradle index d794975757..4f97f3a1d4 100644 --- a/pantheon/build.gradle +++ b/pantheon/build.gradle @@ -37,7 +37,7 @@ dependencies { implementation project(':ethereum:core') implementation project(':ethereum:eth') implementation project(':ethereum:jsonrpc') - implementation project(':ethereum:graphqlrpc') + implementation project(':ethereum:graphql') implementation project(':ethereum:permissioning') implementation project(':ethereum:p2p') implementation project(':ethereum:rlp') diff --git a/pantheon/src/main/java/tech/pegasys/pantheon/Runner.java b/pantheon/src/main/java/tech/pegasys/pantheon/Runner.java index 17a2f31f34..cf26c58a77 100644 --- a/pantheon/src/main/java/tech/pegasys/pantheon/Runner.java +++ b/pantheon/src/main/java/tech/pegasys/pantheon/Runner.java @@ -13,7 +13,7 @@ package tech.pegasys.pantheon; import tech.pegasys.pantheon.controller.PantheonController; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLRpcHttpService; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLHttpService; import tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcHttpService; import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketService; import tech.pegasys.pantheon.ethereum.p2p.NetworkRunner; @@ -43,7 +43,7 @@ public class Runner implements AutoCloseable { private final NetworkRunner networkRunner; private final Optional jsonRpc; - private final Optional graphQLRpc; + private final Optional graphQLHttp; private final Optional websocketRpc; private final Optional metrics; @@ -54,14 +54,14 @@ public class Runner implements AutoCloseable { final Vertx vertx, final NetworkRunner networkRunner, final Optional jsonRpc, - final Optional graphQLRpc, + final Optional graphQLHttp, final Optional websocketRpc, final Optional metrics, final PantheonController pantheonController, final Path dataDir) { this.vertx = vertx; this.networkRunner = networkRunner; - this.graphQLRpc = graphQLRpc; + this.graphQLHttp = graphQLHttp; this.jsonRpc = jsonRpc; this.websocketRpc = websocketRpc; this.metrics = metrics; @@ -84,7 +84,7 @@ public void start() { .getPendingTransactions() .evictOldTransactions()); jsonRpc.ifPresent(service -> waitForServiceToStart("jsonRpc", service.start())); - graphQLRpc.ifPresent(service -> waitForServiceToStart("graphQLRpc", service.start())); + graphQLHttp.ifPresent(service -> waitForServiceToStart("graphQLHttp", service.start())); websocketRpc.ifPresent(service -> waitForServiceToStop("websocketRpc", service.start())); metrics.ifPresent(service -> waitForServiceToStart("metrics", service.start())); LOG.info("Ethereum main loop is up."); @@ -115,7 +115,7 @@ public void close() throws Exception { networkRunner.awaitStop(); jsonRpc.ifPresent(service -> waitForServiceToStop("jsonRpc", service.stop())); - graphQLRpc.ifPresent(service -> waitForServiceToStop("graphQLRpc", service.stop())); + graphQLHttp.ifPresent(service -> waitForServiceToStop("graphQLHttp", service.stop())); websocketRpc.ifPresent(service -> waitForServiceToStop("websocketRpc", service.stop())); metrics.ifPresent(service -> waitForServiceToStop("metrics", service.stop())); } finally { @@ -180,8 +180,8 @@ private void writePantheonPortsToFile() { if (getJsonRpcPort().isPresent()) { properties.setProperty("json-rpc", String.valueOf(getJsonRpcPort().get())); } - if (getGraphQLRpcPort().isPresent()) { - properties.setProperty("graphql-rpc", String.valueOf(getGraphQLRpcPort().get())); + if (getGraphQLHttpPort().isPresent()) { + properties.setProperty("graphql-http", String.valueOf(getGraphQLHttpPort().get())); } if (getWebsocketPort().isPresent()) { properties.setProperty("ws-rpc", String.valueOf(getWebsocketPort().get())); @@ -206,8 +206,8 @@ public Optional getJsonRpcPort() { return jsonRpc.map(service -> service.socketAddress().getPort()); } - public Optional getGraphQLRpcPort() { - return graphQLRpc.map(service -> service.socketAddress().getPort()); + public Optional getGraphQLHttpPort() { + return graphQLHttp.map(service -> service.socketAddress().getPort()); } public Optional getWebsocketPort() { diff --git a/pantheon/src/main/java/tech/pegasys/pantheon/RunnerBuilder.java b/pantheon/src/main/java/tech/pegasys/pantheon/RunnerBuilder.java index a2a8ef56ea..f9d14e057a 100644 --- a/pantheon/src/main/java/tech/pegasys/pantheon/RunnerBuilder.java +++ b/pantheon/src/main/java/tech/pegasys/pantheon/RunnerBuilder.java @@ -21,11 +21,11 @@ import tech.pegasys.pantheon.ethereum.core.PrivacyParameters; import tech.pegasys.pantheon.ethereum.core.Synchronizer; import tech.pegasys.pantheon.ethereum.eth.transactions.TransactionPool; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLDataFetcherContext; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLDataFetchers; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLProvider; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLRpcConfiguration; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLRpcHttpService; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLConfiguration; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLDataFetcherContext; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLDataFetchers; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLHttpService; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLProvider; import tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcConfiguration; import tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcHttpService; import tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcMethodsFactory; @@ -102,7 +102,7 @@ public class RunnerBuilder { private int p2pListenPort; private int maxPeers; private JsonRpcConfiguration jsonRpcConfiguration; - private GraphQLRpcConfiguration graphQLRpcConfiguration; + private GraphQLConfiguration graphQLConfiguration; private WebSocketConfiguration webSocketConfiguration; private Path dataDir; private Collection bannedNodeIds = new ArrayList<>(); @@ -156,9 +156,8 @@ public RunnerBuilder jsonRpcConfiguration(final JsonRpcConfiguration jsonRpcConf return this; } - public RunnerBuilder graphQLRpcConfiguration( - final GraphQLRpcConfiguration graphQLRpcConfiguration) { - this.graphQLRpcConfiguration = graphQLRpcConfiguration; + public RunnerBuilder graphQLConfiguration(final GraphQLConfiguration graphQLConfiguration) { + this.graphQLConfiguration = graphQLConfiguration; return this; } @@ -340,8 +339,8 @@ public Runner build() { vertx, dataDir, jsonRpcConfiguration, metricsSystem, jsonRpcMethods)); } - Optional graphQLRpcHttpService = Optional.empty(); - if (graphQLRpcConfiguration.isEnabled()) { + Optional graphQLHttpService = Optional.empty(); + if (graphQLConfiguration.isEnabled()) { final GraphQLDataFetchers fetchers = new GraphQLDataFetchers(supportedCapabilities); final GraphQLDataFetcherContext dataFetcherContext = new GraphQLDataFetcherContext( @@ -358,10 +357,10 @@ public Runner build() { throw new RuntimeException(ioe); } - graphQLRpcHttpService = + graphQLHttpService = Optional.of( - new GraphQLRpcHttpService( - vertx, dataDir, graphQLRpcConfiguration, graphQL, dataFetcherContext)); + new GraphQLHttpService( + vertx, dataDir, graphQLConfiguration, graphQL, dataFetcherContext)); } Optional webSocketService = Optional.empty(); @@ -412,7 +411,7 @@ public Runner build() { vertx, networkRunner, jsonRpcHttpService, - graphQLRpcHttpService, + graphQLHttpService, webSocketService, metricsService, pantheonController, diff --git a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java index 559357af28..339f20cc0d 100644 --- a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java +++ b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java @@ -20,7 +20,7 @@ import static tech.pegasys.pantheon.cli.DefaultCommandValues.getDefaultPantheonDataPath; import static tech.pegasys.pantheon.cli.NetworkName.MAINNET; import static tech.pegasys.pantheon.controller.PantheonController.DATABASE_PATH; -import static tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLRpcConfiguration.DEFAULT_GRAPHQL_RPC_PORT; +import static tech.pegasys.pantheon.ethereum.graphql.GraphQLConfiguration.DEFAULT_GRAPHQL_HTTP_PORT; import static tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcConfiguration.DEFAULT_JSON_RPC_PORT; import static tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis.DEFAULT_JSON_RPC_APIS; import static tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketConfiguration.DEFAULT_WEBSOCKET_PORT; @@ -49,7 +49,7 @@ import tech.pegasys.pantheon.ethereum.eth.sync.SynchronizerConfiguration; import tech.pegasys.pantheon.ethereum.eth.sync.TrailingPeerRequirements; import tech.pegasys.pantheon.ethereum.eth.transactions.PendingTransactions; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLRpcConfiguration; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLConfiguration; import tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcConfiguration; import tech.pegasys.pantheon.ethereum.jsonrpc.RpcApi; import tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis; @@ -282,23 +282,23 @@ void setBannedNodeIds(final List values) { @Option( names = {"--graphql-http-enabled"}, - description = "Set to start the GraphQL-RPC HTTP service (default: ${DEFAULT-VALUE})") + description = "Set to start the GraphQL HTTP service (default: ${DEFAULT-VALUE})") private final Boolean isGraphQLHttpEnabled = false; @SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final. @Option( names = {"--graphql-http-host"}, paramLabel = MANDATORY_HOST_FORMAT_HELP, - description = "Host for GraphQL-RPC HTTP to listen on (default: ${DEFAULT-VALUE})", + description = "Host for GraphQL HTTP to listen on (default: ${DEFAULT-VALUE})", arity = "1") private String graphQLHttpHost = autoDiscoverDefaultIP().getHostAddress(); @Option( names = {"--graphql-http-port"}, paramLabel = MANDATORY_PORT_FORMAT_HELP, - description = "Port for GraphQL-RPC HTTP to listen on (default: ${DEFAULT-VALUE})", + description = "Port for GraphQL HTTP to listen on (default: ${DEFAULT-VALUE})", arity = "1") - private final Integer graphQLHttpPort = DEFAULT_GRAPHQL_RPC_PORT; + private final Integer graphQLHttpPort = DEFAULT_GRAPHQL_HTTP_PORT; @Option( names = {"--graphql-http-cors-origins"}, @@ -706,7 +706,7 @@ public void run() { final EthNetworkConfig ethNetworkConfig = updateNetworkConfig(getNetwork()); try { final JsonRpcConfiguration jsonRpcConfiguration = jsonRpcConfiguration(); - final GraphQLRpcConfiguration graphQLRpcConfiguration = graphQLRpcConfiguration(); + final GraphQLConfiguration graphQLConfiguration = graphQLConfiguration(); final WebSocketConfiguration webSocketConfiguration = webSocketConfiguration(); final Optional permissioningConfiguration = permissioningConfiguration(); @@ -746,7 +746,7 @@ public void run() { maxPeers, p2pHost, p2pPort, - graphQLRpcConfiguration, + graphQLConfiguration, jsonRpcConfiguration, webSocketConfiguration, metricsConfiguration, @@ -798,7 +798,7 @@ PantheonController buildController() { } } - private GraphQLRpcConfiguration graphQLRpcConfiguration() { + private GraphQLConfiguration graphQLConfiguration() { checkOptionDependencies( logger, @@ -807,14 +807,14 @@ private GraphQLRpcConfiguration graphQLRpcConfiguration() { !isRpcHttpEnabled, asList("--graphql-http-cors-origins", "--graphql-http-host", "--graphql-http-port")); - final GraphQLRpcConfiguration graphQLRpcConfiguration = GraphQLRpcConfiguration.createDefault(); - graphQLRpcConfiguration.setEnabled(isGraphQLHttpEnabled); - graphQLRpcConfiguration.setHost(graphQLHttpHost); - graphQLRpcConfiguration.setPort(graphQLHttpPort); - graphQLRpcConfiguration.setHostsWhitelist(hostsWhitelist); - graphQLRpcConfiguration.setCorsAllowedDomains(graphQLHttpCorsAllowedOrigins); + final GraphQLConfiguration graphQLConfiguration = GraphQLConfiguration.createDefault(); + graphQLConfiguration.setEnabled(isGraphQLHttpEnabled); + graphQLConfiguration.setHost(graphQLHttpHost); + graphQLConfiguration.setPort(graphQLHttpPort); + graphQLConfiguration.setHostsWhitelist(hostsWhitelist); + graphQLConfiguration.setCorsAllowedDomains(graphQLHttpCorsAllowedOrigins); - return graphQLRpcConfiguration; + return graphQLConfiguration; } private JsonRpcConfiguration jsonRpcConfiguration() { @@ -1049,7 +1049,7 @@ private void synchronize( final int maxPeers, final String p2pAdvertisedHost, final int p2pListenPort, - final GraphQLRpcConfiguration graphQLRpcConfiguration, + final GraphQLConfiguration graphQLConfiguration, final JsonRpcConfiguration jsonRpcConfiguration, final WebSocketConfiguration webSocketConfiguration, final MetricsConfiguration metricsConfiguration, @@ -1071,7 +1071,7 @@ private void synchronize( .p2pAdvertisedHost(p2pAdvertisedHost) .p2pListenPort(p2pListenPort) .maxPeers(maxPeers) - .graphQLRpcConfiguration(graphQLRpcConfiguration) + .graphQLConfiguration(graphQLConfiguration) .jsonRpcConfiguration(jsonRpcConfiguration) .webSocketConfiguration(webSocketConfiguration) .dataDir(dataDir()) diff --git a/pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java b/pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java index e3c1419cee..d190d254b9 100644 --- a/pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java +++ b/pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java @@ -34,7 +34,7 @@ import tech.pegasys.pantheon.ethereum.eth.sync.SyncMode; import tech.pegasys.pantheon.ethereum.eth.sync.SynchronizerConfiguration; import tech.pegasys.pantheon.ethereum.eth.transactions.PendingTransactions; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLRpcConfiguration; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLConfiguration; import tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcConfiguration; import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketConfiguration; import tech.pegasys.pantheon.ethereum.mainnet.HeaderValidationMode; @@ -158,7 +158,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception { .build(); final String listenHost = InetAddress.getLoopbackAddress().getHostAddress(); final JsonRpcConfiguration aheadJsonRpcConfiguration = jsonRpcConfiguration(); - final GraphQLRpcConfiguration aheadGraphQLRpcConfiguration = graphQLRpcConfiguration(); + final GraphQLConfiguration aheadGraphQLConfiguration = graphQLConfiguration(); final WebSocketConfiguration aheadWebSocketConfiguration = wsRpcConfiguration(); final MetricsConfiguration aheadMetricsConfiguration = metricsConfiguration(); final RunnerBuilder runnerBuilder = @@ -177,7 +177,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception { .pantheonController(controllerAhead) .ethNetworkConfig(EthNetworkConfig.getNetworkConfig(DEV)) .jsonRpcConfiguration(aheadJsonRpcConfiguration) - .graphQLRpcConfiguration(aheadGraphQLRpcConfiguration) + .graphQLConfiguration(aheadGraphQLConfiguration) .webSocketConfiguration(aheadWebSocketConfiguration) .metricsConfiguration(aheadMetricsConfiguration) .dataDir(dbAhead) @@ -194,7 +194,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception { .build(); final Path dataDirBehind = temp.newFolder().toPath(); final JsonRpcConfiguration behindJsonRpcConfiguration = jsonRpcConfiguration(); - final GraphQLRpcConfiguration behindGraphQLRpcConfiguration = graphQLRpcConfiguration(); + final GraphQLConfiguration behindGraphQLConfiguration = graphQLConfiguration(); final WebSocketConfiguration behindWebSocketConfiguration = wsRpcConfiguration(); final MetricsConfiguration behindMetricsConfiguration = metricsConfiguration(); @@ -224,7 +224,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception { .pantheonController(controllerBehind) .ethNetworkConfig(behindEthNetworkConfiguration) .jsonRpcConfiguration(behindJsonRpcConfiguration) - .graphQLRpcConfiguration(behindGraphQLRpcConfiguration) + .graphQLConfiguration(behindGraphQLConfiguration) .webSocketConfiguration(behindWebSocketConfiguration) .metricsConfiguration(behindMetricsConfiguration) .dataDir(temp.newFolder().toPath()) @@ -344,8 +344,8 @@ private JsonRpcConfiguration jsonRpcConfiguration() { return configuration; } - private GraphQLRpcConfiguration graphQLRpcConfiguration() { - final GraphQLRpcConfiguration configuration = GraphQLRpcConfiguration.createDefault(); + private GraphQLConfiguration graphQLConfiguration() { + final GraphQLConfiguration configuration = GraphQLConfiguration.createDefault(); configuration.setPort(0); configuration.setEnabled(false); return configuration; diff --git a/pantheon/src/test/java/tech/pegasys/pantheon/cli/CommandTestAbstract.java b/pantheon/src/test/java/tech/pegasys/pantheon/cli/CommandTestAbstract.java index 9d0adba022..60a2056184 100644 --- a/pantheon/src/test/java/tech/pegasys/pantheon/cli/CommandTestAbstract.java +++ b/pantheon/src/test/java/tech/pegasys/pantheon/cli/CommandTestAbstract.java @@ -29,7 +29,7 @@ import tech.pegasys.pantheon.ethereum.eth.manager.EthProtocolManager; import tech.pegasys.pantheon.ethereum.eth.sync.BlockBroadcaster; import tech.pegasys.pantheon.ethereum.eth.sync.SynchronizerConfiguration; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLRpcConfiguration; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLConfiguration; import tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcConfiguration; import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketConfiguration; import tech.pegasys.pantheon.ethereum.permissioning.PermissioningConfiguration; @@ -99,7 +99,7 @@ public abstract class CommandTestAbstract { @Captor ArgumentCaptor intArgumentCaptor; @Captor ArgumentCaptor ethNetworkConfigArgumentCaptor; @Captor ArgumentCaptor jsonRpcConfigArgumentCaptor; - @Captor ArgumentCaptor graphQLRpcConfigArgumentCaptor; + @Captor ArgumentCaptor graphQLConfigArgumentCaptor; @Captor ArgumentCaptor wsRpcConfigArgumentCaptor; @Captor ArgumentCaptor metricsConfigArgumentCaptor; @@ -158,7 +158,7 @@ public void initMocks() throws Exception { when(mockRunnerBuilder.maxPeers(anyInt())).thenReturn(mockRunnerBuilder); when(mockRunnerBuilder.p2pEnabled(anyBoolean())).thenReturn(mockRunnerBuilder); when(mockRunnerBuilder.jsonRpcConfiguration(any())).thenReturn(mockRunnerBuilder); - when(mockRunnerBuilder.graphQLRpcConfiguration(any())).thenReturn(mockRunnerBuilder); + when(mockRunnerBuilder.graphQLConfiguration(any())).thenReturn(mockRunnerBuilder); when(mockRunnerBuilder.webSocketConfiguration(any())).thenReturn(mockRunnerBuilder); when(mockRunnerBuilder.dataDir(any())).thenReturn(mockRunnerBuilder); when(mockRunnerBuilder.bannedNodeIds(any())).thenReturn(mockRunnerBuilder); diff --git a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java index 567e486a95..b15cf3f773 100644 --- a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java +++ b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java @@ -41,7 +41,7 @@ import tech.pegasys.pantheon.ethereum.core.Wei; import tech.pegasys.pantheon.ethereum.eth.sync.SyncMode; import tech.pegasys.pantheon.ethereum.eth.transactions.PendingTransactions; -import tech.pegasys.pantheon.ethereum.graphqlrpc.GraphQLRpcConfiguration; +import tech.pegasys.pantheon.ethereum.graphql.GraphQLConfiguration; import tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcConfiguration; import tech.pegasys.pantheon.ethereum.jsonrpc.RpcApi; import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketConfiguration; @@ -89,7 +89,7 @@ public class PantheonCommandTest extends CommandTestAbstract { static final String PERMISSIONING_CONFIG_TOML = "/permissioning_config.toml"; private static final JsonRpcConfiguration defaultJsonRpcConfiguration; - private static final GraphQLRpcConfiguration defaultGraphQLRpcConfiguration; + private static final GraphQLConfiguration DEFAULT_GRAPH_QL_CONFIGURATION; private static final WebSocketConfiguration defaultWebSocketConfiguration; private static final MetricsConfiguration defaultMetricsConfiguration; private static final int GENESIS_CONFIG_TEST_CHAINID = 3141592; @@ -108,7 +108,7 @@ public class PantheonCommandTest extends CommandTestAbstract { static { defaultJsonRpcConfiguration = JsonRpcConfiguration.createDefault(); - defaultGraphQLRpcConfiguration = GraphQLRpcConfiguration.createDefault(); + DEFAULT_GRAPH_QL_CONFIGURATION = GraphQLConfiguration.createDefault(); defaultWebSocketConfiguration = WebSocketConfiguration.createDefault(); @@ -155,7 +155,7 @@ public void callingPantheonCommandWithoutOptionsMustSyncWithDefaultValues() thro verify(mockRunnerBuilder).p2pListenPort(eq(30303)); verify(mockRunnerBuilder).maxPeers(eq(25)); verify(mockRunnerBuilder).jsonRpcConfiguration(eq(defaultJsonRpcConfiguration)); - verify(mockRunnerBuilder).graphQLRpcConfiguration(eq(defaultGraphQLRpcConfiguration)); + verify(mockRunnerBuilder).graphQLConfiguration(eq(DEFAULT_GRAPH_QL_CONFIGURATION)); verify(mockRunnerBuilder).webSocketConfiguration(eq(defaultWebSocketConfiguration)); verify(mockRunnerBuilder).metricsConfiguration(eq(defaultMetricsConfiguration)); verify(mockRunnerBuilder).ethNetworkConfig(ethNetworkArg.capture()); @@ -286,10 +286,10 @@ public void overrideDefaultValuesIfKeyIsPresentInConfigFile() throws IOException jsonRpcConfiguration.setCorsAllowedDomains(Collections.emptyList()); jsonRpcConfiguration.setRpcApis(expectedApis); - final GraphQLRpcConfiguration graphQLRpcConfiguration = GraphQLRpcConfiguration.createDefault(); - graphQLRpcConfiguration.setEnabled(false); - graphQLRpcConfiguration.setHost("6.7.8.9"); - graphQLRpcConfiguration.setPort(6789); + final GraphQLConfiguration graphQLConfiguration = GraphQLConfiguration.createDefault(); + graphQLConfiguration.setEnabled(false); + graphQLConfiguration.setHost("6.7.8.9"); + graphQLConfiguration.setPort(6789); final WebSocketConfiguration webSocketConfiguration = WebSocketConfiguration.createDefault(); webSocketConfiguration.setEnabled(false); @@ -310,7 +310,7 @@ public void overrideDefaultValuesIfKeyIsPresentInConfigFile() throws IOException verify(mockRunnerBuilder).p2pListenPort(eq(1234)); verify(mockRunnerBuilder).maxPeers(eq(42)); verify(mockRunnerBuilder).jsonRpcConfiguration(eq(jsonRpcConfiguration)); - verify(mockRunnerBuilder).graphQLRpcConfiguration(eq(graphQLRpcConfiguration)); + verify(mockRunnerBuilder).graphQLConfiguration(eq(graphQLConfiguration)); verify(mockRunnerBuilder).webSocketConfiguration(eq(webSocketConfiguration)); verify(mockRunnerBuilder).metricsConfiguration(eq(metricsConfiguration)); verify(mockRunnerBuilder).build(); @@ -613,7 +613,7 @@ public void noOverrideDefaultValuesIfKeyIsNotPresentInConfigFile() throws IOExce parseCommand("--config-file", configFile); final JsonRpcConfiguration jsonRpcConfiguration = JsonRpcConfiguration.createDefault(); - final GraphQLRpcConfiguration graphQLRpcConfiguration = GraphQLRpcConfiguration.createDefault(); + final GraphQLConfiguration graphQLConfiguration = GraphQLConfiguration.createDefault(); final WebSocketConfiguration webSocketConfiguration = WebSocketConfiguration.createDefault(); @@ -630,7 +630,7 @@ public void noOverrideDefaultValuesIfKeyIsNotPresentInConfigFile() throws IOExce verify(mockRunnerBuilder).p2pListenPort(eq(30303)); verify(mockRunnerBuilder).maxPeers(eq(25)); verify(mockRunnerBuilder).jsonRpcConfiguration(eq(jsonRpcConfiguration)); - verify(mockRunnerBuilder).graphQLRpcConfiguration(eq(graphQLRpcConfiguration)); + verify(mockRunnerBuilder).graphQLConfiguration(eq(graphQLConfiguration)); verify(mockRunnerBuilder).webSocketConfiguration(eq(webSocketConfiguration)); verify(mockRunnerBuilder).metricsConfiguration(eq(metricsConfiguration)); verify(mockRunnerBuilder).build(); @@ -1259,26 +1259,26 @@ public void rpcHttpEnabledPropertyMustBeUsed() { } @Test - public void graphQLRpcHttpEnabledPropertyDefaultIsFalse() { + public void graphQLHttpEnabledPropertyDefaultIsFalse() { parseCommand(); - verify(mockRunnerBuilder).graphQLRpcConfiguration(graphQLRpcConfigArgumentCaptor.capture()); + verify(mockRunnerBuilder).graphQLConfiguration(graphQLConfigArgumentCaptor.capture()); verify(mockRunnerBuilder).build(); - assertThat(graphQLRpcConfigArgumentCaptor.getValue().isEnabled()).isFalse(); + assertThat(graphQLConfigArgumentCaptor.getValue().isEnabled()).isFalse(); assertThat(commandOutput.toString()).isEmpty(); assertThat(commandErrorOutput.toString()).isEmpty(); } @Test - public void graphQLRpcHttpEnabledPropertyMustBeUsed() { + public void graphQLHttpEnabledPropertyMustBeUsed() { parseCommand("--graphql-http-enabled"); - verify(mockRunnerBuilder).graphQLRpcConfiguration(graphQLRpcConfigArgumentCaptor.capture()); + verify(mockRunnerBuilder).graphQLConfiguration(graphQLConfigArgumentCaptor.capture()); verify(mockRunnerBuilder).build(); - assertThat(graphQLRpcConfigArgumentCaptor.getValue().isEnabled()).isTrue(); + assertThat(graphQLConfigArgumentCaptor.getValue().isEnabled()).isTrue(); assertThat(commandOutput.toString()).isEmpty(); assertThat(commandErrorOutput.toString()).isEmpty(); @@ -1408,7 +1408,7 @@ public void rpcHttpHostMayBeIPv6() { } @Test - public void graphQLRpcHttpHostAndPortOptionsMustBeUsed() { + public void graphQLHttpHostAndPortOptionsMustBeUsed() { final String host = "1.2.3.4"; final int port = 1234; @@ -1419,41 +1419,41 @@ public void graphQLRpcHttpHostAndPortOptionsMustBeUsed() { "--graphql-http-port", String.valueOf(port)); - verify(mockRunnerBuilder).graphQLRpcConfiguration(graphQLRpcConfigArgumentCaptor.capture()); + verify(mockRunnerBuilder).graphQLConfiguration(graphQLConfigArgumentCaptor.capture()); verify(mockRunnerBuilder).build(); - assertThat(graphQLRpcConfigArgumentCaptor.getValue().getHost()).isEqualTo(host); - assertThat(graphQLRpcConfigArgumentCaptor.getValue().getPort()).isEqualTo(port); + assertThat(graphQLConfigArgumentCaptor.getValue().getHost()).isEqualTo(host); + assertThat(graphQLConfigArgumentCaptor.getValue().getPort()).isEqualTo(port); assertThat(commandOutput.toString()).isEmpty(); assertThat(commandErrorOutput.toString()).isEmpty(); } @Test - public void graphQLRpcHttpHostMayBeLocalhost() { + public void graphQLHttpHostMayBeLocalhost() { final String host = "localhost"; parseCommand("--graphql-http-enabled", "--graphql-http-host", host); - verify(mockRunnerBuilder).graphQLRpcConfiguration(graphQLRpcConfigArgumentCaptor.capture()); + verify(mockRunnerBuilder).graphQLConfiguration(graphQLConfigArgumentCaptor.capture()); verify(mockRunnerBuilder).build(); - assertThat(graphQLRpcConfigArgumentCaptor.getValue().getHost()).isEqualTo(host); + assertThat(graphQLConfigArgumentCaptor.getValue().getHost()).isEqualTo(host); assertThat(commandOutput.toString()).isEmpty(); assertThat(commandErrorOutput.toString()).isEmpty(); } @Test - public void graphQLRpcHttpHostMayBeIPv6() { + public void graphQLHttpHostMayBeIPv6() { final String host = "2600:DB8::8545"; parseCommand("--graphql-http-enabled", "--graphql-http-host", host); - verify(mockRunnerBuilder).graphQLRpcConfiguration(graphQLRpcConfigArgumentCaptor.capture()); + verify(mockRunnerBuilder).graphQLConfiguration(graphQLConfigArgumentCaptor.capture()); verify(mockRunnerBuilder).build(); - assertThat(graphQLRpcConfigArgumentCaptor.getValue().getHost()).isEqualTo(host); + assertThat(graphQLConfigArgumentCaptor.getValue().getHost()).isEqualTo(host); assertThat(commandOutput.toString()).isEmpty(); assertThat(commandErrorOutput.toString()).isEmpty(); diff --git a/pantheon/src/test/resources/everything_config.toml b/pantheon/src/test/resources/everything_config.toml index 03b4ccf526..ace9b1bdc9 100644 --- a/pantheon/src/test/resources/everything_config.toml +++ b/pantheon/src/test/resources/everything_config.toml @@ -45,7 +45,7 @@ rpc-http-cors-origins=["none"] rpc-http-authentication-enabled=false rpc-http-authentication-credentials-file="none" -# GRAPHQL-RPC +# GRAPHQL HTTP graphql-http-enabled=false graphql-http-host="6.7.8.9" graphql-http-port=6789 diff --git a/settings.gradle b/settings.gradle index 5e39773075..d353ede10b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -25,7 +25,7 @@ include 'ethereum:blockcreation' include 'ethereum:core' include 'ethereum:eth' include 'ethereum:jsonrpc' -include 'ethereum:graphqlrpc' +include 'ethereum:graphql' include 'ethereum:mock-p2p' include 'ethereum:p2p' include 'ethereum:permissioning'