Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Corda: How can I check Consumed or Not Consumed

Tags:

corda

How can I check the status of the State (Consumed or Not Consumed) in Corda?

I downloaded Cordapp-example, executed "Create-iou" several times, then I referred to State information using the "ious" API, but I could not confirm the status.

like image 306
s.Takahashi Avatar asked Dec 07 '25 05:12

s.Takahashi


1 Answers

You can check the metadata of the state to find out it's consumed or not. in the metadata there is an option to check if the state is consumed or unconsumed.

For example:

Vault.Page<YourState> results = rpcOps.vaultQueryByCriteria(linearCriteria, YourState.class);
results.getStatesMetadata().get(0).getStatus(); -> This will get you the status of the state
like image 140
Kid101 Avatar answered Dec 09 '25 10:12

Kid101



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!