Search in sources :

Example 1 with Vote

use of org.tron.protos.Protocol.Account.Vote in project java-tron by tronprotocol.

the class AccountCapsuleTest method addVotesTest.

@Test
public void addVotesTest() {
    // test addVote and getVotesList function
    ByteString voteAddress = ByteString.copyFrom(AccountCapsuleTest.randomBytes(32));
    long voteAdd = 10L;
    accountCapsuleTest.addVotes(voteAddress, voteAdd);
    List<Vote> votesList = accountCapsuleTest.getVotesList();
    for (Vote vote : votesList) {
        Assert.assertEquals(voteAddress, vote.getVoteAddress());
        Assert.assertEquals(voteAdd, vote.getVoteCount());
    }
}
Also used : Vote(org.tron.protos.Protocol.Account.Vote) ByteString(com.google.protobuf.ByteString) Test(org.junit.Test)

Aggregations

ByteString (com.google.protobuf.ByteString)1 Test (org.junit.Test)1 Vote (org.tron.protos.Protocol.Account.Vote)1