Browse Source

update the number of verification during the deployment process

cl-refactor
yann300 10 years ago
parent
commit
eae8de56d7
  1. 25
      mix/qml/BlockChain.qml
  2. 15
      mix/qml/DeployContractStep.qml
  3. 2
      mix/qml/DeploymentDialog.qml
  4. 12
      mix/qml/DeploymentWorker.qml
  5. 8
      mix/qml/RegisteringStep.qml

25
mix/qml/BlockChain.qml

@ -395,19 +395,22 @@ ColumnLayout {
text: qsTr("Add Tx") text: qsTr("Add Tx")
onClicked: onClicked:
{ {
var lastBlock = model.blocks[model.blocks.length - 1]; if (model && model.blocks)
if (lastBlock.status === "mined")
{ {
var newblock = projectModel.stateListModel.createEmptyBlock() var lastBlock = model.blocks[model.blocks.length - 1];
blockModel.appendBlock(newblock) if (lastBlock.status === "mined")
model.blocks.push(newblock); {
} var newblock = projectModel.stateListModel.createEmptyBlock()
blockModel.appendBlock(newblock)
model.blocks.push(newblock);
}
var item = TransactionHelper.defaultTransaction() var item = TransactionHelper.defaultTransaction()
transactionDialog.stateAccounts = model.accounts transactionDialog.stateAccounts = model.accounts
transactionDialog.execute = true transactionDialog.execute = true
transactionDialog.editMode = false transactionDialog.editMode = false
transactionDialog.open(model.blocks[model.blocks.length - 1].transactions.length, model.blocks.length - 1, item) transactionDialog.open(model.blocks[model.blocks.length - 1].transactions.length, model.blocks.length - 1, item)
}
} }
width: 100 width: 100
height: 30 height: 30

15
mix/qml/DeployContractStep.qml

@ -36,6 +36,19 @@ Rectangle {
accountsList.currentIndex = 0 accountsList.currentIndex = 0
} }
verifyDeployedContract()
deployedAddresses.refresh()
worker.renewCtx()
worker.pooler.onTriggered.connect(function() {
if (root.visible)
verifyDeployedContract();
})
}
function verifyDeployedContract()
{
if (projectModel.deployBlockNumber !== -1) if (projectModel.deployBlockNumber !== -1)
{ {
worker.verifyHashes(projectModel.deploymentTrHashes, function (bn, trLost) worker.verifyHashes(projectModel.deploymentTrHashes, function (bn, trLost)
@ -43,8 +56,6 @@ Rectangle {
root.updateVerification(bn, trLost) root.updateVerification(bn, trLost)
}); });
} }
deployedAddresses.refresh()
worker.renewCtx()
} }
function updateVerification(blockNumber, trLost) function updateVerification(blockNumber, trLost)

2
mix/qml/DeploymentDialog.qml

@ -27,6 +27,7 @@ Dialog {
function close() function close()
{ {
visible = false; visible = false;
worker.pooler.running = false
} }
function open() function open()
@ -36,6 +37,7 @@ Dialog {
registerStep.visible = false registerStep.visible = false
steps.init() steps.init()
worker.renewCtx() worker.renewCtx()
worker.pooler.running = true
visible = true; visible = true;
} }

12
mix/qml/DeploymentWorker.qml

@ -19,6 +19,7 @@ Item
property alias gasPriceInt: gasPriceInt property alias gasPriceInt: gasPriceInt
property variant balances: ({}) property variant balances: ({})
property variant accounts: [] property variant accounts: []
property alias pooler: pooler
signal gasPriceLoaded() signal gasPriceLoaded()
function renewCtx() function renewCtx()
@ -193,7 +194,8 @@ Item
id: codeModelGasEstimation id: codeModelGasEstimation
} }
ClientModel { ClientModel
{
id: clientModelGasEstimation id: clientModelGasEstimation
codeModel: codeModelGasEstimation codeModel: codeModelGasEstimation
Component.onCompleted: Component.onCompleted:
@ -202,6 +204,14 @@ Item
} }
} }
Timer
{
id: pooler
interval: 5000
repeat: true
running: false
}
Timer Timer
{ {
id: poolLog id: poolLog

8
mix/qml/RegisteringStep.qml

@ -32,6 +32,14 @@ Rectangle {
visible = true visible = true
worker.pooler.onTriggered.connect(function() {
if (root.visible)
verifyRegistering();
})
}
function verifyRegistering()
{
verificationEthUrl.text = "" verificationEthUrl.text = ""
if (projectModel.registerContentHashTrHash !== "" && projectModel.registerContentHashBlockNumber !== -1) if (projectModel.registerContentHashTrHash !== "" && projectModel.registerContentHashBlockNumber !== -1)
{ {

Loading…
Cancel
Save