Skip to content

Commit

Permalink
Balance Distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
koloale authored and Tolsi committed Jan 11, 2017
1 parent 815d191 commit ba2c7cf
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/scala/scorex/waves/http/DebugApiRoute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case class DebugApiRoute(application: RunnableApplication)(implicit val context:
lazy val wallet = application.wallet

override lazy val route = pathPrefix("debug") {
blocks ~ state ~ stateAt ~ info ~ getSettings
blocks ~ state ~ stateAt ~ info ~ getSettings ~ stateWaves
}

@Path("/blocks/{howMany}")
Expand Down Expand Up @@ -75,6 +75,20 @@ case class DebugApiRoute(application: RunnableApplication)(implicit val context:
}
}

@Path("/stateWaves/{height}")
@ApiOperation(value = "State at block", notes = "Get state at specified height", httpMethod = "GET")
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "height", value = "height", required = true, dataType = "integer", paramType = "path")
))
def stateWaves: Route = {
path("stateWaves" / IntNumber) { height =>
getJsonRoute {
val res = application.blockStorage.state.asInstanceOf[StoredState].toWavesJson(height)
JsonResponse(res, StatusCodes.OK)
}
}
}

@Path("/info")
@ApiOperation(value = "State", notes = "All info you need to debug", httpMethod = "GET")
@ApiResponses(Array(
Expand Down

0 comments on commit ba2c7cf

Please sign in to comment.