Skip to content

Commit

Permalink
fix: eth_txs, issue #48
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocasizzone committed Aug 30, 2022
1 parent 86742d6 commit b8b5d4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion controllers/BlockchainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ public function actionEthtx()
$walletBlock = $this->getChainBlock($user_id, $searchBlock);
$timeToComplete = hexdec($chainBlock->timestamp) - hexdec($walletBlock->timestamp);

// echo '<pre>'.print_r($walletBlock,true).'</pre>';exit;

$difference = hexdec($chainBlock->number) - hexdec($searchBlock);
$percentageCompletion = round(hexdec($searchBlock) / hexdec($chainBlock->number) * 100, 4);

Expand All @@ -187,7 +189,7 @@ public function actionEthtx()
"relativeTime" => Yii::$app->formatter->asDuration($timeToComplete),
"percentageCompletion" => $percentageCompletion."%",
"latestBlockHash"=>Html::a($chainBlock->hash,$node->blockchain->url_block_explorer.'/block/'.hexdec($chainBlock->number),['target'=>'_blank']),
"walletBlockHash"=>Html::a($walletBlock->hash,$node->blockchain->url_block_explorer.'/block/'.hexdec($searchBlock),['target'=>'_blank']),
"walletBlockHash"=>Html::a($walletBlock->number,$node->blockchain->url_block_explorer.'/block/'.hexdec($searchBlock),['target'=>'_blank']),
];
return Json::encode($return);
}
Expand Down
2 changes: 1 addition & 1 deletion views/settings/nodes/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$blockchains = ArrayHelper::map(Blockchains::find()->where(['id_user'=>$model->id_user])->all(), 'id', 'denomination');
$smartcontract = ArrayHelper::map(SmartContracts::find()
->andWhere(['id_blockchain'=>$model->id_blockchain])
//->andWhere(['id_user'=>$model->id_user])
->andWhere(['id_user'=>$model->id_user])
->all(), 'id', 'denomination');

include ('_formjs.php');
Expand Down

0 comments on commit b8b5d4b

Please sign in to comment.