Skip to content
Snippets Groups Projects
Commit fa8a40a2 authored by Gomez Goiri, Aitor's avatar Gomez Goiri, Aitor
Browse files

Adding new operation to reset stats

Useful during development
parent f04b619d
Branches
Tags
No related merge requests found
......@@ -251,6 +251,16 @@ func ContextOperations(m shared.AbstractChaincodeOperationManager) error {
nil,
assetController.OnlySameOrg(bidDecisionController.AcceptBid),
).
// For debugging stats
AddOperation(
"hypercog-stats-reset",
shared.WRITE_OP,
[]shared.MiddlewareInterface{
m2.RejectIfNotPublicAdmin,
},
nil,
stats.ResetStats,
).
Build(m)
return nil
......
......@@ -49,3 +49,8 @@ func GetStatsOperation(stub shared.LedgerBuildrStubInterface, request shared.Led
return api.NewAPIGenericResponsePtr(fnName, nil, ret).SendResponse()
}
func ResetStats(stub shared.LedgerBuildrStubInterface, request shared.LedgerBuildrAsset) protos.Response {
err := resetStats(stub)
return api.NewAPIGenericResponsePtr("ResetStats", err, nil).SendResponse()
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment