Skip to content

Commit c2badb7

Browse files
committed
Fix test cases
1 parent f1517f1 commit c2badb7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/test/java/blockchains/iaas/uni/stuttgart/de/plugin/ethereum/EthereumAdapterTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
* smart contract composition
4545
*/
4646
class EthereumAdapterTest {
47-
private static final String NETWORK_NAME = "eth-0";
4847
private static final String MESSAGE = "This was not a difficult task!";
4948
private final String BYTES_TYPE = "{\n" +
5049
"\t\"type\": \"array\",\n" +
@@ -57,7 +56,7 @@ class EthereumAdapterTest {
5756
"\t\"type\": \"string\",\n" +
5857
"\t\"pattern\": \"^0x[a-fA-F0-9]{40}$\"\n" +
5958
"}";
60-
private static final double REQUIRED_CONFIDENCE = 0.01;
59+
private static final double REQUIRED_CONFIDENCE = 0.6;
6160
private EthereumAdapter adapter;
6261
private static final Logger log = LoggerFactory.getLogger(EthereumAdapterTest.class);
6362

@@ -88,7 +87,7 @@ void testInvokeSmartContract() throws Exception {
8887
String argument = new BigInteger(bytes).toString(16);
8988
List<Parameter> inputs = Collections.singletonList(new Parameter("publicKey", BYTES_TYPE, argument));
9089
List<Parameter> outputs = Collections.emptyList();
91-
LinearChainTransaction init = (LinearChainTransaction) this.adapter.invokeSmartContract(smartContractPath, functionIdentifier, inputs, outputs, REQUIRED_CONFIDENCE, 100000000).get();
90+
LinearChainTransaction init = (LinearChainTransaction) this.adapter.invokeSmartContract(smartContractPath, functionIdentifier, inputs, outputs, REQUIRED_CONFIDENCE, Long.MAX_VALUE).get();
9291
log.info("initial transaction {}", init.getTransactionHash());
9392
functionIdentifier = "getPublicKey";
9493
inputs = Collections.singletonList(new Parameter("ethereumAddress", ADDRESS_TYPE, "0x90645Dc507225d61cB81cF83e7470F5a6AA1215A"));
@@ -146,9 +145,7 @@ Permissions deployContract() throws ExecutionException, InterruptedException, IO
146145
}
147146

148147
private EthereumAdapter getAdapter() {
149-
//String nodeUrl = "http://localhost:7545/";
150-
String nodeUrl = "https://rinkeby.infura.io/v3/cafcfb3fc02f4322be11087aad15989c";
151-
148+
String nodeUrl = "http://localhost:7545/";
152149
String keystorePath = "/account.json";
153150
String keystorePassword = "123456789";
154151
double adversaryVotingRatio = 0.2;

0 commit comments

Comments
 (0)