-
Notifications
You must be signed in to change notification settings - Fork 25
Simplify store by moving code to base / other classes #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Is this to go in before the release? |
It's not critical but it could speed up writing test cases. It's really hard to say. |
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. |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking this until after the release.
@bokobza , can we take another look at this now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the new CrossChainDBTransaction class is what I had in mind for the "store" component back in the early days, I am happy to see it here.
I am going to check test coverage etc, but it looks good I think
/// <summary> | ||
/// The purpose of this class is to restrict the operations that can be performed on the underlying | ||
/// database - i.e. it provides a "higher level" layer to the underlying DBreeze transaction. | ||
/// As such it provides a guarantees that any transient lookups will be kept in step with changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept in sync ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
namespace Stratis.FederatedPeg.Features.FederationGateway.TargetChain | ||
{ | ||
/// <summary>Supported DBreeze transaction modes.</summary> | ||
public enum CrossChainTransactionMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I correctly understand and we are only talking about transaction in the DB sense of the term, I think the name is a bit ambiguous here: CrossChainTransactionMode could be easily interpreted as different modes of performing a Cross chain transfer no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to CrossChainDBTransactionMode
.
See #281