Skip to content

Commit

Permalink
add supported operations for xsd double type
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-korotya committed Aug 1, 2023
1 parent 0200e3b commit 871913a
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 @@ -29,13 +29,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 @@ -458,10 +459,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 871913a

Please sign in to comment.