The state transition of a Loan from
(Fundraising|GatheringCollateral)->Finished (due to timing out) or
(FUndraising)->Finished (due to defaulting) happens automatically via
the timedTransitions modifier. The way we currently get the contract
state on the metabackend does not trigger this transition so we don't
notice such timeouts. To remedy this:
we introduce a new getCurrentState() method on the Loan smart
contract that calls the modifier and returns actual fresh data
for old contracts without this method, the metabackend performs a
check via isX() methods to get the fresh data, then translates that
logic into a refreshed state
We also drive-by clean up getter calls to return more descriptive errors
when calling a getter fails. This was required when we were debugging a
Truffle miscompilation issue while working on this commit.
The state transition of a Loan from (Fundraising|GatheringCollateral)->Finished (due to timing out) or (FUndraising)->Finished (due to defaulting) happens automatically via the timedTransitions modifier. The way we currently get the contract state on the metabackend does not trigger this transition so we don't notice such timeouts. To remedy this:
We also drive-by clean up getter calls to return more descriptive errors when calling a getter fails. This was required when we were debugging a Truffle miscompilation issue while working on this commit.