github.com/MetalBlockchain/metalgo@v1.11.9/chains/atomic/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 atomic 5 6 import ( 7 "math" 8 9 "github.com/MetalBlockchain/metalgo/codec" 10 "github.com/MetalBlockchain/metalgo/codec/linearcodec" 11 ) 12 13 const CodecVersion = 0 14 15 // Codec is used to marshal and unmarshal dbElements and chain IDs. 16 var Codec codec.Manager 17 18 func init() { 19 lc := linearcodec.NewDefault() 20 Codec = codec.NewManager(math.MaxInt) 21 if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { 22 panic(err) 23 } 24 }