Check for `node_id` in Splinter service
Adds a check while parsing a Splinter service returned by Splinter's
REST API for the `node_id` field, as a service apart of a circuit has
this field rather than the `allowed_nodes` field as in the circuit
proposal.
@@ -66,7 +66,11 @@ function Service(jsonSource) {
if (jsonSource) {
this.serviceId = jsonSource.service_id;
this.serviceType = jsonSource.service_type;
+ if (jsonSource.node_id) {
+ this.allowedNodes = [jsonSource.node_id];
+ } else {
this.allowedNodes = jsonSource.allowed_nodes;
+ }
this.arguments = argsToObject(jsonSource.arguments);
} else {
this.serviceId = '';
