Vault query fails to find a state if it extends from class
See original GitHub issueHi
My state (S) extends from class ©, which in turn implements interface (I).
I.e. S -> C -> I
If I use this query:
vaultService.queryBy<I>()
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:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@josecoll it worked for me . Thanks
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.