diff --git a/Modules/Common/BeaconChainLikeAttestationsModule.php b/Modules/Common/BeaconChainLikeAttestationsModule.php index 8166713f..ebf04747 100644 --- a/Modules/Common/BeaconChainLikeAttestationsModule.php +++ b/Modules/Common/BeaconChainLikeAttestationsModule.php @@ -13,8 +13,8 @@ abstract class BeaconChainLikeAttestationsModule extends CoreModule public ?BlockHashFormat $block_hash_format = BlockHashFormat::HexWithout0x; public ?AddressFormat $address_format = AddressFormat::AlphaNumeric; - public ?TransactionHashFormat $transaction_hash_format = TransactionHashFormat::None; - public ?TransactionRenderModel $transaction_render_model = TransactionRenderModel::None; + public ?TransactionHashFormat $transaction_hash_format = TransactionHashFormat::AlphaNumeric; + public ?TransactionRenderModel $transaction_render_model = TransactionRenderModel::Mixed; public ?FeeRenderModel $fee_render_model = FeeRenderModel::None; public ?PrivacyModel $privacy_model = PrivacyModel::Transparent; @@ -186,13 +186,19 @@ final public function pre_process_block($block) // $block here is an epoch numbe { $events[] = [ 'block' => $block, - 'sort_key' => $key_tes++, 'time' => $this->block_time, 'address' => (string)$validator, 'effect' => $reward, ]; } + usort($events, function ($a, $b) { + return (strcmp($a['address'], $b['address'])); + }); + + foreach($events as &$ev) + $ev['sort_key'] = $key_tes++; + $this->set_return_events($events); } } diff --git a/Modules/Common/BeaconChainLikeDepositsModule.php b/Modules/Common/BeaconChainLikeDepositsModule.php index a8ee0b25..2528b297 100644 --- a/Modules/Common/BeaconChainLikeDepositsModule.php +++ b/Modules/Common/BeaconChainLikeDepositsModule.php @@ -155,6 +155,8 @@ final public function pre_process_block($block) // $block here is an epoch numbe ]; } } + $this->set_return_events($events); + return; } foreach ($deposits as [$index, $address, $amount, $slot, $deposit_address]) @@ -162,7 +164,6 @@ final public function pre_process_block($block) // $block here is an epoch numbe $events[] = [ 'block' => $block, 'transaction' => $slot, - 'sort_key' => $key_tes++, 'time' => $this->block_time, 'address' => (string)$index, 'effect' => $amount, @@ -170,6 +171,13 @@ final public function pre_process_block($block) // $block here is an epoch numbe ]; } + usort($events, function ($a, $b) { + return (strcmp($a['transaction'], $b['transaction'])); + }); + + foreach($events as &$ev) + $ev['sort_key'] = $key_tes++; + $this->set_return_events($events); } diff --git a/Modules/Common/BeaconChainLikePenaltiesModule.php b/Modules/Common/BeaconChainLikePenaltiesModule.php index ecd46dd1..53f1f99d 100644 --- a/Modules/Common/BeaconChainLikePenaltiesModule.php +++ b/Modules/Common/BeaconChainLikePenaltiesModule.php @@ -171,6 +171,14 @@ final public function pre_process_block($block) // $block here is an epoch numbe } } + usort($proposers_slashing, function ($a, $b) { + return (strcmp($a[1], $b[1])); + }); + + usort($attestors_slashing, function ($a, $b) { + return (strcmp($a[1], $b[1])); + }); + $this->get_epoch_time($block, $slots); foreach ($slots as $slot => $tm) diff --git a/Modules/Common/BeaconChainLikeProposalsModule.php b/Modules/Common/BeaconChainLikeProposalsModule.php index cc620fe4..ce525182 100644 --- a/Modules/Common/BeaconChainLikeProposalsModule.php +++ b/Modules/Common/BeaconChainLikeProposalsModule.php @@ -123,6 +123,7 @@ final public function pre_process_block($block) // $block here is an epoch numbe } $key_tes = 0; + ksort($rewards_slots); foreach ($rewards_slots as $slot => [$validator, $reward]) { diff --git a/Modules/Common/BeaconChainLikeWithdrawalsModule.php b/Modules/Common/BeaconChainLikeWithdrawalsModule.php index 10b53ee3..72cd7f7e 100644 --- a/Modules/Common/BeaconChainLikeWithdrawalsModule.php +++ b/Modules/Common/BeaconChainLikeWithdrawalsModule.php @@ -115,6 +115,10 @@ final public function pre_process_block($block) // $block here is an epoch numbe } } + usort($withdrawals, function ($a, $b) { + return (strcmp($a[3], $b[3])); + }); + $this->get_epoch_time($block, $slots); $key_tes = 0;