-
Notifications
You must be signed in to change notification settings - Fork 46
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
escrow bucket.Create does not save #170
Comments
@husio It happens in Deposit, so all good. Just looks a bit confusing. |
Good point. I think the comment of the
|
@husio sure, I'm pretty sure this was copy-pasted from other implementations as this is a pretty standard workflow. |
There's more where this is coming from, might be helpful to go through the code and see where else we are missing/have invalid comments. Makes extension development easier for newcomers and just in general. |
Yeah, this is a bit confusing. Just update to write to the db in Create as well. And a cleanup of comments is always welcome. Most of this code was writen quite quickly when I was the only one reading/writing the project, so happy for any fixups. I think we are not too worried about optimizing writes yet, and they go to a memory db now. You can update this to |
As @husio brought this up, now. Some definition for |
I'm fine with any usage, but clarity and consistency is better. It seems like we would assume a save in create, but we could also document otherwise. I think I originally conceived it as not saving, but I probably mixed it. I will defer to your decisions, but consistency is good, which this issue properly points out. |
I think it is less surprising if |
Escrow `Bucket.Create` method documentation is updated to be acurate. fix #170
Escrow `Bucket.Create` method and documentation is updated to be acurate. fix #170
* fix bucket.Create method Escrow `Bucket.Create` method and documentation is updated to be acurate. fix #170 * replace escrow.Bucket.Create with Build method Rename `Create` to `Build` and update documentation. Create method should persist returned object in the store. Because of how escrow extension is implemented, a zero value escrow instance cannot be persisted due to validation. Escrow controller is expecting a zero amount escrow instance, that it will deposit initial amount to. Rename `Create` to `Build` so that the logic can remain as is, but the confusing naming is fixed.
In package
x/escrow
,Bucket.Create
is described to be saving the created instance (see comment), but it only creates an ID and returns entity without storing it.Method is used in creation handler and it seems to expect the instance to be stored in the database when
Create
is called.The text was updated successfully, but these errors were encountered: