Mise à jour de GitLab prévue ce dimanche 25 octobre 2020 à partir de 9h00 CEST | GitLab upgrade planned this Sunday 25rd of October 2020 from 9:00 AM CEST

Commit c2b1b66c authored by Éloïs's avatar Éloïs

[fix] add resetWot and write to each modifications

parent 03193931
Pipeline #1956 passed with stage
in 2 minutes and 29 seconds
test.bin
native/target
native/index.node
native/artifacts.json
......
......@@ -90,25 +90,44 @@ const WotB = {
return addon.set_max_links(this.instanceID, maxCert);
},
addNode: function() {
return addon.add_node(this.instanceID);
var result = addon.add_node(this.instanceID);
if (this.filePath.length > 0) {
this.write();
}
return result;
},
removeNode: function() {
return addon.rem_node(this.instanceID);
var result = addon.rem_node(this.instanceID);
if (this.filePath.length > 0) {
this.write();
}
return result;
},
setEnabled: function(is_enabled, nodeId) {
return addon.set_enabled(this.instanceID, is_enabled, nodeId);
var result = addon.set_enabled(this.instanceID, is_enabled, nodeId);
if (this.filePath.length > 0) {
this.write();
}
return result;
},
addLink: function(source, target) {
return addon.add_link(this.instanceID, source, target);
var result = addon.add_link(this.instanceID, source, target);
if (this.filePath.length > 0) {
this.write();
}
return result;
},
removeLink: function(source, target) {
return addon.rem_link(this.instanceID, source, target);
var result = addon.rem_link(this.instanceID, source, target);
if (this.filePath.length > 0) {
this.write();
}
return result;
},
isOutdistanced: function(node, sentry_requirement, step_max, x_percent) {
......@@ -136,5 +155,14 @@ const WotB = {
clear: function() {
return addon.remove_wot(this.instanceID);
},
resetWoT: function() {
var sigStock = addon.getMaxCert(this.instanceID);
addon.remove_wot(this.instanceID);
this.instanceID = addon.new_memory_instance(sigStock);
if (filePath.length > 0) {
this.write();
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment