github.com/MetalBlockchain/metalgo@v1.11.9/vms/platformvm/block/executor/options_test.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package executor
     5  
     6  import (
     7  	"fmt"
     8  	"testing"
     9  
    10  	"github.com/stretchr/testify/require"
    11  
    12  	"github.com/MetalBlockchain/metalgo/snow/consensus/snowman"
    13  	"github.com/MetalBlockchain/metalgo/vms/platformvm/block"
    14  )
    15  
    16  func TestOptionsUnexpectedBlockType(t *testing.T) {
    17  	tests := []block.Block{
    18  		&block.BanffAbortBlock{},
    19  		&block.BanffCommitBlock{},
    20  		&block.BanffStandardBlock{},
    21  		&block.ApricotAbortBlock{},
    22  		&block.ApricotCommitBlock{},
    23  		&block.ApricotStandardBlock{},
    24  		&block.ApricotAtomicBlock{},
    25  	}
    26  
    27  	for _, blk := range tests {
    28  		t.Run(fmt.Sprintf("%T", blk), func(t *testing.T) {
    29  			err := blk.Visit(&options{})
    30  			require.ErrorIs(t, err, snowman.ErrNotOracle)
    31  		})
    32  	}
    33  }