Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orderbook: Refactor package structure for simplicity and efficiency #1465

Merged
merged 18 commits into from
May 14, 2024
Prev Previous commit
Next Next commit
glorious: nits
Ryan O'Hara-Reid committed Mar 17, 2024
commit 8cca05f1628451aebac648c14bbd4f9069b0b9d8
2 changes: 1 addition & 1 deletion exchanges/kraken/kraken_test.go
Original file line number Diff line number Diff line change
@@ -2151,7 +2151,7 @@ func TestWsOrderbookMax10Depth(t *testing.T) {
err := k.wsHandleData([]byte(websocketLUNAEUROrderbookUpdates[x]))
// TODO: Known issue with LUNA pairs and big number float precision
// storage and checksum calc. Might need to store raw strings as fields
// in the orderbook.Item struct.
// in the orderbook.Tranche struct.
// Required checksum: 7465000014735432016076747100005084881400000007476000097005027047670474990000293338023886300750000004333333333333375020000152914844934167507000014652990542161752500007370728572000475400000670061645671407546000098022663603417745900007102987806720745800001593557686404000745200003375861179634000743500003156650585902777434000030172726079999999743200006461149653837000743100001042285966000000074300000403660461058200074200000369021657320475740500001674242117790510
if err != nil && x != len(websocketLUNAEUROrderbookUpdates)-1 {
t.Fatal(err)
4 changes: 3 additions & 1 deletion exchanges/orderbook/depth.go
Original file line number Diff line number Diff line change
@@ -50,7 +50,9 @@ type Depth struct {
}

// NewDepth returns a new orderbook depth
func NewDepth(id uuid.UUID) *Depth { return &Depth{_ID: id, mux: service.Mux} }
func NewDepth(id uuid.UUID) *Depth {
return &Depth{_ID: id, mux: service.Mux}
}

// Publish alerts any subscribed routines using a dispatch mux
func (d *Depth) Publish() {