Skip to content

Commit

Permalink
Merge pull request #241 from satsen/remove-cli
Browse files Browse the repository at this point in the history
Removed CLI feature
  • Loading branch information
kushti authored Oct 28, 2024
2 parents 9aafd8a + 1f15eb8 commit 7edd598
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 1,110 deletions.
46 changes: 46 additions & 0 deletions appkit/src/main/java/org/ergoplatform/appkit/ColdErgoClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.ergoplatform.appkit;

import org.ergoplatform.appkit.impl.ColdBlockchainContext;
import org.ergoplatform.appkit.impl.NodeInfoParameters;
import org.ergoplatform.restapi.client.NodeInfo;
import org.ergoplatform.restapi.client.Parameters;

import java.util.function.Function;

public class ColdErgoClient implements ErgoClient {

private final NetworkType networkType;
private final BlockchainParameters params;

public ColdErgoClient(NetworkType networkType, BlockchainParameters params) {
this.networkType = networkType;
this.params = params;
}

/**
* Convenience constructor for giving maxBlockCost
*/
public ColdErgoClient(NetworkType networkType, int maxBlockCost, byte blockVersion) {
this(networkType, new NodeInfoParameters(
new NodeInfo()
.parameters(new Parameters()
.maxBlockCost(maxBlockCost)
.blockVersion((int) blockVersion))
));
}

public BlockchainParameters params() {
return params;
}

@Override
public <T> T execute(Function<BlockchainContext, T> action) {
ColdBlockchainContext ctx = new ColdBlockchainContext(networkType, params);
return action.apply(ctx);
}

@Override
public BlockchainDataSource getDataSource() {
throw new UnsupportedOperationException();
}
}
31 changes: 0 additions & 31 deletions appkit/src/main/scala/org/ergoplatform/appkit/ColdErgoClient.scala

This file was deleted.

48 changes: 0 additions & 48 deletions appkit/src/main/scala/org/ergoplatform/appkit/cli/AppContext.scala

This file was deleted.

103 changes: 0 additions & 103 deletions appkit/src/main/scala/org/ergoplatform/appkit/cli/CliApplication.scala

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7edd598

Please sign in to comment.