Fix createdContract in graphql (#1965)

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
pull/1973/head
Antoine Toulme 4 years ago committed by GitHub
parent 711bbfbd5e
commit 87f6c1a6de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/TransactionAdapter.java
  2. 4
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/graphql/eth_getTransactionReceipt.json

@ -144,7 +144,7 @@ public class TransactionAdapter extends AdapterBase {
public Optional<AccountAdapter> getCreatedContract(final DataFetchingEnvironment environment) { public Optional<AccountAdapter> getCreatedContract(final DataFetchingEnvironment environment) {
final boolean contractCreated = transactionWithMetadata.getTransaction().isContractCreation(); final boolean contractCreated = transactionWithMetadata.getTransaction().isContractCreation();
if (contractCreated) { if (contractCreated) {
final Optional<Address> addr = transactionWithMetadata.getTransaction().getTo(); final Optional<Address> addr = transactionWithMetadata.getTransaction().contractAddress();
if (addr.isPresent()) { if (addr.isPresent()) {
final BlockchainQueries query = getBlockchainQueries(environment); final BlockchainQueries query = getBlockchainQueries(environment);

@ -9,7 +9,9 @@
"logsBloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" "logsBloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}, },
"hash" : "0x812742182a79a8e67733edc58cfa3767aa2d7ad06439d156ddbbb33e3403b4ed", "hash" : "0x812742182a79a8e67733edc58cfa3767aa2d7ad06439d156ddbbb33e3403b4ed",
"createdContract" : null, "createdContract" : {
"address":"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f"
},
"cumulativeGasUsed" : 493172, "cumulativeGasUsed" : 493172,
"gas" : 3141592, "gas" : 3141592,
"gasUsed" : 493172, "gasUsed" : 493172,

Loading…
Cancel
Save