Skip to content

Commit

Permalink
add solution id to more places
Browse files Browse the repository at this point in the history
  • Loading branch information
HarukaMa committed Jul 12, 2024
1 parent fef48b4 commit ad10546
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions db/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def get_recent_solutions_by_address(self, address: str) -> list[dict[str,
async with conn.cursor() as cur:
try:
await cur.execute(
"SELECT b.height, b.timestamp, s.counter, s.target, reward, ps.target_sum "
"SELECT b.height, b.timestamp, s.counter, s.target, s.solution_id, reward, ps.target_sum "
"FROM solution s "
"JOIN puzzle_solution ps ON ps.id = s.puzzle_solution_id "
"JOIN block b ON b.id = ps.block_id "
Expand Down Expand Up @@ -54,7 +54,7 @@ async def get_solution_by_address(self, address: str, start: int, end: int) -> l
async with conn.cursor() as cur:
try:
await cur.execute(
"SELECT b.height, b.timestamp, s.counter, s.target, reward, ps.target_sum "
"SELECT b.height, b.timestamp, s.counter, s.target, s.solution_id, reward, ps.target_sum "
"FROM solution s "
"JOIN puzzle_solution ps ON ps.id = s.puzzle_solution_id "
"JOIN block b ON b.id = ps.block_id "
Expand Down
2 changes: 2 additions & 0 deletions webui/proving_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ async def address_route(request: Request):
"counter": solution["counter"],
"target": solution["target"],
"target_sum": solution["target_sum"],
"solution_id": solution["solution_id"],
})
recent_programs: list[dict[str, Any]] = []
for program in programs:
Expand Down Expand Up @@ -301,6 +302,7 @@ async def address_solution_route(request: Request):
"counter": solution["counter"],
"target": solution["target"],
"target_sum": solution["target_sum"],
"solution_id": solution["solution_id"],
})
sync_info = await out_of_sync_check(request.app.state.session, db)
ctx = {
Expand Down
2 changes: 2 additions & 0 deletions webui/templates/htmx/address.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
<th>Block</th>
<th>Epoch</th>
<th>Timestamp</th>
<th>Solution ID</th>
<th>Counter</th>
<th>Target / Total</th>
<th>Reward</th>
Expand All @@ -156,6 +157,7 @@
<td><a href="/block?h={{ solution.height }}">{{ solution.height | format_number | safe }}</a></td>
<td>{{ solution.height // 256 }}</td>
<td>{{ solution.timestamp | format_time | safe }}</td>
<td><span class="mono">{{ solution.solution_id }}</span></td>
<td>{{ solution.counter }}</td>
<td>{{ solution.target | format_number | safe }}<span class="note"> / {{ solution.target_sum | format_number | safe }}</span></td>
<td>{{ solution.reward | format_aleo_credit | safe }}</td>
Expand Down
2 changes: 2 additions & 0 deletions webui/templates/htmx/address_solution.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<th>Block</th>
<th>Epoch</th>
<th>Timestamp</th>
<th>Solution ID</th>
<th>counter</th>
<th>Target / Total</th>
<th>Reward</th>
Expand All @@ -28,6 +29,7 @@
<td><a href="/block?h={{ solution.height }}">{{ solution.height }}</a></td>
<td>{{ solution.height // 256 }}</td>
<td>{{ solution.timestamp | format_time | safe }}</td>
<td><span class="mono">{{ solution.solution_id }}</span></td>
<td>{{ solution.counter }}</td>
<td>{{ solution.target }}<span class="note"> / {{ solution.target_sum }}</span></td>
<td>{{ solution.reward | format_aleo_credit | safe }}</td>
Expand Down
4 changes: 2 additions & 2 deletions webui/templates/htmx/block.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,21 @@
<table id="coinbase-table" class="unstriped">
<thead>
<tr>
<td>Solution ID</td>
<td>Address</td>
<td>Counter</td>
<td>Target / Total</td>
<td>Reward</td>
<td>SolutionID</td>
</tr>
</thead>
<tbody>
{% for partial_solution in coinbase_solutions %}
<tr>
<td><span class="mono">{{ partial_solution.solution_id }}</span></td>
<td><a href="/address?a={{ partial_solution.address }}"><span class="mono">{{ partial_solution.address_trunc }}</span></a></td>
<td><span class="mono">{{ partial_solution.counter }}</span></td>
<td>{{ partial_solution.target | format_number | safe }}<span class="note"> / {{ target_sum | format_number | safe }}</span></td>
<td>{{ partial_solution.reward | format_aleo_credit | safe }}</td>
<td> {{ partial_solution.solution_id }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit ad10546

Please sign in to comment.