Reputation: 444
There's a Utility
cordapp that contains all the helper constants/methods.
The Contract
cordapp has a dependency on Utilities
and some of its contract code is running the constants or methods in Utility
cordapp.
Is this a safe practice? If someone were to change the implementation of the helper method in Utility
, it would fail on the responder side since they have the original Utility
cordapp implmentation?
Upvotes: 0
Views: 34
Reputation: 23140
In the Corda endstate:
Contract
subclasses, but also any dependencies of these Contract
subclasses (i.e. any classes referenced from these contracts)Because contract JARs are pinned down by hash in transactions, you know that both parties are using the exact same version of any classes.
As of Corda 3, this functionality isn't implemented. Once it is, the design pattern you discuss above will be safe.
Upvotes: 0