github.com/MetalBlockchain/metalgo@v1.11.9/snow/engine/avalanche/vertex/storage.go (about) 1 // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. 2 // See the file LICENSE for licensing terms. 3 4 package vertex 5 6 import ( 7 "context" 8 9 "github.com/MetalBlockchain/metalgo/ids" 10 "github.com/MetalBlockchain/metalgo/snow/consensus/avalanche" 11 ) 12 13 // Storage defines the persistent storage that is required by the consensus 14 // engine. 15 type Storage interface { 16 // Get a vertex by its hash from storage. 17 GetVtx(ctx context.Context, vtxID ids.ID) (avalanche.Vertex, error) 18 // Edge returns a list of accepted vertex IDs with no accepted children. 19 Edge(ctx context.Context) (vtxIDs []ids.ID) 20 // Returns "true" if accepted frontier ("Edge") is stop vertex. 21 StopVertexAccepted(ctx context.Context) (bool, error) 22 }