github.com/MetalBlockchain/metalgo@v1.11.9/snow/consensus/snowstorm/test_tx.go (about) 1 // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. 2 // See the file LICENSE for licensing terms. 3 4 package snowstorm 5 6 import ( 7 "context" 8 9 "github.com/MetalBlockchain/metalgo/ids" 10 "github.com/MetalBlockchain/metalgo/snow/choices" 11 "github.com/MetalBlockchain/metalgo/utils/set" 12 ) 13 14 var _ Tx = (*TestTx)(nil) 15 16 // TestTx is a useful test tx 17 type TestTx struct { 18 choices.TestDecidable 19 20 DependenciesV set.Set[ids.ID] 21 DependenciesErrV error 22 VerifyV error 23 BytesV []byte 24 } 25 26 func (t *TestTx) MissingDependencies() (set.Set[ids.ID], error) { 27 return t.DependenciesV, t.DependenciesErrV 28 } 29 30 func (t *TestTx) Verify(context.Context) error { 31 return t.VerifyV 32 } 33 34 func (t *TestTx) Bytes() []byte { 35 return t.BytesV 36 }