diff options
author | Özgür Kesim <oec@kesim.org> | 2024-11-08 11:24:50 +0100 |
---|---|---|
committer | Özgür Kesim <oec@kesim.org> | 2024-11-08 11:24:50 +0100 |
commit | 2100500f1a0a8534a5d6f900b4e35ad9a09aa339 (patch) | |
tree | bbecf21b3ab957ba1949ffb1a0f8b0fd08de7068 /bidder/auction.go | |
parent | 15283cd1bf926254fad09ae04b1e04e381966c06 (diff) |
moving declarations around
Diffstat (limited to 'bidder/auction.go')
-rw-r--r-- | bidder/auction.go | 19 |
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 } |