Skip to content

Commit

Permalink
Merge pull request tronprotocol#3552 from tronprotocol/fix_unittest_B…
Browse files Browse the repository at this point in the history
…lockMsgHandlerTest_testProcessMessage

Fix unittest block msg handler test test process message
  • Loading branch information
eodiandie authored Dec 9, 2020
2 parents 809b5c9 + 3c292ad commit e99cc3b
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.tron.core.net.messagehandler;

import com.google.common.collect.ImmutableList;
import com.google.protobuf.ByteString;
import java.util.List;
import org.junit.After;
import org.junit.Assert;
Expand All @@ -11,6 +13,7 @@
import org.tron.core.Constant;
import org.tron.core.capsule.BlockCapsule;
import org.tron.core.config.DefaultConfig;
import org.tron.core.config.Parameter;
import org.tron.core.config.args.Args;
import org.tron.core.exception.P2pException;
import org.tron.core.net.message.BlockMessage;
Expand Down Expand Up @@ -51,10 +54,13 @@ public void testProcessMessage() {
}

try {
List<Transaction> transactionList = Lists.newArrayList();
for (int i = 0; i < 1100000; i++) {
transactionList.add(Transaction.newBuilder().build());
}
List<Transaction> transactionList = ImmutableList.of(
Transaction.newBuilder()
.setRawData(Transaction.raw.newBuilder()
.setData(
ByteString.copyFrom(
new byte[Parameter.ChainConstant.BLOCK_SIZE + Constant.ONE_THOUSAND])))
.build());
blockCapsule = new BlockCapsule(1, Sha256Hash.ZERO_HASH.getByteString(),
System.currentTimeMillis() + 10000, transactionList);
msg = new BlockMessage(blockCapsule);
Expand Down

0 comments on commit e99cc3b

Please sign in to comment.