We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21b1936 commit 68c7058Copy full SHA for 68c7058
core/stateless/encoding.go
@@ -17,6 +17,7 @@
17
package stateless
18
19
import (
20
+ "errors"
21
"io"
22
23
"github.com/ethereum/go-ethereum/common/hexutil"
@@ -42,6 +43,9 @@ func (w *Witness) ToExtWitness() *ExtWitness {
42
43
44
// FromExtWitness converts the consensus witness format into our internal one.
45
func (w *Witness) FromExtWitness(ext *ExtWitness) error {
46
+ if len(ext.Headers) == 0 {
47
+ return errors.New("witness must contain at least one header")
48
+ }
49
w.Headers = ext.Headers
50
51
w.Codes = make(map[string]struct{}, len(ext.Codes))
0 commit comments