twap: rename constructor

This commit is contained in:
c9s 2024-08-20 18:13:42 +08:00
parent ebaf3a330f
commit a06b63c897
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
3 changed files with 3 additions and 3 deletions

View File

@ -161,7 +161,7 @@ var executeOrderCmd = &cobra.Command{
return fmt.Errorf("market %s not found", symbol)
}
executor := twap.NewStreamExecutor(session.Exchange, symbol, market, side, targetQuantity, sliceQuantity)
executor := twap.NewFixedQuantityExecutor(session.Exchange, symbol, market, side, targetQuantity, sliceQuantity)
if updateInterval > 0 {
executor.SetUpdateInterval(updateInterval)

View File

@ -74,7 +74,7 @@ type FixedQuantityExecutor struct {
done *DoneSignal
}
func NewStreamExecutor(
func NewFixedQuantityExecutor(
exchange types.Exchange,
symbol string,
market types.Market,

View File

@ -170,7 +170,7 @@ func TestNewStreamExecutor(t *testing.T) {
}
mockEx.EXPECT().SubmitOrder(gomock.AssignableToTypeOf(ctx), firstSubmitOrder).Return(&firstOrder, nil)
executor := NewStreamExecutor(mockEx, symbol, market, types.SideTypeBuy, targetQuantity, sliceQuantity)
executor := NewFixedQuantityExecutor(mockEx, symbol, market, types.SideTypeBuy, targetQuantity, sliceQuantity)
executor.SetUpdateInterval(200 * time.Millisecond)
go func() {