|
|
|
@ -35,6 +35,7 @@ import tech.pegasys.pantheon.ethereum.core.MiningParameters; |
|
|
|
|
import tech.pegasys.pantheon.ethereum.core.Wei; |
|
|
|
|
import tech.pegasys.pantheon.ethereum.eth.sync.SyncMode; |
|
|
|
|
import tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcConfiguration; |
|
|
|
|
import tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis; |
|
|
|
|
import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketConfiguration; |
|
|
|
|
import tech.pegasys.pantheon.util.bytes.BytesValue; |
|
|
|
|
|
|
|
|
@ -105,6 +106,13 @@ public class PantheonCommandTest extends CommandTestAbstract { |
|
|
|
|
assertThat(commandErrorOutput.toString()).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void callingHelpDisplaysDefaultRpcApisCorrectly() { |
|
|
|
|
parseCommand("--help"); |
|
|
|
|
assertThat(commandOutput.toString()).contains("default: ETH,NET,WEB3,CLIQUE,IBFT"); |
|
|
|
|
assertThat(commandErrorOutput.toString()).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void callingVersionDisplayPantheonInfoVersion() { |
|
|
|
|
parseCommand("--version"); |
|
|
|
@ -521,6 +529,30 @@ public class PantheonCommandTest extends CommandTestAbstract { |
|
|
|
|
assertThat(commandErrorOutput.toString()).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void rpcApisPropertyMustBeUsed() { |
|
|
|
|
parseCommand("--rpc-api", "ETH,NET"); |
|
|
|
|
|
|
|
|
|
verify(mockRunnerBuilder) |
|
|
|
|
.build( |
|
|
|
|
any(), |
|
|
|
|
any(), |
|
|
|
|
anyBoolean(), |
|
|
|
|
any(), |
|
|
|
|
anyString(), |
|
|
|
|
anyInt(), |
|
|
|
|
anyInt(), |
|
|
|
|
jsonRpcConfigArgumentCaptor.capture(), |
|
|
|
|
any(), |
|
|
|
|
any()); |
|
|
|
|
|
|
|
|
|
assertThat(jsonRpcConfigArgumentCaptor.getValue().getRpcApis()) |
|
|
|
|
.containsExactlyInAnyOrder(RpcApis.ETH, RpcApis.NET); |
|
|
|
|
|
|
|
|
|
assertThat(commandOutput.toString()).isEmpty(); |
|
|
|
|
assertThat(commandErrorOutput.toString()).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void jsonRpcHostAndPortOptionMustBeUsed() { |
|
|
|
|
|
|
|
|
@ -741,6 +773,30 @@ public class PantheonCommandTest extends CommandTestAbstract { |
|
|
|
|
assertThat(commandErrorOutput.toString()).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void wsApiPropertyMustBeUsed() { |
|
|
|
|
parseCommand("--ws-api", "ETH, NET"); |
|
|
|
|
|
|
|
|
|
verify(mockRunnerBuilder) |
|
|
|
|
.build( |
|
|
|
|
any(), |
|
|
|
|
any(), |
|
|
|
|
anyBoolean(), |
|
|
|
|
any(), |
|
|
|
|
anyString(), |
|
|
|
|
anyInt(), |
|
|
|
|
anyInt(), |
|
|
|
|
any(), |
|
|
|
|
wsRpcConfigArgumentCaptor.capture(), |
|
|
|
|
any()); |
|
|
|
|
|
|
|
|
|
assertThat(wsRpcConfigArgumentCaptor.getValue().getRpcApis()) |
|
|
|
|
.containsExactlyInAnyOrder(RpcApis.ETH, RpcApis.NET); |
|
|
|
|
|
|
|
|
|
assertThat(commandOutput.toString()).isEmpty(); |
|
|
|
|
assertThat(commandErrorOutput.toString()).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void wsRpcHostAndPortOptionMustBeUsed() { |
|
|
|
|
final String host = "1.2.3.4"; |
|
|
|
|