Skip to content

Commit

Permalink
Merge pull request #235 from ledgerleapllc/staging
Browse files Browse the repository at this point in the history
Sync staging to master
  • Loading branch information
ledgerleapllc authored Jan 2, 2023
2 parents a3009c4 + 50aa95f commit bb0b92c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
10 changes: 6 additions & 4 deletions app/Console/Commands/HistoricalData.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,39 +72,41 @@ public function handle()
$json = shell_exec($get_block.$node_arg.'-b '.$m);
$json = json_decode($json);
$test_era = (int)($json->result->block->header->era_id ?? 0);
info('finding max block ... '.$m);
$timestamp = $json->result->block->header->timestamp ?? '';
}

// run search algo
$historic_block = $m;
info('finding max block ... '.$historic_block);

while ($test_era != $historic_era) {
$json = shell_exec($get_block.$node_arg.'-b '.$historic_block);
$json = json_decode($json);
$test_era = (int)($json->result->block->header->era_id ?? 0);
info('trying historic_block '.$historic_block.' ... got era: '.$test_era);
// info('trying historic_block '.$historic_block.' ... got era: '.$test_era);
$timestamp = $json->result->block->header->timestamp ?? '';

if (
!$timestamp || $timestamp == '' ||
$test_era > $historic_era
) {
info('historic_block too high');
// info('historic_block too high');
$historic_block -= $m;
if ($historic_block < 1) $historic_block = 1;
$m = (int)($m / 2);
continue;
}

if ($test_era < $historic_era) {
info('historic_block too low');
// info('historic_block too low');
$historic_block += $m;
$m = (int)($m / 2);
continue;
}
}

info('found era: '.$test_era);

while ($current_era >= $historic_era) {
// first see if we have this era's auction info
$node_data = DB::select("
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/V1/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ public function verifyFileCasperSigner2(VerifyFileCasperSignerRequest $request)
$name = $file->getClientOriginalName();
$hexstring = $file->get();

if ($hexstring && $name == 'signature') {
if ($hexstring) {
$verified = $casperSigVerify->verify(
trim($hexstring),
$public_validator_key,
Expand Down Expand Up @@ -1296,7 +1296,7 @@ public function getVoteDetail($id)
);
}

$ballot = Ballot::with(['vote', 'voteResults.user', 'files'])
$ballot = Ballot::with(['vote', 'files'])
->where('id', $id)
->first();

Expand Down
3 changes: 1 addition & 2 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
|
*/

/// REMOVE
Route::get('/dev-verify-node/{address}', [AuthController::class, 'devVerifyNode'])->where('address', '[0-9a-zA-Z]+');
// Route::get('/dev-verify-node/{address}', [AuthController::class, 'devVerifyNode'])->where('address', '[0-9a-zA-Z]+');
Route::get('/test-job', [AuthController::class, 'testJob']);
Route::get('/dev-upgrade-list', [AuthController::class, 'devUpgradeList']);

Expand Down

0 comments on commit bb0b92c

Please sign in to comment.