diff options
Diffstat (limited to 'bidder/auction.go')
-rw-r--r-- | bidder/auction.go | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/bidder/auction.go b/bidder/auction.go index 7991504..15eca78 100644 --- a/bidder/auction.go +++ b/bidder/auction.go @@ -8,7 +8,7 @@ import ( "kesim.org/seal" ) -type Auction struct { +type auction struct { description *seal.Description bidder seal.Bidder @@ -20,14 +20,14 @@ type Auction struct { func nullf(string, ...any) {} -func NewAuction(description *seal.Description, options ...Option) (auction *Auction, e error) { +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) - auction = &Auction{ + a = &auction{ description: description, log: logger.Printf, verbose: nullf, @@ -35,26 +35,18 @@ func NewAuction(description *seal.Description, options ...Option) (auction *Auct } for _, opt := range options { - opt(auction) + opt(a) } - return auction, nil + return a, nil } -func (a *Auction) Join(price uint64) error { - bidder, e := newBid(price, a.description.BitLength) - if e != nil { - return e - } - - a.debug("created bid: %#v\n", bidder.(*bid)) - +func (a *auction) Join(bidder seal.Bidder) { a.bidder = bidder - return nil } // Received is called by the consumer whenever a message came in for the auction via the dashboard // or other means of communication. -func (a *Auction) Received(msg []byte) error { +func (a *auction) Received(msg []byte) error { return fmt.Errorf("Auction.Received not implemented") }
\ No newline at end of file |