1212package blockchains .iaas .uni .stuttgart .de .plugin .ethereum ;
1313
1414import blockchains .iaas .uni .stuttgart .de .api .IAdapterExtension ;
15+ import blockchains .iaas .uni .stuttgart .de .api .connectionprofiles .AbstractConnectionProfile ;
1516import blockchains .iaas .uni .stuttgart .de .api .interfaces .BlockchainAdapter ;
1617import blockchains .iaas .uni .stuttgart .de .api .utils .PoWConfidenceCalculator ;
18+ import com .fasterxml .jackson .databind .ObjectMapper ;
1719import org .pf4j .Extension ;
1820import org .pf4j .Plugin ;
1921import 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