Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ public class AccountIdIndexStoreTest extends BaseTest {
private static final byte[] ACCOUNT_ADDRESS_TWO = randomBytes(16);
private static final byte[] ACCOUNT_ADDRESS_THREE = randomBytes(16);
private static final byte[] ACCOUNT_ADDRESS_FOUR = randomBytes(16);
private static final byte[] ACCOUNT_NAME_ONE = randomBytes(6);
private static final byte[] ACCOUNT_NAME_TWO = randomBytes(6);
private static final byte[] ACCOUNT_NAME_THREE = randomBytes(6);
private static final byte[] ACCOUNT_NAME_FOUR = randomBytes(6);
private static final byte[] ACCOUNT_NAME_FIVE = randomBytes(6);
// Random bytes can collide after UTF-8 decoding and case normalization of account IDs.
private static final byte[] ACCOUNT_NAME_ONE = "account1".getBytes(StandardCharsets.UTF_8);
private static final byte[] ACCOUNT_NAME_TWO = "account2".getBytes(StandardCharsets.UTF_8);
private static final byte[] ACCOUNT_NAME_THREE = "account3".getBytes(StandardCharsets.UTF_8);
private static final byte[] ACCOUNT_NAME_FOUR = "account4".getBytes(StandardCharsets.UTF_8);
private static final byte[] ACCOUNT_NAME_FIVE = "account5".getBytes(StandardCharsets.UTF_8);
private static final Locale TURKISH = Locale.forLanguageTag("tr");
@Resource
private AccountIdIndexStore accountIdIndexStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.tron.core.net.peer.Item;
import org.tron.core.net.peer.PeerConnection;
import org.tron.core.net.service.adv.AdvService;
import org.tron.core.net.service.fetchblock.FetchBlockService;
import org.tron.core.net.service.sync.SyncService;
import org.tron.p2p.connection.Channel;
import org.tron.protos.Protocol;
Expand Down Expand Up @@ -591,6 +592,7 @@ private void assertDisconnectRecovery(boolean announced, boolean busy) throws Ex
List<PeerConnection> activePeers = new ArrayList<>(Collections.singletonList(source));
Mockito.when(delegate.getActivePeer()).thenReturn(activePeers);
ReflectUtils.setFieldValue(adv, "tronNetDelegate", delegate);
ReflectUtils.setFieldValue(adv, "fetchBlockService", Mockito.mock(FetchBlockService.class));
setField(handler, "tronNetDelegate", delegate);
setField(handler, "advService", adv);
setField(handler, "chainBaseManager", Mockito.mock(ChainBaseManager.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,12 @@ private void assertHelloAuthentication(RelayService relay, long timestamp, ByteS
Channel channel = mock(Channel.class);
Mockito.when(channel.getInetSocketAddress()).thenReturn(socketAddress);
Mockito.when(channel.getInetAddress()).thenReturn(socketAddress.getAddress());
Protocol.HelloMessage.BlockId blockId = Protocol.HelloMessage.BlockId.newBuilder()
.setHash(Sha256Hash.ZERO_HASH.getByteString()).build();
HelloMessage message = new HelloMessage(Protocol.HelloMessage.newBuilder()
.setGenesisBlockId(blockId)
.setSolidBlockId(blockId)
.setHeadBlockId(blockId)
.setTimestamp(timestamp).setAddress(address).setSignature(signature).build().toByteArray());

Assert.assertFalse(TronNetService.getP2pConfig().getTrustNodes()
Expand Down
Loading