Skip to content

Commit

Permalink
fix: fixed the address search to use either .address or .accountIdent…
Browse files Browse the repository at this point in the history
…ifier.address
  • Loading branch information
Kammerlo committed Dec 17, 2024
1 parent 3f35d83 commit 8bb5cc9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.openapitools.client.model.AccountIdentifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -34,7 +35,10 @@ public class SearchServiceImpl implements SearchService {
@Override
public List<BlockTransaction> searchTransaction(
SearchTransactionsRequest searchTransactionsRequest, Long offset, Long pageSize) {
String address = searchTransactionsRequest.getAddress();
// Using address either from searchTransactionsRequest.address or from searchTransactionsRequest.accountIdentifier.address
String address = Optional.ofNullable(searchTransactionsRequest.getAddress())
.orElse(Optional.ofNullable(searchTransactionsRequest.getAccountIdentifier()).orElse(
AccountIdentifier.builder().build()).getAddress());
String txHash = Optional.ofNullable(searchTransactionsRequest.getTransactionIdentifier()).orElse(
TransactionIdentifier.builder().build()).getHash();
String symbol = Optional.ofNullable(searchTransactionsRequest.getCurrency())
Expand Down

0 comments on commit 8bb5cc9

Please sign in to comment.