github.com/MetalBlockchain/metalgo@v1.11.9/vms/proposervm/block/header.go (about) 1 // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. 2 // See the file LICENSE for licensing terms. 3 4 package block 5 6 import "github.com/MetalBlockchain/metalgo/ids" 7 8 type Header interface { 9 ChainID() ids.ID 10 ParentID() ids.ID 11 BodyID() ids.ID 12 Bytes() []byte 13 } 14 15 type statelessHeader struct { 16 Chain ids.ID `serialize:"true"` 17 Parent ids.ID `serialize:"true"` 18 Body ids.ID `serialize:"true"` 19 20 bytes []byte 21 } 22 23 func (h *statelessHeader) ChainID() ids.ID { 24 return h.Chain 25 } 26 27 func (h *statelessHeader) ParentID() ids.ID { 28 return h.Parent 29 } 30 31 func (h *statelessHeader) BodyID() ids.ID { 32 return h.Body 33 } 34 35 func (h *statelessHeader) Bytes() []byte { 36 return h.bytes 37 }