Skip to content

Commit

Permalink
Same philosophy for LogAdapter
Browse files Browse the repository at this point in the history
Signed-off-by: Wetitpig <winsto003@hotmail.com>
  • Loading branch information
Wetitpig committed Nov 22, 2023
1 parent 11c85e5 commit f39692e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package org.hyperledger.besu.ethereum.api.graphql.internal.pojoadapter;

import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.api.query.TransactionWithMetadata;
Expand Down Expand Up @@ -63,9 +64,9 @@ public AccountAdapter getAccount(final DataFetchingEnvironment environment) {
blockNumber = bn;
}

final Address logger = logWithMetadata.getLogger();
return query
.getAndMapWorldState(
blockNumber, ws -> Optional.of(new AccountAdapter(ws.get(logWithMetadata.getLogger()))))
.get();
.getAndMapWorldState(blockNumber, ws -> Optional.of(new AccountAdapter(ws.get(logger))))
.orElse(new EmptyAccountAdapter(logger));
}
}

0 comments on commit f39692e

Please sign in to comment.