mirror of
https://github.com/seigler/govobject-proposal
synced 2025-07-26 22:36:09 +00:00
save progress on getting submit proposal command and progressing UI confirmations
This commit is contained in:
parent
90ad462be0
commit
41b688dda1
2 changed files with 17 additions and 2 deletions
|
@ -100,6 +100,8 @@
|
|||
|
||||
$('#feeTxid').on('input', function() {
|
||||
|
||||
var proposal = new ProposalGenerator(gov);
|
||||
|
||||
var transaction = $(this).val();
|
||||
var txListener = new TXListener(socket, provider, transaction);
|
||||
|
||||
|
@ -121,9 +123,15 @@
|
|||
txListener.confirmations = res.confirmations;
|
||||
|
||||
txListener.initSocket(function() {
|
||||
console.log("callback called, step 4");
|
||||
$('#walletCommandsSubmit').removeClass('hidden');
|
||||
document.getElementById('step_four').click();
|
||||
document.getElementsByClassName('progress-bar')[0].style.width = "100%";
|
||||
document.getElementsByClassName('progress-bar')[0].innerText = "Proposal ready for submission";
|
||||
|
||||
var submitCommand = "gobject submit " + $('#parentHash').val() + " " + $('#revision').val() + " " + $('#time').val() + " " + proposal.gov.serialize() + " " + $(this).val();
|
||||
console.log(submitCommand);
|
||||
$('textarea#submitProposal').val(submitCommand);
|
||||
}); // callback issued after tx confirmations >= 6
|
||||
|
||||
}
|
||||
|
|
|
@ -20,8 +20,14 @@ TXListener.prototype.initSocket = function(cb) {
|
|||
|
||||
if (err) console.log("error fetching block: " + data);
|
||||
self.confirmations = (res.height - self.blockheight) + 1; // compare blockHeight against transaction blockHeight
|
||||
var confirmation_count = (res.height - self.confirmations) + 1;
|
||||
console.log("res: ", res);
|
||||
console.log("self: ", self);
|
||||
console.log(confirmation_count);
|
||||
|
||||
if (self.confirmations >= 6) cb();
|
||||
if (confirmation_count >= 6) {
|
||||
cb();
|
||||
};
|
||||
$("#progressbar").progressbar({value: ((100 / 6) * self.confirmations)});
|
||||
|
||||
console.log('confirmations: ' + self.confirmations);
|
||||
|
@ -41,6 +47,7 @@ TXListener.prototype.getTx = function(cb) {
|
|||
format: "json"
|
||||
}
|
||||
};
|
||||
console.log(opts);
|
||||
|
||||
this._fetch(opts, cb);
|
||||
};
|
||||
|
@ -83,4 +90,4 @@ TXListener.prototype._fetch = function(opts,cb) {
|
|||
} else {
|
||||
cb('missing parameter',null);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue