Skip to content

Commit 4f57326

Browse files
committed
Update api version to 1.0.7
1 parent cfce138 commit 4f57326

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<dependency>
5050
<groupId>com.github.TIHBS</groupId>
5151
<artifactId>blockchain-access-layer-api</artifactId>
52-
<version>1.0.3</version>
52+
<version>1.0.7</version>
5353
</dependency>
5454
<dependency>
5555
<groupId>org.web3j</groupId>

src/main/java/blockchains/iaas/uni/stuttgart/de/plugin/ethereum/EthereumPlugin.java

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
package blockchains.iaas.uni.stuttgart.de.plugin.ethereum;
1313

1414
import blockchains.iaas.uni.stuttgart.de.api.IAdapterExtension;
15+
import blockchains.iaas.uni.stuttgart.de.api.connectionprofiles.AbstractConnectionProfile;
1516
import blockchains.iaas.uni.stuttgart.de.api.interfaces.BlockchainAdapter;
1617
import blockchains.iaas.uni.stuttgart.de.api.utils.PoWConfidenceCalculator;
18+
import com.fasterxml.jackson.databind.ObjectMapper;
1719
import org.pf4j.Extension;
1820
import org.pf4j.Plugin;
1921
import org.pf4j.PluginWrapper;
@@ -41,13 +43,15 @@ public void stop() {
4143
public static class EthAdapterImpl implements IAdapterExtension {
4244

4345
@Override
44-
public BlockchainAdapter getAdapter(Map<String, Object> parameters) {
45-
String nodeUrl = (String) parameters.get("nodeUrl");
46-
String keystorePassword = (String) parameters.get("keystorePassword");
47-
String keystorePath = (String) parameters.get("keystorePath");
48-
double adversaryVotingRatio = (double) parameters.get("adversaryVotingRatio");
46+
public BlockchainAdapter getAdapter(AbstractConnectionProfile connectionProfile) {
47+
EthereumConnectionProfile ethereumConnectionProfile = (EthereumConnectionProfile) connectionProfile;
48+
49+
String nodeUrl = ethereumConnectionProfile.getNodeUrl();
50+
int pollingTimeSeconds = ethereumConnectionProfile.getPollingTimeSeconds();
51+
double adversaryVotingRatio = ethereumConnectionProfile.getAdversaryVotingRatio();
52+
String keystorePassword = ethereumConnectionProfile.getKeystorePassword();
53+
String keystorePath = ethereumConnectionProfile.getKeystorePath();
4954

50-
int pollingTimeSeconds = (int) parameters.get("pollingTimeSeconds");
5155
final EthereumAdapter adapter = new EthereumAdapter(nodeUrl, pollingTimeSeconds);
5256

5357
final PoWConfidenceCalculator cCalc = new PoWConfidenceCalculator();
@@ -63,6 +67,16 @@ public BlockchainAdapter getAdapter(Map<String, Object> parameters) {
6367
return adapter;
6468
}
6569

70+
@Override
71+
public Class<? extends AbstractConnectionProfile> getConnectionProfileClass() {
72+
return EthereumConnectionProfile.class;
73+
}
74+
75+
@Override
76+
public String getConnectionProfileNamedType() {
77+
return "ethereum";
78+
}
79+
6680
@Override
6781
public String getBlockChainId() {
6882
return "ethereum";

0 commit comments

Comments
 (0)