From 60a868d1efe946e451199bfd06ad364fd9d18312 Mon Sep 17 00:00:00 2001 From: nanfengpo Date: Wed, 9 May 2018 14:14:52 +0800 Subject: [PATCH] add VotesCapsuleTest.java --- .../org/tron/core/capsule/VotesCapsuleTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/tron/core/capsule/VotesCapsuleTest.java b/src/test/java/org/tron/core/capsule/VotesCapsuleTest.java index b744401f2d1..8e14f6275c6 100644 --- a/src/test/java/org/tron/core/capsule/VotesCapsuleTest.java +++ b/src/test/java/org/tron/core/capsule/VotesCapsuleTest.java @@ -12,12 +12,12 @@ import org.tron.common.utils.FileUtil; import org.tron.core.Constant; import org.tron.core.config.args.Args; -import org.tron.protos.Protocol.Vote; import org.tron.protos.Protocol.AccountType; +import org.tron.protos.Protocol.Vote; -public class AccountCapsuleTest { +public class VotesCapsuleTest { - private static String dbPath = "output_accountCapsule_test"; + private static String dbPath = "output_votesCapsule_test"; static AccountCapsule accountCapsuleTest; static AccountCapsule accountCapsule; @@ -25,8 +25,8 @@ public class AccountCapsuleTest { public static void init() { Args.setParam(new String[]{"-d", dbPath, "-w"}, Constant.TEST_CONF); - ByteString accountName = ByteString.copyFrom(AccountCapsuleTest.randomBytes(16)); - ByteString address = ByteString.copyFrom(AccountCapsuleTest.randomBytes(32)); + ByteString accountName = ByteString.copyFrom(VotesCapsuleTest.randomBytes(16)); + ByteString address = ByteString.copyFrom(VotesCapsuleTest.randomBytes(32)); AccountType accountType = AccountType.forNumber(1); accountCapsuleTest = new AccountCapsule(accountName, address, accountType); byte[] accountByte = accountCapsuleTest.getData(); @@ -51,9 +51,9 @@ public void getDataTest() { } @Test - public void addVotesTest() { + public void addNewVotesTest() { //test addVote and getVotesList function - ByteString voteAddress = ByteString.copyFrom(AccountCapsuleTest.randomBytes(32)); + ByteString voteAddress = ByteString.copyFrom(VotesCapsuleTest.randomBytes(32)); long voteAdd = 10L; accountCapsuleTest.addVotes(voteAddress, voteAdd); List votesList = accountCapsuleTest.getVotesList();