Tx rejection improvement

This commit is contained in:
viktor 2017-08-11 20:05:08 +03:00
parent efc9ecf21b
commit 2800039c94
8 changed files with 46 additions and 26 deletions

View File

@ -1,5 +0,0 @@
<div class="container">
<div class="waitingContainer">
<h1>Adding notary's data to Oracles contract...</h1>
</div>
</div>

View File

@ -526,7 +526,9 @@ function startDapp(web3, isOraclesNetwork) {
//Geeneration of all 3 addresses callback
function addressesGeneratedCallBack(contractAddress, keys, address, cb) {
$('.content').load("./add-validator-data.html");
$(".content").hide();
$('.waiting-container').empty();
$('.waiting-container').append("<h2>Adding notary's data to Oracles contract...</h2>");
var validatorViewObj = {
miningKey: "0x" + keys.miningKey.miningKeyObject.address,
fullName: $("#full-name").val(),
@ -545,12 +547,15 @@ function startDapp(web3, isOraclesNetwork) {
function(txHash, err) {
if (err) {
$(".loading-container").hide();
console.log(err.message);
$('.waiting-container').hide();
$(".content").show();
if (err.type != "REQUEST_REJECTED") swal("Error", "Error in addresses addition to contract", "error");
return;
}
$('.content').load("./create-keys.html");
$(".content").hide();
$('.waiting-container').empty();
$('.waiting-container').append("<h2>Adding production keys to Oracles contract...</h2>");
//activate generated production keys
createKeys(web3,
"createKeys(address,address,address)",
@ -560,6 +565,8 @@ function startDapp(web3, isOraclesNetwork) {
function(res, err) {
if (err) {
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
console.log(err.message);
if (err.type != "REQUEST_REJECTED") swal("Error", "Error in addresses addition to contract", "error");
return;
@ -574,9 +581,13 @@ function startDapp(web3, isOraclesNetwork) {
//Production keys addition to contract callback
function addressesAddedToContractCallBack(err, address, keys) {
$('.content').load("./transfering-ether.html");
$(".content").hide();
$('.waiting-container').empty();
$('.waiting-container').append("<h2>Transfering ether from initial key to payout key...</h2>");
if (err) {
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
swal("Error", err.message, "error");
return;
}
@ -603,6 +614,8 @@ function startDapp(web3, isOraclesNetwork) {
if (err) {
console.log(err);
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
return;
}
@ -627,9 +640,13 @@ function startDapp(web3, isOraclesNetwork) {
if (err) {
console.log(err);
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
return;
}
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
swal("Sucess", "Keys are created", "success");
$('.content').empty();
$('.content').load("./keys.html", function() {

View File

@ -134,7 +134,9 @@ function startDapp(web3, isOraclesNetwork) {
//Geeneration of all 3 addresses callback
function addressesGeneratedCallBack(contractAddress, keys, address, cb) {
$('.content').load("./add-validator-data.html");
$(".content").hide();
$('.waiting-container').empty();
$('.waiting-container').append("<h2>Adding notary's data to Oracles contract...</h2>");
var validatorViewObj = {
miningKey: "0x" + keys.miningKey.miningKeyObject.address,
fullName: $("#full-name").val(),
@ -153,12 +155,15 @@ function startDapp(web3, isOraclesNetwork) {
function(txHash, err) {
if (err) {
$(".loading-container").hide();
console.log(err.message);
$('.waiting-container').hide();
$(".content").show();
if (err.type != "REQUEST_REJECTED") swal("Error", "Error in addresses addition to contract", "error");
return;
}
$('.content').load("./create-keys.html");
$(".content").hide();
$('.waiting-container').empty();
$('.waiting-container').append("<h2>Adding production keys to Oracles contract...</h2>");
//activate generated production keys
createKeys(web3,
"createKeys(address,address,address)",
@ -168,6 +173,8 @@ function startDapp(web3, isOraclesNetwork) {
function(res, err) {
if (err) {
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
console.log(err.message);
if (err.type != "REQUEST_REJECTED") swal("Error", "Error in addresses addition to contract", "error");
return;
@ -182,9 +189,13 @@ function startDapp(web3, isOraclesNetwork) {
//Production keys addition to contract callback
function addressesAddedToContractCallBack(err, address, keys) {
$('.content').load("./transfering-ether.html");
$(".content").hide();
$('.waiting-container').empty();
$('.waiting-container').append("<h2>Transfering ether from initial key to payout key...</h2>");
if (err) {
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
swal("Error", err.message, "error");
return;
}
@ -211,6 +222,8 @@ function startDapp(web3, isOraclesNetwork) {
if (err) {
console.log(err);
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
return;
}
@ -235,9 +248,13 @@ function startDapp(web3, isOraclesNetwork) {
if (err) {
console.log(err);
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
return;
}
$(".loading-container").hide();
$('.waiting-container').hide();
$(".content").show();
swal("Sucess", "Keys are created", "success");
$('.content').empty();
$('.content').load("./keys.html", function() {

File diff suppressed because one or more lines are too long

View File

@ -78,7 +78,7 @@
}
}
.waitingContainer {
.waiting-container {
text-align: center;
text-transform: uppercase;
}

View File

@ -1,5 +0,0 @@
<div class="container">
<div class="waitingContainer">
<h1>Adding production keys to Oracles contract...</h1>
</div>
</div>

View File

@ -55,6 +55,7 @@
<input type="file" id="initialKeySource"/>
</div>
</section>
<div class="waiting-container"></div>
<div class="loading-container">
<div class="loading">
<div class="loading-i"></div>
@ -77,7 +78,7 @@
</div>
</footer>
<script src="./assets/javascripts/sweetalert2.min.js" type="text/javascript"></script>
<script src="./assets/javascripts/application.js?v=1.29" type="text/javascript"></script>
<script src="./assets/javascripts/application.js?v=1.30" type="text/javascript"></script>
<script src="./assets/javascripts/keythereum.min.js" type="text/javascript"></script>
</body>
</html>

View File

@ -1,5 +0,0 @@
<div class="container">
<div class="waitingContainer">
<h1>Transfering ether from initial key to payout key...</h1>
</div>
</div>