Skip to content

Commit a40367d

Browse files
authored
Merge pull request #492 from tronprotocol/fix
remove indexHelper autowired in full Node.
2 parents 710754d + d95edf2 commit a40367d

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

src/main/java/org/tron/core/db/TronDatabase.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.google.protobuf.InvalidProtocolBufferException;
44
import java.util.Iterator;
55
import lombok.extern.slf4j.Slf4j;
6-
import org.springframework.beans.factory.annotation.Autowired;
76
import org.tron.common.storage.leveldb.LevelDbDataSourceImpl;
87
import org.tron.common.utils.Quitable;
98
import org.tron.core.config.args.Args;
@@ -16,7 +15,6 @@ public abstract class TronDatabase<T> implements Iterable<T>, Quitable {
1615

1716
protected LevelDbDataSourceImpl dbSource;
1817

19-
@Autowired
2018
protected IndexHelper indexHelper;
2119

2220
protected TronDatabase(String dbName) {

src/test/java/org/tron/core/db/api/IndexHelperTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.junit.AfterClass;
88
import org.junit.Assert;
99
import org.junit.BeforeClass;
10+
import org.junit.Ignore;
1011
import org.junit.Test;
1112
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
1213
import org.tron.common.utils.ByteArray;
@@ -27,6 +28,7 @@
2728
import org.tron.protos.Protocol.Transaction;
2829
import org.tron.protos.Protocol.Witness;
2930

31+
@Ignore
3032
public class IndexHelperTest {
3133

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

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

src/test/java/org/tron/core/db/api/StoreAPITest.java

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.junit.AfterClass;
99
import org.junit.Assert;
1010
import org.junit.BeforeClass;
11+
import org.junit.Ignore;
1112
import org.junit.Test;
1213
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
1314
import org.tron.common.utils.ByteArray;
@@ -32,6 +33,7 @@
3233
import org.tron.protos.Protocol.Transaction.Contract.ContractType;
3334
import org.tron.protos.Protocol.Witness;
3435

36+
@Ignore
3537
public class StoreAPITest {
3638

3739
public static final String ACCOUNT_ADDRESS_ONE = "121212a9cf";
@@ -101,7 +103,7 @@ public class StoreAPITest {
101103
private static String dbPath = "output_StoreAPI_test";
102104

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

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

126-
/** initAssetIssue. */
128+
/**
129+
* initAssetIssue.
130+
*/
127131
private static void initAssetIssue() {
128132
assetIssue1 =
129133
getBuildAssetIssueContract(
@@ -163,7 +167,9 @@ private static AssetIssueContract getBuildAssetIssueContract(
163167
.build();
164168
}
165169

166-
/** initTransaction. */
170+
/**
171+
* initTransaction.
172+
*/
167173
private static void initTransaction() {
168174
transaction1 =
169175
getBuildTransaction(
@@ -208,7 +214,9 @@ private static TransferContract getBuildTransferContract(String ownerAddress, St
208214
.build();
209215
}
210216

211-
/** initWitness. */
217+
/**
218+
* initWitness.
219+
*/
212220
private static void initWitness() {
213221
witness1 =
214222
getBuildWitness(
@@ -244,7 +252,9 @@ private static Witness getBuildWitness(
244252
.build();
245253
}
246254

247-
/** initBlock. */
255+
/**
256+
* initBlock.
257+
*/
248258
private static void initBlock() {
249259
block1 =
250260
getBuildBlock(
@@ -285,7 +295,10 @@ private static Block getBuildBlock(
285295
.addTransactions(transactionNext)
286296
.build();
287297
}
288-
/** initAccount. */
298+
299+
/**
300+
* initAccount.
301+
*/
289302
private static void initAccount() {
290303
account1 = getBuildAccount(ACCOUNT_ADDRESS_ONE, ACCOUNT_NAME_ONE);
291304
addAccountToStore(account1);

0 commit comments

Comments
 (0)