aboutsummaryrefslogtreecommitdiff
path: root/bidder/auction.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@kesim.org>2024-11-10 11:53:19 +0100
committerÖzgür Kesim <oec@kesim.org>2024-11-10 11:53:19 +0100
commitf98e43234a3b7a9823ac9b9e68c7c595c10ebe7d (patch)
tree2e1e5dac6c3a3ae4465baeb9179d0718c5cd8b28 /bidder/auction.go
parent2100500f1a0a8534a5d6f900b4e35ad9a09aa339 (diff)
start refactor
Diffstat (limited to 'bidder/auction.go')
-rw-r--r--bidder/auction.go67
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