github.com/MetalBlockchain/metalgo@v1.11.9/snow/consensus/snowman/oracle_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 snowman 5 6 import ( 7 "context" 8 "errors" 9 ) 10 11 var ErrNotOracle = errors.New("block isn't an oracle") 12 13 // OracleBlock is a block that only has two valid children. The children should 14 // be returned in preferential order. 15 // 16 // This ordering does not need to be deterministically created from the chain 17 // state. 18 type OracleBlock interface { 19 // Options returns the possible children of this block in the order this 20 // validator prefers the blocks. 21 Options(context.Context) ([2]Block, error) 22 }