github.com/MetalBlockchain/metalgo@v1.11.9/vms/avm/block/block.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 ( 7 "time" 8 9 "github.com/MetalBlockchain/metalgo/codec" 10 "github.com/MetalBlockchain/metalgo/ids" 11 "github.com/MetalBlockchain/metalgo/snow" 12 "github.com/MetalBlockchain/metalgo/vms/avm/txs" 13 ) 14 15 // Block defines the common stateless interface for all blocks 16 type Block interface { 17 snow.ContextInitializable 18 19 ID() ids.ID 20 Parent() ids.ID 21 Height() uint64 22 // Timestamp that this block was created at 23 Timestamp() time.Time 24 MerkleRoot() ids.ID 25 Bytes() []byte 26 27 // Txs returns the transactions contained in the block 28 Txs() []*txs.Tx 29 30 // note: initialize does not assume that the transactions are initialized, 31 // and initializes them itself. 32 initialize(bytes []byte, cm codec.Manager) error 33 }