Since some of the new message formats have nested objects, things became very messy in the SettlementEngine. Also, it now needs to keep some state about outstanding and funding/funded transactions, and the code for that could also do with a little cleanup. Lastly, the integration test for settlements doesn't test the initiateNegotiation function, instead faking it by setting private vars - should clean that up as well.
Since some of the new message formats have nested objects, things became very messy in the SettlementEngine. Also, it now needs to keep some state about outstanding and funding/funded transactions, and the code for that could also do with a little cleanup. Lastly, the integration test for settlements doesn't test the initiateNegotiation function, instead faking it by setting private vars - should clean that up as well.