Skip to content

Commit

Permalink
Merge pull request #492 from tronprotocol/fix
Browse files Browse the repository at this point in the history
remove indexHelper autowired in full Node.
  • Loading branch information
olenheim authored Apr 20, 2018
2 parents 710754d + d95edf2 commit a40367d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/main/java/org/tron/core/db/TronDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.google.protobuf.InvalidProtocolBufferException;
import java.util.Iterator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.tron.common.storage.leveldb.LevelDbDataSourceImpl;
import org.tron.common.utils.Quitable;
import org.tron.core.config.args.Args;
Expand All @@ -16,7 +15,6 @@ public abstract class TronDatabase<T> implements Iterable<T>, Quitable {

protected LevelDbDataSourceImpl dbSource;

@Autowired
protected IndexHelper indexHelper;

protected TronDatabase(String dbName) {
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/tron/core/db/api/IndexHelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.tron.common.utils.ByteArray;
Expand All @@ -27,6 +28,7 @@
import org.tron.protos.Protocol.Transaction;
import org.tron.protos.Protocol.Witness;

@Ignore
public class IndexHelperTest {

private static Manager dbManager;
Expand All @@ -35,7 +37,7 @@ public class IndexHelperTest {
private static String dbPath = "output_IndexHelper_test";

static {
Args.setParam(new String[] {"-d", dbPath, "-w"}, "config-test-index.conf");
Args.setParam(new String[]{"-d", dbPath, "-w"}, "config-test-index.conf");
context = new AnnotationConfigApplicationContext(DefaultConfig.class);
}

Expand Down
25 changes: 19 additions & 6 deletions src/test/java/org/tron/core/db/api/StoreAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.tron.common.utils.ByteArray;
Expand All @@ -32,6 +33,7 @@
import org.tron.protos.Protocol.Transaction.Contract.ContractType;
import org.tron.protos.Protocol.Witness;

@Ignore
public class StoreAPITest {

public static final String ACCOUNT_ADDRESS_ONE = "121212a9cf";
Expand Down Expand Up @@ -101,7 +103,7 @@ public class StoreAPITest {
private static String dbPath = "output_StoreAPI_test";

static {
Args.setParam(new String[] {"-d", dbPath, "-w"}, "config-test-index.conf");
Args.setParam(new String[]{"-d", dbPath, "-w"}, "config-test-index.conf");
context = new AnnotationConfigApplicationContext(DefaultConfig.class);
}

Expand All @@ -123,7 +125,9 @@ public static void removeDb() {
context.destroy();
}

/** initAssetIssue. */
/**
* initAssetIssue.
*/
private static void initAssetIssue() {
assetIssue1 =
getBuildAssetIssueContract(
Expand Down Expand Up @@ -163,7 +167,9 @@ private static AssetIssueContract getBuildAssetIssueContract(
.build();
}

/** initTransaction. */
/**
* initTransaction.
*/
private static void initTransaction() {
transaction1 =
getBuildTransaction(
Expand Down Expand Up @@ -208,7 +214,9 @@ private static TransferContract getBuildTransferContract(String ownerAddress, St
.build();
}

/** initWitness. */
/**
* initWitness.
*/
private static void initWitness() {
witness1 =
getBuildWitness(
Expand Down Expand Up @@ -244,7 +252,9 @@ private static Witness getBuildWitness(
.build();
}

/** initBlock. */
/**
* initBlock.
*/
private static void initBlock() {
block1 =
getBuildBlock(
Expand Down Expand Up @@ -285,7 +295,10 @@ private static Block getBuildBlock(
.addTransactions(transactionNext)
.build();
}
/** initAccount. */

/**
* initAccount.
*/
private static void initAccount() {
account1 = getBuildAccount(ACCOUNT_ADDRESS_ONE, ACCOUNT_NAME_ONE);
addAccountToStore(account1);
Expand Down

0 comments on commit a40367d

Please sign in to comment.