FederatedSidechains icon indicating copy to clipboard operation
FederatedSidechains copied to clipboard

Simplify store by moving code to base / other classes

Open quantumagi opened this issue 7 years ago • 5 comments

See #281

quantumagi avatar Dec 16 '18 10:12 quantumagi

Is this to go in before the release?

bokobza avatar Dec 17 '18 00:12 bokobza

It's not critical but it could speed up writing test cases. It's really hard to say.

quantumagi avatar Dec 17 '18 09:12 quantumagi

I think this change does a lot more than just simplifying the store and adds a bit of functionality so I'm keen to wait with it.

bokobza avatar Dec 17 '18 13:12 bokobza

No functionality was added - i.e. the code is doing nothing that it was not doing before. The PR splits the code up into digestible pieces (into new classes) which means code is also being moved around. However we can certainly wait with this.

For instance, much complexity exists in the code relating to maintaining transactional integrity and leaving the store in a predictable state when errors occur. This is tricky due to the use of in-memory lookups that need to reflect the store state. To simplify things all of that code was moved into the CrossChainDBTransaction and ICrossChainDB classes. Serialization was restricted to the former class.

quantumagi avatar Dec 18 '18 05:12 quantumagi

@bokobza , can we take another look at this now?

quantumagi avatar Jan 07 '19 05:01 quantumagi