@@ -98,14 +98,13 @@ func TestValidateBuilderSubmissionV1(t *testing.T) {
98
98
99
99
blockRequest .Message .GasLimit += 1
100
100
blockRequest .ExecutionPayload .GasLimit += 1
101
+ updatePayloadHash (t , blockRequest )
101
102
102
- oldHash := blockRequest .Message .BlockHash
103
- copy (blockRequest .Message .BlockHash [:], hexutil .MustDecode ("0xa6592f67b46f9567ff417defcc2e5ef40b7e3eafb04be990395ef3807d6c57e9" )[:32 ])
104
103
require .ErrorContains (t , api .ValidateBuilderSubmissionV1 (blockRequest ), "incorrect gas limit set" )
105
104
106
105
blockRequest .Message .GasLimit -= 1
107
106
blockRequest .ExecutionPayload .GasLimit -= 1
108
- blockRequest . Message . BlockHash = oldHash
107
+ updatePayloadHash ( t , blockRequest )
109
108
110
109
// TODO: test with contract calling blacklisted address
111
110
// Test tx from blacklisted address
@@ -144,10 +143,16 @@ func TestValidateBuilderSubmissionV1(t *testing.T) {
144
143
invalidPayload .LogsBloom = boostTypes.Bloom {}
145
144
copy (invalidPayload .ReceiptsRoot [:], hexutil .MustDecode ("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" )[:32 ])
146
145
blockRequest .ExecutionPayload = invalidPayload
147
- copy ( blockRequest . Message . BlockHash [:], hexutil . MustDecode ( "0xb91a7a79407584a835d814de77808a25e72d5025bc7691630e57c40d8c47ee33" )[: 32 ] )
146
+ updatePayloadHash ( t , blockRequest )
148
147
require .ErrorContains (t , api .ValidateBuilderSubmissionV1 (blockRequest ), "could not apply tx 3" , "insufficient funds for gas * price + value" )
149
148
}
150
149
150
+ func updatePayloadHash (t * testing.T , blockRequest * BuilderBlockValidationRequest ) {
151
+ updatedBlock , err := beacon .ExecutionPayloadToBlock (blockRequest .ExecutionPayload )
152
+ require .NoError (t , err )
153
+ copy (blockRequest .Message .BlockHash [:], updatedBlock .Hash ().Bytes ()[:32 ])
154
+ }
155
+
151
156
func generatePreMergeChain (n int ) (* core.Genesis , []* types.Block ) {
152
157
db := rawdb .NewMemoryDatabase ()
153
158
config := params .AllEthashProtocolChanges
0 commit comments