From 6c572f6037137c677c2c8c5143723a777a8747c5 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Sun, 10 Nov 2024 14:21:03 +0100 Subject: make message a type; add test --- auction.go | 9 ++++++--- auction_test.go | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 auction_test.go diff --git a/auction.go b/auction.go index 32e9758..4cdbe82 100644 --- a/auction.go +++ b/auction.go @@ -73,10 +73,12 @@ func (d *Description) validate() error { return nil } +type Message []byte + type Auction interface { Start() error Cancel() error - Message(msg []byte) error + Message(msg Message) error } type Result struct { @@ -113,10 +115,11 @@ func (a *auction) Cancel() error { return errors.New("Cancel not implemented") } -// Message is called by the Bidder or Visitor + +// Message is called by the Bidder or Observer // whenever a message came in for the auction via the dashboard // or other means of communication. -func (a *auction) Message(msg []byte) error { +func (a *auction) Message(msg Message) error { return fmt.Errorf("Auction.Received not implemented") } diff --git a/auction_test.go b/auction_test.go new file mode 100644 index 0000000..93d9830 --- /dev/null +++ b/auction_test.go @@ -0,0 +1,8 @@ +package seal + +import "testing" + +func TestAuction(t *testing.T) { + +} + -- cgit v1.2.3