github.com/MetalBlockchain/metalgo@v1.11.9/vms/proposervm/summary/codec.go (about) 1 // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. 2 // See the file LICENSE for licensing terms. 3 4 package summary 5 6 import ( 7 "errors" 8 "math" 9 10 "github.com/MetalBlockchain/metalgo/codec" 11 "github.com/MetalBlockchain/metalgo/codec/linearcodec" 12 ) 13 14 const CodecVersion = 0 15 16 var ( 17 Codec codec.Manager 18 19 errWrongCodecVersion = errors.New("wrong codec version") 20 ) 21 22 func init() { 23 lc := linearcodec.NewDefault() 24 Codec = codec.NewManager(math.MaxInt32) 25 if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { 26 panic(err) 27 } 28 }