-
Notifications
You must be signed in to change notification settings - Fork 101
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
implement transaction reversion #61
Conversation
Signed-off-by: Henry Jackson <henry.jackson.95@gmail.com>
Signed-off-by: Henry Jackson <henry.jackson.95@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #61 +/- ##
==========================================
+ Coverage 34.01% 35.78% +1.77%
==========================================
Files 26 28 +2
Lines 1379 1537 +158
==========================================
+ Hits 469 550 +81
- Misses 858 930 +72
- Partials 52 57 +5
Continue to review full report at Codecov.
|
Signed-off-by: Henry Jackson <henry.jackson.95@gmail.com>
Signed-off-by: Henry Jackson <henry.jackson.95@gmail.com>
…into revert-transaction
ledger/ledger.go
Outdated
return tx, err | ||
} | ||
|
||
meta, err := l.store.GetMeta("transaction", id) |
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'm not mistaken the meta fetching should be already covered by in the store
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.
Ah, you're right. I'll remove this
@@ -121,6 +121,38 @@ func NewHttpAPI(lc fx.Lifecycle, resolver *ledger.Resolver) *HttpAPI { | |||
c.JSON(200, res) | |||
}) | |||
|
|||
r.POST("/:ledger/transactions/:id/revert", func(c *gin.Context) { |
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.
What do you think about enclosing the logic here in a new function of ledger/ledger.go
?
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 agree, probably too much business logic going on here, moved it
Signed-off-by: Henry Jackson <henry.jackson.95@gmail.com>
Signed-off-by: Henry Jackson <henry.jackson.95@gmail.com>
Signed-off-by: Henry Jackson <henry.jackson.95@gmail.com>
@altitude good to go now 🚀 |
Awesome, thanks @henry-jackson! |
Signed-off-by: Henry Jackson henry.jackson.95@gmail.com
Closes #52