Revert "Prettified"

This reverts commit bca8cb9d4b.
This commit is contained in:
mbhandary
2020-04-16 14:17:20 -04:00
parent bca8cb9d4b
commit 103b3fd3f6

View File

@@ -24,7 +24,7 @@ function makeLogEntry(text, raw) {
.text(text + " ") .text(text + " ")
.appendTo("#log"); .appendTo("#log");
} }
log.resolve = function (text) { log.resolve = function(text) {
return $("<span></span>") return $("<span></span>")
.html(text) .html(text)
.appendTo(log); .appendTo(log);
@@ -100,8 +100,8 @@ async function parse_xrpl_toml(data, public_key_hex, public_key, message) {
function display_manifest(man) { function display_manifest(man) {
for (x in man) { for (x in man){
log = makeLogEntry(x + ": " + man[x]); log = makeLogEntry(x + ": " +man[x]);
} }
} }
@@ -122,7 +122,11 @@ function parse_manifest() {
return; return;
} }
let seq = man["Sequence"];
let seq = man ["Sequence"];
let public_key_hex = man["PublicKey"]; let public_key_hex = man["PublicKey"];
let buff_pub = new Buffer(public_key_hex, "hex").toJSON().data; let buff_pub = new Buffer(public_key_hex, "hex").toJSON().data;
@@ -132,26 +136,25 @@ function parse_manifest() {
let buff_eph_pub = new Buffer(ephemeral_public_key_hex, "hex").toJSON().data; let buff_eph_pub = new Buffer(ephemeral_public_key_hex, "hex").toJSON().data;
let ephemeral_public_key = addressCodec.encodeNodePublic(buff_eph_pub); let ephemeral_public_key = addressCodec.encodeNodePublic(buff_eph_pub);
try { try {
var domain = hex_to_ascii(man["Domain"]); var domain = hex_to_ascii(man["Domain"]);
} catch { } catch {
makeLogEntry("Domain not found in manifest").addClass(CLASS_BAD); makeLogEntry("Domain not found in manifest").addClass(CLASS_BAD);
display_manifest({ display_manifest({"Sequence":seq,
"Sequence": seq,
"Master Public Key": public_key, "Master Public Key": public_key,
"Ephemeral Public Key": ephemeral_public_key "Ephemeral Public Key":ephemeral_public_key});
});
return; return;
} }
display_manifest({ display_manifest({"Sequence":seq,
"Sequence": seq, "Domain":domain,
"Domain": domain,
"Master Public Key": public_key, "Master Public Key": public_key,
"Ephemeral Public Key": ephemeral_public_key "Ephemeral Public Key":ephemeral_public_key})
})
@@ -164,11 +167,11 @@ function parse_manifest() {
$.ajax({ $.ajax({
url: url, url: url,
dataType: "text", dataType: "text",
success: function (data) { success: function(data) {
log.resolve("FOUND").addClass(CLASS_GOOD); log.resolve("FOUND").addClass(CLASS_GOOD);
parse_xrpl_toml(data, public_key_hex, public_key, message); parse_xrpl_toml(data, public_key_hex, public_key, message);
}, },
error: function (jqxhr, status, error) { error: function(jqxhr, status, error) {
switch (status) { switch (status) {
case "timeout": case "timeout":
err = "TIMEOUT"; err = "TIMEOUT";
@@ -226,3 +229,4 @@ function handle_submit(event) {
$(document).ready(() => { $(document).ready(() => {
$("#manifest-entry").submit(handle_submit); $("#manifest-entry").submit(handle_submit);
}); });