Skip to content

Commit

Permalink
add supported operations for xsd double type (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-korotya authored Aug 2, 2023
1 parent a11e37d commit 53cb84a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pubsignals/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ var allOperations = map[int]struct{}{
circuits.NE: {},
}

var availabelTypesOperations = map[string]map[int]struct{}{
var availableTypesOperations = map[string]map[int]struct{}{
ld.XSDBoolean: {circuits.EQ: {}, circuits.NE: {}},
ld.XSDInteger: allOperations,
ld.XSDInteger + "nonNegativeInteger": allOperations,
ld.XSDInteger + "positiveInteger": allOperations,
ld.XSDString: {circuits.EQ: {}, circuits.NE: {}, circuits.IN: {}, circuits.NIN: {}},
ld.XSDNS + "dateTime": allOperations,
ld.XSDDouble: {circuits.EQ: {}, circuits.NE: {}, circuits.IN: {}, circuits.NIN: {}},
}

// PathToSubjectType path to description of subject type.
Expand Down Expand Up @@ -454,10 +455,10 @@ func isValidOperation(typ string, op int) bool {
return true
}

ops, ok := availabelTypesOperations[typ]
ops, ok := availableTypesOperations[typ]
if !ok {
// by default all unknown types will be considered as string
ops = availabelTypesOperations[ld.XSDString]
ops = availableTypesOperations[ld.XSDString]
_, ok = ops[op]
return ok
}
Expand Down

0 comments on commit 53cb84a

Please sign in to comment.