@@ -107,14 +107,13 @@ func TestValidateBuilderSubmissionV1(t *testing.T) {
107
107
108
108
blockRequest .Message .GasLimit += 1
109
109
blockRequest .ExecutionPayload .GasLimit += 1
110
+ updatePayloadHash (t , blockRequest )
110
111
111
- oldHash := blockRequest .Message .BlockHash
112
- copy (blockRequest .Message .BlockHash [:], hexutil .MustDecode ("0x56cbdd508966f89cfb6ba16535e3676b59ae3ac3774478b631466bc99c1033c9" )[:32 ])
113
112
require .ErrorContains (t , api .ValidateBuilderSubmissionV1 (blockRequest ), "incorrect gas limit set" )
114
113
115
114
blockRequest .Message .GasLimit -= 1
116
115
blockRequest .ExecutionPayload .GasLimit -= 1
117
- blockRequest . Message . BlockHash = oldHash
116
+ updatePayloadHash ( t , blockRequest )
118
117
119
118
// TODO: test with contract calling blacklisted address
120
119
// Test tx from blacklisted address
@@ -153,10 +152,16 @@ func TestValidateBuilderSubmissionV1(t *testing.T) {
153
152
invalidPayload .LogsBloom = boostTypes.Bloom {}
154
153
copy (invalidPayload .ReceiptsRoot [:], hexutil .MustDecode ("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" )[:32 ])
155
154
blockRequest .ExecutionPayload = invalidPayload
156
- copy ( blockRequest . Message . BlockHash [:], hexutil . MustDecode ( "0x595cba7ab70a18b7e11ae7541661cb6692909a0acd3eba3f1cf6ae694f85a8bd" )[: 32 ] )
155
+ updatePayloadHash ( t , blockRequest )
157
156
require .ErrorContains (t , api .ValidateBuilderSubmissionV1 (blockRequest ), "could not apply tx 4" , "insufficient funds for gas * price + value" )
158
157
}
159
158
159
+ func updatePayloadHash (t * testing.T , blockRequest * BuilderBlockValidationRequest ) {
160
+ updatedBlock , err := beacon .ExecutionPayloadToBlock (blockRequest .ExecutionPayload )
161
+ require .NoError (t , err )
162
+ copy (blockRequest .Message .BlockHash [:], updatedBlock .Hash ().Bytes ()[:32 ])
163
+ }
164
+
160
165
func generatePreMergeChain (n int ) (* core.Genesis , []* types.Block ) {
161
166
db := rawdb .NewMemoryDatabase ()
162
167
config := params .AllEthashProtocolChanges
0 commit comments