@@ -60,16 +60,17 @@ func (t *buildernetSigningTransport) RoundTrip(req *http.Request) (*http.Respons
6060
6161// TestTxConfig holds configuration for the test transaction
6262type TestTxConfig struct {
63- RPCURL string // Target RPC URL for sending transactions (e.g., rbuilder)
64- ELRPCURL string // EL RPC URL for chain queries (e.g., reth). If empty, uses RPCURL
65- PrivateKey string
66- ToAddress string
67- Value * big.Int
68- GasLimit uint64
69- GasPrice * big.Int
70- Timeout time.Duration // Timeout for waiting for receipt. If 0, no timeout.
71- Retries int // Max failed receipt requests before giving up. If 0, retry forever.
72- Insecure bool // Skip TLS certificate verification
63+ RPCURL string // Target RPC URL for sending transactions (e.g., rbuilder)
64+ ELRPCURL string // EL RPC URL for chain queries (e.g., reth). If empty, uses RPCURL
65+ PrivateKey string
66+ ToAddress string
67+ Value * big.Int
68+ GasLimit uint64
69+ GasPrice * big.Int
70+ Timeout time.Duration // Timeout for waiting for receipt. If 0, no timeout.
71+ Retries int // Max failed receipt requests before giving up. If 0, retry forever.
72+ Insecure bool // Skip TLS certificate verification
73+ ExpectedExtraData string // If set, verify block extra data matches this string
7374}
7475
7576// DefaultTestTxConfig returns the default test transaction configuration
@@ -240,7 +241,12 @@ func SendTestTransaction(ctx context.Context, cfg *TestTxConfig) error {
240241 // Get block to show extra data (builder name)
241242 block , err := elClient .BlockByNumber (ctx , receipt .BlockNumber )
242243 if err == nil && block != nil {
243- fmt .Printf (" Extra Data: %s\n " , string (block .Extra ()))
244+ extraData := string (block .Extra ())
245+ fmt .Printf (" Extra Data: %s\n " , extraData )
246+
247+ if cfg .ExpectedExtraData != "" && extraData != cfg .ExpectedExtraData {
248+ return fmt .Errorf ("extra data mismatch: expected %q, got %q" , cfg .ExpectedExtraData , extraData )
249+ }
244250 }
245251 return nil
246252 }
0 commit comments