本文整理了Java中tech.pegasys.pantheon.ethereum.core.Address.toString()
方法的一些代码示例,展示了Address.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.toString()
方法的具体详情如下:
包路径:tech.pegasys.pantheon.ethereum.core.Address
类名称:Address
方法名:toString
暂无
代码示例来源:origin: PegaSysEng/pantheon
private FilterParameter filterParamWithAddressAndTopics(
final Address address, final List<List<String>> topics) {
final List<String> addresses = address != null ? Arrays.asList(address.toString()) : null;
return new FilterParameter("latest", "latest", addresses, topics, null);
}
代码示例来源:origin: PegaSysEng/pantheon
public ExpectBeneficiary(final EthTransactions eth, final PantheonNode node) {
this.eth = eth;
this.beneficiary = node.getAddress().toString();
}
代码示例来源:origin: PegaSysEng/pantheon
private List<LogsSubscription> createSubscriptions(final Address address) {
final List<LogsSubscription> subscriptions = new ArrayList<>();
for (int i = 0; i < 3; i++) {
final FilterParameter filterParameter =
new FilterParameter(null, null, Lists.newArrayList(address.toString()), null, null);
subscriptions.add(new LogsSubscription((long) i, filterParameter));
}
when(subscriptionManager.subscriptionsOfType(any(), any()))
.thenReturn(Lists.newArrayList(subscriptions));
return subscriptions;
}
代码示例来源:origin: PegaSysEng/pantheon
private LogsSubscription createSubscription(final Address address) {
final FilterParameter filterParameter =
new FilterParameter(null, null, Lists.newArrayList(address.toString()), null, null);
final LogsSubscription logsSubscription = new LogsSubscription(1L, filterParameter);
when(subscriptionManager.subscriptionsOfType(any(), any()))
.thenReturn(Lists.newArrayList(logsSubscription));
return logsSubscription;
}
代码示例来源:origin: PegaSysEng/pantheon
@Test
public void shouldReturnListOfValidatorsFromBlock() {
when(blockchainQueries.getBlockHeaderByNumber(12)).thenReturn(Optional.of(blockHeader));
final List<Address> addresses = Collections.singletonList(Address.ID);
final List<String> expectedOutput = Collections.singletonList(Address.ID.toString());
when(ibftBlockInterface.validatorsInBlock(blockHeader)).thenReturn(addresses);
Object result = method.resultByBlockNumber(request, 12);
assertThat(result).isEqualTo(expectedOutput);
}
}
代码示例来源:origin: PegaSysEng/pantheon
@Test
public void shouldReturnListOfValidatorsFromBlock() {
when(blockchain.getBlockHeader(Hash.ZERO)).thenReturn(Optional.of(blockHeader));
final List<Address> addresses = Collections.singletonList(Address.ID);
final List<String> expectedOutput = Collections.singletonList(Address.ID.toString());
when(ibftBlockInterface.validatorsInBlock(blockHeader)).thenReturn(addresses);
request = requestWithParams(ZERO_HASH);
JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) method.response(request);
Assertions.assertThat(response.getResult()).isEqualTo(expectedOutput);
}
代码示例来源:origin: PegaSysEng/pantheon
public CliqueDiscard createDiscardProposal(final PantheonNode node) {
return new CliqueDiscard(node.getAddress().toString());
}
}
代码示例来源:origin: PegaSysEng/pantheon
public IbftDiscard createDiscardProposal(final PantheonNode node) {
return new IbftDiscard(node.getAddress().toString());
}
}
代码示例来源:origin: PegaSysEng/pantheon
public CliquePropose createAddProposal(final PantheonNode node) {
return propose(node.getAddress().toString(), true);
}
代码示例来源:origin: PegaSysEng/pantheon
public IbftPropose createRemoveProposal(final PantheonNode node) {
return propose(node.getAddress().toString(), false);
}
代码示例来源:origin: PegaSysEng/pantheon
public CliquePropose createRemoveProposal(final PantheonNode node) {
return propose(node.getAddress().toString(), false);
}
代码示例来源:origin: PegaSysEng/pantheon
public IbftPropose createAddProposal(final PantheonNode node) {
return propose(node.getAddress().toString(), true);
}
代码示例来源:origin: PegaSysEng/pantheon
@Test
public void shouldRejectNonWhitelistedTransactionWhenWhitelistEnabled() {
transactionPool.setAccountWhitelist(accountWhitelistController);
givenTransactionIsValid(transaction1);
when(accountWhitelistController.isAccountWhiteListSet()).thenReturn(true);
when(accountWhitelistController.contains(transaction1.getSender().toString()))
.thenReturn(false);
assertThat(transactionPool.addLocalTransaction(transaction1))
.isEqualTo(ValidationResult.invalid(TX_SENDER_NOT_AUTHORIZED));
assertTransactionNotPending(transaction1);
verifyZeroInteractions(batchAddedListener);
}
代码示例来源:origin: PegaSysEng/pantheon
@Test
public void miningOptionsRequiresServiceToBeEnabled() {
final Address requestedCoinbase = Address.fromHexString("0000011111222223333344444");
parseCommand(
"--miner-coinbase",
requestedCoinbase.toString(),
"--min-gas-price",
"42",
"--miner-extra-data",
"0x1122334455667788990011223344556677889900112233445566778899001122");
verifyOptionsConstraintLoggerCall(
"--miner-coinbase, --min-gas-price and --miner-extra-data", "--miner-enabled");
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty();
}
代码示例来源:origin: PegaSysEng/pantheon
@Test
public void shouldAllowWhitelistedTransactionWhenWhitelistEnabled() {
transactionPool.setAccountWhitelist(accountWhitelistController);
givenTransactionIsValid(transaction1);
when(accountWhitelistController.isAccountWhiteListSet()).thenReturn(true);
when(accountWhitelistController.contains(transaction1.getSender().toString())).thenReturn(true);
assertThat(transactionPool.addLocalTransaction(transaction1)).isEqualTo(valid());
assertTransactionPending(transaction1);
}
代码示例来源:origin: PegaSysEng/pantheon
@Test
public void miningParametersAreCaptured() throws Exception {
final Address requestedCoinbase = Address.fromHexString("0000011111222223333344444");
final String extraDataString =
"0x1122334455667788990011223344556677889900112233445566778899001122";
parseCommand(
"--miner-enabled",
"--miner-coinbase=" + requestedCoinbase.toString(),
"--min-gas-price=15",
"--miner-extra-data=" + extraDataString);
final ArgumentCaptor<MiningParameters> miningArg =
ArgumentCaptor.forClass(MiningParameters.class);
verify(mockControllerBuilder).miningParameters(miningArg.capture());
verify(mockControllerBuilder).build();
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty();
assertThat(miningArg.getValue().getCoinbase()).isEqualTo(Optional.of(requestedCoinbase));
assertThat(miningArg.getValue().getMinTransactionGasPrice()).isEqualTo(Wei.of(15));
assertThat(miningArg.getValue().getExtraData())
.isEqualTo(BytesValue.fromHexString(extraDataString));
}
代码示例来源:origin: PegaSysEng/pantheon
@Test
public void accountAddressToString() {
final Address addr =
Address.wrap(BytesValue.fromHexString("0x0000000000000000000000000000000000101010"));
Assert.assertEquals("0x0000000000000000000000000000000000101010", addr.toString());
}
代码示例来源:origin: PegaSysEng/pantheon
params.add("--miner-enabled");
params.add("--miner-coinbase");
params.add(node.getMiningParameters().getCoinbase().get().toString());
代码示例来源:origin: PegaSysEng/pantheon
public String getAddress() {
return Address.extract(Hash.hash(keyPair.getPublicKey().getEncodedBytes())).toString();
}
内容来源于网络,如有侵权,请联系作者删除!