github.com/MetalBlockchain/metalgo@v1.11.9/vms/proposervm/state/state_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 state 5 6 import ( 7 "testing" 8 9 "github.com/prometheus/client_golang/prometheus" 10 "github.com/stretchr/testify/require" 11 12 "github.com/MetalBlockchain/metalgo/database/memdb" 13 "github.com/MetalBlockchain/metalgo/database/versiondb" 14 ) 15 16 func TestState(t *testing.T) { 17 a := require.New(t) 18 19 db := memdb.New() 20 vdb := versiondb.New(db) 21 s := New(vdb) 22 23 testBlockState(a, s) 24 testChainState(a, s) 25 } 26 27 func TestMeteredState(t *testing.T) { 28 a := require.New(t) 29 30 db := memdb.New() 31 vdb := versiondb.New(db) 32 s, err := NewMetered(vdb, "", prometheus.NewRegistry()) 33 a.NoError(err) 34 35 testBlockState(a, s) 36 testChainState(a, s) 37 }