Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vault query fails to find a state if it extends from class

See original GitHub issue


My state (S) extends from class ©, which in turn implements interface (I).

I.e. S -> C -> I

If I use this query:


Where “I” is my interface the query will not return state S, although it exists in the vault. I believe the problem is in the method deriveContractInterfaces in class NodeVaultService, which should perhaps traverse up in the hierarchy, not just look at the immediate interfaces the class implements.

I’m observing this behavior on 3.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

manishchainThatcommented, Nov 14, 2018

@josecoll it worked for me . Thanks

Alex-Kollercommented, Jul 30, 2018

Hi, thanks for the quick turnaround. If I’m not mistaken querying by ContractState is treated specifically in the code. Try instead of ContractState implement a custom Interface first. In my example I had:

interface InterestRateDerivative : LinearState

abstract class State() : InterestRateDerivative { }

data class CapState() : State { }

This, of course, won’t compile due to missing abstract properties but is the hierarchy that didn’t work for me. If you still can’t reproduce it I will dig out and post my code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

corda implement generic vault query - java - Stack Overflow
Does this help? IouState state; // Assuming IouState extends or implements ContractState getStatesByLinearId(state, state.
Read more >
Vault Query Language
This tutorial covers the basics of structuring and submitting a query and how to use VQL to retrieve document and object fields. Structuring...
Read more >
API: Vault Query - R3 Documentation
All contract states that extend LinearState or DealState now automatically persist those interfaces' common state attributes to the VAULT_LINEAR_STATES table.
Read more >
Use operators to refine a search in Vault - Google Help
You can use English search operators to find non-English words and phrases. For most services, Vault assumes there is an AND operator between...
Read more >
SQL Server Connector maintenance & troubleshooting
Error code Symbol Description 0 scp_err_Success The operation has succeeded. 1 scp_err_Failure The operation has failed. 5 scp_err_AuthFailure The authentication has failed with EKM provider.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found