mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
eth/protocols/eth: add decoder method for ReceiptList69
This commit is contained in:
parent
d96f2db8ec
commit
070065c5d9
1 changed files with 15 additions and 0 deletions
|
|
@ -150,6 +150,21 @@ func (rl *ReceiptList69) EncodeIndex(i int, b *bytes.Buffer) {
|
||||||
w.Flush()
|
w.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rl *ReceiptList69) DecodeRLP(s *rlp.Stream) error {
|
||||||
|
if _, err := s.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for i := 0; s.MoreDataInList(); i++ {
|
||||||
|
var item Receipt
|
||||||
|
err := item.DecodeRLP(s)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("receipt %d: %v", err)
|
||||||
|
}
|
||||||
|
rl.items = append(rl.items, item)
|
||||||
|
}
|
||||||
|
return s.ListEnd()
|
||||||
|
}
|
||||||
|
|
||||||
func (rl *ReceiptList69) toStorageReceiptsRLP() rlp.RawValue {
|
func (rl *ReceiptList69) toStorageReceiptsRLP() rlp.RawValue {
|
||||||
var (
|
var (
|
||||||
out bytes.Buffer
|
out bytes.Buffer
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue