From 7259aaeba7f13ceeb24a3b28215970aaf9d3e8a9 Mon Sep 17 00:00:00 2001 From: pikatos Date: Thu, 6 Jun 2024 09:30:57 +0200 Subject: [PATCH] EVM/Tezt: rename mixHash to prevRandoa --- etherlink/tezt/lib/block.ml | 12 ++++++------ etherlink/tezt/lib/block.mli | 2 +- etherlink/tezt/tests/evm_rollup.ml | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/etherlink/tezt/lib/block.ml b/etherlink/tezt/lib/block.ml index 7d85ac1437c9..47d04e2ae275 100644 --- a/etherlink/tezt/lib/block.ml +++ b/etherlink/tezt/lib/block.ml @@ -49,7 +49,7 @@ type t = { transactions : transactions; uncles : string list; baseFeePerGas : int64; - mixHash : string; + prevRandao : string; } let parse_transactions json = @@ -102,9 +102,9 @@ let of_json json = transactions = json |-> "transactions" |> parse_transactions; uncles = json |-> "uncles" |> as_list |> List.map as_string; baseFeePerGas = json ||-> ("baseFeePerGas", 1000000000L, as_int64); - mixHash = - json - ||-> ( "mixHash", - "0x0000000000000000000000000000000000000000000000000000000000000000", - as_string ); + prevRandao = + (let res = json |?-> ("mixHash", "prevRandao") in + if JSON.is_null res then + "0x0000000000000000000000000000000000000000000000000000000000000000" + else res |> as_string); } diff --git a/etherlink/tezt/lib/block.mli b/etherlink/tezt/lib/block.mli index 3a9ce1e5b93d..4b0bea73a927 100644 --- a/etherlink/tezt/lib/block.mli +++ b/etherlink/tezt/lib/block.mli @@ -53,7 +53,7 @@ type t = { transactions : transactions; uncles : string list; baseFeePerGas : int64; - mixHash : string; + prevRandao : string; } (** Extracts a block {!t} from a JSON. *) diff --git a/etherlink/tezt/tests/evm_rollup.ml b/etherlink/tezt/tests/evm_rollup.ml index 376642c16206..c52912e259a5 100644 --- a/etherlink/tezt/tests/evm_rollup.ml +++ b/etherlink/tezt/tests/evm_rollup.ml @@ -814,7 +814,7 @@ let test_rpc_getBlockBy_return_base_fee_per_gas_and_mix_hash = Replace by [Any] after the next upgrade *) ~kernels:[Latest] ~tags:["evm"; "rpc"; "get_block_by_hash"] - ~title:"getBlockBy returns base fee per gas and mix hash" + ~title:"getBlockBy returns base fee per gas and previous random number" ~minimum_base_fee_per_gas:(Wei.to_wei_z @@ Z.of_int 100) @@ fun ~protocol:_ ~evm_setup -> let evm_node_endpoint = Evm_node.endpoint evm_setup.evm_node in @@ -832,19 +832,19 @@ let test_rpc_getBlockBy_return_base_fee_per_gas_and_mix_hash = Check.((block_by_number.baseFeePerGas = 100L) int64) ~error_msg:"Unexpected block number, should be %%R, but got %%L" ; Check.( - (block_by_number.mixHash + (block_by_number.prevRandao = "0x0000000000000000000000000000000000000000000000000000000000000000") string) - ~error_msg:"Unexpected mix hash, should be %%R, but got %%L" ; + ~error_msg:"Unexpected previous random number, should be %%R, but got %%L" ; let* block_by_hash = get_block_by_hash evm_setup block_by_number.hash in Check.((block_by_hash.baseFeePerGas = 100L) int64) ~error_msg:"Unexpected block number, should be %%R, but got %%L" ; Check.( - (block_by_hash.mixHash + (block_by_hash.prevRandao = "0x0000000000000000000000000000000000000000000000000000000000000000") string) - ~error_msg:"Unexpected mix hash, should be %%R, but got %%L" ; + ~error_msg:"Unexpected previous random number, should be %%R, but got %%L" ; unit let test_l2_block_size_non_zero = -- GitLab