Skip to content

Commit

Permalink
update deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
parisyup committed May 2, 2024
1 parent de64fa4 commit 96a5af8
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public String call(@NotNull ClientRequestBody requestBody) {
UUID proposalID = request.getProposalID();

// Getting the old Proposal State as an input state
List<StateAndRef<Proposal>> proposalStatAndRef = utxoLedgerService.findUnconsumedStatesByExactType (Proposal.class,100, Instant.now()).getResults();
List<StateAndRef<Proposal>> proposalStatAndRef = utxoLedgerService.findUnconsumedStatesByExactType(Proposal.class,100, Instant.now()).getResults();
List<StateAndRef<Proposal>> proposalStatAndRefWithId = proposalStatAndRef.stream().
filter(it -> it.getState().getContractState().getProposalID().equals(proposalID)).collect(Collectors.toList());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ListProposal implements ClientStartableFlow {
@Override
public String call(@NotNull ClientRequestBody requestBody) {
// Queries the VNode's vault for unconsumed states and converts the result to a serializable DTO.
List<StateAndRef<Proposal>> states = utxoLedgerService.findUnconsumedStatesByExactType (Proposal.class, 100, Instant.now()).getResults();
List<StateAndRef<Proposal>> states = utxoLedgerService.findUnconsumedStatesByExactType(Proposal.class, 100, Instant.now()).getResults();
List<ListProposalArgs> results = states.stream().map(stateAndRef ->
new ListProposalArgs(
stateAndRef.getState().getContractState().getProposalID(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ListTrade implements ClientStartableFlow {
@Override
public String call(@NotNull ClientRequestBody requestBody) {
// Queries the VNode's vault for unconsumed states and converts the result to a serializable DTO.
List<StateAndRef<Trade>> states = utxoLedgerService.findUnconsumedStatesByExactType (Trade.class, 100, Instant.now()).getResults();
List<StateAndRef<Trade>> states = utxoLedgerService.findUnconsumedStatesByExactType(Trade.class, 100, Instant.now()).getResults();
List<ListTradeArgs> results = states.stream().map(stateAndRef ->
new ListTradeArgs(
stateAndRef.getState().getContractState().getProposalID(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public String call(ClientRequestBody requestBody) {
int amountSettle = Integer.parseInt(flowArgs.getAmountSettle());

//query the IOU input
List<StateAndRef<IOUState>> iouStateAndRefs = ledgerService.findUnconsumedStatesByExactType (IOUState.class,100, Instant.now()).getResults();
List<StateAndRef<IOUState>> iouStateAndRefs = ledgerService.findUnconsumedStatesByExactType(IOUState.class,100, Instant.now()).getResults();
List<StateAndRef<IOUState>> iouStateAndRefsWithId = iouStateAndRefs.stream()
.filter(sar -> sar.getState().getContractState().getLinearId().equals(iouID)).collect(toList());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public String call(ClientRequestBody requestBody) {
UUID iouID = flowArgs.getIouID();

//query the IOU input
List<StateAndRef<IOUState>> iouStateAndRefs = ledgerService.findUnconsumedStatesByExactType (IOUState.class,100, Instant.now()).getResults();
List<StateAndRef<IOUState>> iouStateAndRefs = ledgerService.findUnconsumedStatesByExactType(IOUState.class,100, Instant.now()).getResults();
List<StateAndRef<IOUState>> iouStateAndRefsWithId = iouStateAndRefs.stream()
.filter(sar -> sar.getState().getContractState().getLinearId().equals(iouID)).collect(toList());
if (iouStateAndRefsWithId.size() != 1) throw new CordaRuntimeException("Multiple or zero IOU states with id " + iouID + " found");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public String call(ClientRequestBody requestBody) {
log.info("ListIOUFlow.call() called");

// Queries the VNode's vault for unconsumed states and converts the result to a serializable DTO.
List<StateAndRef<IOUState>> states = utxoLedgerService.findUnconsumedStatesByExactType (IOUState.class,100, Instant.now()).getResults();
List<StateAndRef<IOUState>> states = utxoLedgerService.findUnconsumedStatesByExactType(IOUState.class,100, Instant.now()).getResults();
List<ListIOUFlowResults> results = states.stream().map(stateAndRef ->
new ListIOUFlowResults(
stateAndRef.getState().getContractState().getLinearId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class GetAssetFlow implements ClientStartableFlow {
@Suspendable
public String call(@NotNull ClientRequestBody requestBody) {
List<AssetDetail> assetList =
ledgerService.findUnconsumedStatesByExactType (Asset.class,100, Instant.now()).getResults().stream().map(
ledgerService.findUnconsumedStatesByExactType(Asset.class,100, Instant.now()).getResults().stream().map(
it -> new AssetDetail(
it.getState().getContractState().getOwner().getName(),
it.getState().getContractState().getAssetId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class GetLoanFlow implements ClientStartableFlow {
@Suspendable
public String call(@NotNull ClientRequestBody requestBody) {
List<LoanDetail> loanList =
ledgerService.findUnconsumedStatesByExactType (Loan.class,100, Instant.now()).getResults().stream().map(
ledgerService.findUnconsumedStatesByExactType(Loan.class,100, Instant.now()).getResults().stream().map(
it -> new LoanDetail(
it.getState().getContractState().getLoanId(),
it.getState().getContractState().getLender().getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public String call(@NotNull ClientRequestBody requestBody) {
Member lender = new Member(memberInfo.getName(), memberInfo.getLedgerKeys().get(0));

List<StateAndRef<Asset>> filteredAssetStateAndRefs =
ledgerService.findUnconsumedStatesByExactType (Asset.class,100, Instant.now()).getResults().stream().filter(
ledgerService.findUnconsumedStatesByExactType(Asset.class,100, Instant.now()).getResults().stream().filter(
it -> it.getState().getContractState().getAssetId().equals(flowArgs.getCollateral())
).collect(Collectors.toList());
if (filteredAssetStateAndRefs.size() != 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public String call(@NotNull ClientRequestBody requestBody) {
SettleLoanFlowArgs flowArgs = requestBody.getRequestBodyAs(jsonMarshallingService, SettleLoanFlowArgs.class);

List<StateAndRef<Loan>> filteredLoanStateAndRefs =
ledgerService.findUnconsumedStatesByExactType (Loan.class,100, Instant.now()).getResults().stream().filter(
ledgerService.findUnconsumedStatesByExactType(Loan.class,100, Instant.now()).getResults().stream().filter(
it -> it.getState().getContractState().getLoanId().equals(flowArgs.getLoanId())
).collect(Collectors.toList());

Expand All @@ -63,7 +63,7 @@ public String call(@NotNull ClientRequestBody requestBody) {
StateAndRef<Loan> loanStateAndRef = filteredLoanStateAndRefs.get(0);

List<StateAndRef<Asset>> filteredAssetStateAndRefs =
ledgerService.findUnconsumedStatesByExactType (Asset.class,100, Instant.now()).getResults().stream().filter(
ledgerService.findUnconsumedStatesByExactType(Asset.class,100, Instant.now()).getResults().stream().filter(
it -> it.getState().getContractState().getAssetId().equals(
loanStateAndRef.getState().getContractState().getCollateral()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public String call(@NotNull ClientRequestBody requestBody) {
Member buyer = new Member(memberInfo.getName(), memberInfo.getLedgerKeys().get(0));

List<StateAndRef<Asset>> filteredAssetStateAndRefs =
ledgerService.findUnconsumedStatesByExactType (Asset.class,100, Instant.now()).getResults().stream().filter(
ledgerService.findUnconsumedStatesByExactType(Asset.class,100, Instant.now()).getResults().stream().filter(
it -> it.getState().getContractState().getAssetId().equals(flowArgs.getAssetId())
).collect(Collectors.toList());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public String call(@NotNull ClientRequestBody requestBody) {
// to fetch the desired Insurance state from the vault. This filtered state would be used as input to the
// transaction.
List<StateAndRef<InsuranceState>> filteredInsuranceStateAndRefs =
ledgerService.findUnconsumedStatesByExactType (InsuranceState.class,100, Instant.now()).getResults().stream().filter(
ledgerService.findUnconsumedStatesByExactType(InsuranceState.class,100, Instant.now()).getResults().stream().filter(
it -> it.getState().getContractState().getPolicyNumber().equals(flowArgs.getPolicyNumber())
).collect(Collectors.toList());
if (filteredInsuranceStateAndRefs.size() != 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GetIOUFlow implements ClientStartableFlow {
public String call(@NotNull ClientRequestBody requestBody) {

List<IOU> iouList =
ledgerService.findUnconsumedStatesByExactType (SanctionableIOUState.class,100, Instant.now()).getResults().stream().map(
ledgerService.findUnconsumedStatesByExactType(SanctionableIOUState.class,100, Instant.now()).getResults().stream().map(
it -> new IOU(
it.getState().getContractState().getValue(),
it.getState().getContractState().getLender().getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class GetSanctionListFlow implements ClientStartableFlow {
public String call(@NotNull ClientRequestBody requestBody) {

List<SanctionListDetail> sanctionList =
ledgerService.findUnconsumedStatesByExactType (SanctionList.class,100, Instant.now()).getResults().stream().map(
ledgerService.findUnconsumedStatesByExactType(SanctionList.class,100, Instant.now()).getResults().stream().map(
it-> new SanctionListDetail(
it.getState().getContractState().getBadPeople().stream().map(Member::getName)
.collect(Collectors.toList()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public String call(@NotNull ClientRequestBody requestBody) {
@Suspendable
public StateAndRef<SanctionList> getSanctionsList(MemberX500Name sanctionsBody) {
List<StateAndRef<SanctionList>> sanctionLists =
ledgerService.findUnconsumedStatesByExactType (SanctionList.class,100, Instant.now()).getResults().stream().filter(
ledgerService.findUnconsumedStatesByExactType(SanctionList.class,100, Instant.now()).getResults().stream().filter(
it -> it.getState().getContractState().getIssuer().getName().equals(sanctionsBody)
).collect(Collectors.toList());
if(sanctionLists.isEmpty()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public String call(@NotNull ClientRequestBody requestBody) {
requestBody.getRequestBodyAs(jsonMarshallingService, UpdateSanctionListFlowArgs.class);

List<StateAndRef<SanctionList>> oldList =
ledgerService.findUnconsumedStatesByExactType (SanctionList.class,100, Instant.now()).getResults();
ledgerService.findUnconsumedStatesByExactType(SanctionList.class,100, Instant.now()).getResults();

if(oldList.isEmpty()){
throw new CordaRuntimeException("Sanction List not found.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class ListGoldTokens implements ClientStartableFlow {
@Suspendable
@Override
public String call(ClientRequestBody requestBody) {
List<StateAndRef<GoldState>> states = utxoLedgerService.findUnconsumedStatesByExactType (GoldState.class,100, Instant.now()).getResults();
List<StateAndRef<GoldState>> states = utxoLedgerService.findUnconsumedStatesByExactType(GoldState.class,100, Instant.now()).getResults();

List<GoldStateList> results = states.stream().map(stateAndRef ->
new GoldStateList(
Expand Down

0 comments on commit 96a5af8

Please sign in to comment.