This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
volume filter should allow specifying multiple markets for aggregate …
…limits (closes #348) (#351) * 1 - change marketID in volumeFilter to marketIDs * 2 - parse market_ids from volume filter config string * 3 - fix comment in sample_trader referencing filterMode * 4 - add example of market_ids to volumeFilter in sample_trader * 5 - add missing params to Stringer method of VolumeFilterConfig * 6 - specify case when we don't have any market_ids * 7 - fix typo in sample_trader comment * 8 - fixed typo: markets_ids -> market_ids * 9 - better parseMarketIdsArray function * 10 - fix sql query for daily values with IN operator * 11 - add single quote to marketIDs in sql query * Revert "11 - add single quote to marketIDs in sql query" This reverts commit 8e77b78. * 12 - use a query template to fill in the IN clause * 13 - fix TestParseMarketIdsArray * 14 - reword explanation of filter in sample_trader.cfg
- Loading branch information
1 parent
4c19915
commit 391d3fb
Showing
5 changed files
with
144 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package plugins | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestParseMarketIdsArray(t *testing.T) { | ||
testCases := []struct { | ||
marketIdsArrayString string | ||
want []string | ||
}{ | ||
{ | ||
marketIdsArrayString: "[abcde1234Z,01234gFHij]", | ||
want: []string{"abcde1234Z", "01234gFHij"}, | ||
}, { | ||
marketIdsArrayString: "[abcde1234Z, 01234gFHij]", | ||
want: []string{"abcde1234Z", "01234gFHij"}, | ||
}, { | ||
marketIdsArrayString: "[abcde1234Z]", | ||
want: []string{"abcde1234Z"}, | ||
}, | ||
} | ||
|
||
for _, kase := range testCases { | ||
t.Run(kase.marketIdsArrayString, func(t *testing.T) { | ||
output, e := parseMarketIdsArray(kase.marketIdsArrayString) | ||
if !assert.NoError(t, e) { | ||
return | ||
} | ||
|
||
assert.Equal(t, kase.want, output) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters