Skip to content

Commit b09631f

Browse files
authored
fix: display extra data as text instead of hex in test output (#387)
1 parent c94329a commit b09631f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

playground/test_tx.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,12 @@ func SendTestTransaction(ctx context.Context, cfg *TestTxConfig) error {
241241
// Get block to show extra data (builder name)
242242
block, err := elClient.BlockByNumber(ctx, receipt.BlockNumber)
243243
if err == nil && block != nil {
244-
extraHex := hex.EncodeToString(block.Extra())
245-
fmt.Printf(" Extra Data: 0x%s\n", extraHex)
244+
fmt.Printf(" Extra Data: %s\n", string(block.Extra()))
246245

247246
if cfg.ExpectedExtraData != "" {
248-
expectedHex := hex.EncodeToString([]byte(cfg.ExpectedExtraData))
249-
if extraHex != expectedHex {
247+
if !bytes.Equal(block.Extra(), []byte(cfg.ExpectedExtraData)) {
250248
fmt.Printf(" Extra Data check: failed\n")
251-
return fmt.Errorf("extra data mismatch: expected 0x%s (%q), got 0x%s", expectedHex, cfg.ExpectedExtraData, extraHex)
249+
return fmt.Errorf("extra data mismatch: expected %q", cfg.ExpectedExtraData)
252250
}
253251
fmt.Printf(" Extra Data check: passed\n")
254252
}

0 commit comments

Comments
 (0)