diff --git a/core/types/deposit.go b/core/types/deposit.go index 42f90b70e6..c97f7a4b47 100644 --- a/core/types/deposit.go +++ b/core/types/deposit.go @@ -32,7 +32,7 @@ func DepositLogToRequest(data []byte) ([]byte, error) { } var outputRequest = make([]byte, depositRequestSize) - outputRequest[0] = depositRequestSize + outputRequest[0] = depositRequestType const ( pubkeyOffset = 1 withdrawalCredOffset = pubkeyOffset + 48 diff --git a/core/types/deposit_test.go b/core/types/deposit_test.go index 3d1fc8edd4..5ffad9833a 100644 --- a/core/types/deposit_test.go +++ b/core/types/deposit_test.go @@ -86,6 +86,9 @@ func FuzzUnpackIntoDeposit(f *testing.F) { if err != nil { t.Errorf("error unpacking deposit: %v", err) } + if len(got) != depositRequestSize { + t.Errorf("wrong output size: %d, want %d", len(got), depositRequestSize) + } if !bytes.Equal(enc, got) { t.Errorf("roundtrip failed: want %x, got %x", enc, got) }