mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core/types: fix deposit request encoding
This commit is contained in:
parent
8735cf3649
commit
a2abb4b3a3
2 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue