aboutsummaryrefslogtreecommitdiff
path: root/bidder/auction.go
diff options
context:
space:
mode:
Diffstat (limited to 'bidder/auction.go')
-rw-r--r--bidder/auction.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/bidder/auction.go b/bidder/auction.go
index 5331136..a22f005 100644
--- a/bidder/auction.go
+++ b/bidder/auction.go
@@ -6,12 +6,27 @@ import (
"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 seal.Bidder
+ bidder Bidder
log func(string, ...any)
verbose func(string, ...any)
@@ -41,7 +56,7 @@ func NewAuction(description *seal.Description, options ...Option) (a *auction, e
return a, nil
}
-func (a *auction) Join(bidder seal.Bidder) {
+func (a *auction) Join(bidder Bidder) {
a.bidder = bidder
}