package claim import ( "encoding/hex" "encoding/json" "errors" "fmt" "net/http" "net/http/httptest" "strings" "sync" "testing" "github.com/decred/dcrd/dcrec/secp256k1/v4" "github.com/elnosh/gonuts/cashu" "github.com/elnosh/gonuts/cashu/nuts/nut03" "github.com/elnosh/gonuts/crypto" ) // stubMint is a minimal mint with real BDHKE and NUT-12 DLEQ proofs. type stubMint struct { srv *httptest.Server keys map[uint64]*secp256k1.PrivateKey feePpk uint64 noDLEQ bool badDLEQ bool reject bool garbage bool mu sync.Mutex spent map[string]bool } const stubKeysetID = "00aabbccddeeff00" func newStubMint(t *testing.T) *stubMint { t.Helper() m := &stubMint{keys: map[uint64]*secp256k1.PrivateKey{}, spent: map[string]bool{}} for i := 0; i < 16; i++ { k, err := secp256k1.GeneratePrivateKey() if err != nil { t.Fatal(err) } m.keys[1<