Add support for get/set/rm of exchange pairs via gRPC

This commit is contained in:
Adrian Gallagher
2019-09-06 11:47:58 +10:00
parent c041c990a9
commit 0fcf867697
13 changed files with 1320 additions and 287 deletions

View File

@@ -56,13 +56,13 @@ func (a Items) Strings() []string {
// Contains returns whether or not the supplied asset exists
// in the list of Items
func (a Items) Contains(asset Item) bool {
if !IsValid(asset) {
func (a Items) Contains(i Item) bool {
if !IsValid(i) {
return false
}
for x := range a {
if a[x] == asset {
if strings.EqualFold(a[x].String(), i.String()) {
return true
}
}

View File

@@ -36,6 +36,10 @@ func TestContains(t *testing.T) {
if a.Contains(Binary) {
t.Fatal("Test failed - TestContains returned an unexpected result")
}
if !a.Contains("SpOt") {
t.Error("Test failed - TestContains returned an unexpected result")
}
}
func TestJoinToString(t *testing.T) {