Skip to content

Commit

Permalink
add VotesCapsuleTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
nanfengpo committed May 9, 2018
1 parent c545120 commit 60a868d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/test/java/org/tron/core/capsule/VotesCapsuleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
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;

@BeforeClass
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();
Expand All @@ -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<Vote> votesList = accountCapsuleTest.getVotesList();
Expand Down

0 comments on commit 60a868d

Please sign in to comment.