verifyPath()

In the previous section we described how the verifyPathConstraints() function calls the verifyPath() function from ContractUtils. In this section you can see how verifyPath() works. You can also see the implementation of VerifyPath in the cdl-example code repo.

This diagram shows an example of an implementation of VerifyPath:

From the LedgerTransaction you can establish the Path in the transaction, as well as the status of the Primary input state. From the status of the Primary input state you can establish the set of allowed PathConstraints for the status of that input state. The verifyPath() function then takes the Path and checks it against each PathConstraint. If it can find a PathConstraint which allows the transaction Path then it returns true, if not, it will return false which will cause the verifyPathConstraints() function to throw a verification error.

Looking in detail, you can see the properties in Path and PathConstraint respectively, together with the checks that each PathConstraint property applies to its corresponding Path property:

Then, for the full description, you must add in the additionalStates checks in which each required additionStatesConstraint must be satisfied by at least one of the additionalStates in the transaction:

Was this page helpful?

Thanks for your feedback!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.

We're sorry this page wasn't helpful. Let us know how we can make it better!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Create an issue

Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.