From External Contributor:
[ERROR] 2019-11-06T11:20:54,377Z [Node thread-1] internal.Verifier.verifyContracts - Error validating transaction B3F8D48A7FBCACF37DB40E60A6113F0AF06ED2F5B2C06B1D3EBA133351496ED7... java.lang.IllegalArgumentException: corporateAdvanceBalance(java.math.BigDecimal) -> object is not an instance of declaring class
The ContractState.hash() function throws an exception when you try to calculate the hash of state object inside the Contract.verify() method.
What I have observed that it throws an exception if the contract state having the field of type BigDecimal and especially with Zero value.
You can find the sample code for state, contract, flow, and stack trace logs at below gist:
This code works fine if you test using MockNetwork. However, you can reproduce the error by deploying this code on actual Corda Node.
Tested with the Corda OS version 4 and 4.1