diff options
Diffstat (limited to 'bidder/auction.go')
-rw-r--r-- | bidder/auction.go | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/bidder/auction.go b/bidder/auction.go deleted file mode 100644 index a22f005..0000000 --- a/bidder/auction.go +++ /dev/null @@ -1,67 +0,0 @@ -package bidder - -import ( - "fmt" - "log" - "os" - - "kesim.org/seal" - "kesim.org/seal/nizk/commit" -) - -// Auction is the simple interface for the engine -type Auction interface { - Join(bidder Bidder) // A bidder calls this to join the auction - GotMessage(msg []byte, sig []byte) error // A bidder uses this method to publish a message -} - -// Bidder is the interface that the Auction engine uses to communicate -type Bidder interface { - Commitment() *commit.Commitment - Start(map[string]*commit.Commitment) - Result() - Receive(msg []byte) error -} - -type auction struct { - description *seal.Description - - bidder Bidder - - log func(string, ...any) - verbose func(string, ...any) - debug func(string, ...any) -} - -func nullf(string, ...any) {} - -func NewAuction(description *seal.Description, options ...Option) (a *auction, e error) { - if description.BitLength > 63 { - return nil, fmt.Errorf("Invalid BitLength in description: %d", description.BitLength) - } - - logger := log.New(os.Stdout, "[seal::client] ", log.LstdFlags) - - a = &auction{ - description: description, - log: logger.Printf, - verbose: nullf, - debug: nullf, - } - - for _, opt := range options { - opt(a) - } - - return a, nil -} - -func (a *auction) Join(bidder Bidder) { - a.bidder = bidder -} - -// Received is called by the bidder whenever a message came in for the auction via the dashboard -// or other means of communication. -func (a *auction) Received(msg []byte) error { - return fmt.Errorf("Auction.Received not implemented") -}
\ No newline at end of file |