From bdb79ddca10dd8d05fffab88c0bc7c941b0eed5f Mon Sep 17 00:00:00 2001 From: Abe Orm Date: Fri, 1 Nov 2024 00:16:40 +0800 Subject: [PATCH] Optimize the variable definitions in the unit test cases to enhance readability and maintainability --- .../game/fault/contracts/faultdisputegame_test.go | 9 ++++----- op-challenger2/game/fault/types/position_test.go | 14 +++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/op-challenger2/game/fault/contracts/faultdisputegame_test.go b/op-challenger2/game/fault/contracts/faultdisputegame_test.go index 63f0c1793da0..49c0cf15c9e1 100644 --- a/op-challenger2/game/fault/contracts/faultdisputegame_test.go +++ b/op-challenger2/game/fault/contracts/faultdisputegame_test.go @@ -803,12 +803,11 @@ func TestAttackV2Tx(t *testing.T) { t.Run(version.version, func(t *testing.T) { stubRpc, game := setupFaultDisputeGameTest(t, version) bond := big.NewInt(1044) - value := common.Hash{0xaa} - var claims [96]byte - copy(claims[0:32], value[:]) - copy(claims[32:64], value[:]) - copy(claims[64:96], value[:]) nBits := uint64(2) + claims := make([]byte, ((1<