~ knotless Search/
↑↓ move↵ open⇧↵ all results

socialweb.computer/socialweb-computer-kcp

socialweb.computer: a compute market on atproto (kcp)

1 collaborator
0
0
16 lines · 730 B Raw History
package requester

import "testing"

// Unservable is judged on a round that excluded nobody: a bidder that declined an accept (full when it did) may take the next round's RFP.
func TestUnservableByIgnoresRoundsThatExcludedABidder(t *testing.T) {
	bidders := []Bidder{{DID: "did:b", Endpoint: "https://b"}}
	r := &contractRunner{bidderDeclines: map[string]BidderDeclined{"did:b": {DID: "did:b", Kind: declineUnservable, Reason: "no"}}}
	if got := r.unservableBy(bidders); got == "" {
		t.Fatal("every bidder asked declined unservable: fail fast")
	}
	r.declined = []string{"did:a"}
	if got := r.unservableBy(bidders); got != "" {
		t.Fatalf("a bidder declined an accept (it may bid next round), still failing fast: %q", got)
	}
}