realtrace_helpers_test.go raw

   1  package utxostore
   2  
   3  import (
   4  	"encoding/hex"
   5  	"fmt"
   6  	"testing"
   7  
   8  	"git.smesh.lol/btcd-lite/internal/wire"
   9  )
  10  
  11  func mustDecode(t *testing.T, s string) []byte {
  12  	t.Helper()
  13  	b, err := hex.DecodeString(s)
  14  	if err != nil {
  15  		t.Fatal(err)
  16  	}
  17  	return b
  18  }
  19  
  20  // short is an outpoint as its first bytes, for a trace line.
  21  func short(op wire.OutPoint) string { return fmt.Sprintf("%x:%d", op.Hash[:2], op.Index) }
  22