Browse Source

bug fix last package url

block number for verification
cl-refactor
yann300 10 years ago
parent
commit
6561e8c706
  1. 1
      mix/qml/Application.qml
  2. 50
      mix/qml/DeployContractStep.qml
  3. 17
      mix/qml/DeploymentWorker.qml
  4. 1
      mix/qml/PackagingStep.qml
  5. 1
      mix/qml/ProjectModel.qml
  6. 1
      mix/qml/RegisteringStep.qml
  7. 1
      mix/qml/ScenarioExecution.qml
  8. 2
      mix/qml/ScenarioLoader.qml
  9. 8
      mix/qml/js/ProjectModel.js

1
mix/qml/Application.qml

@ -44,7 +44,6 @@ ApplicationWindow {
codeModel: codeModel
Component.onCompleted:
{
console.log("tmp")
init("/tmp")
}
}

50
mix/qml/DeployContractStep.qml

@ -30,6 +30,15 @@ Rectangle {
}
if (worker.accounts.length > 0)
worker.currentAccount = worker.accounts[0].id
if (projectModel.deployBlockNumber)
{
worker.blockNumber(function (bn)
{
verificationLabel.text = bn - projectModel.deployBlockNumber
});
}
deployedAddresses.refresh()
}
@ -58,7 +67,8 @@ Rectangle {
textRole: "title"
onCurrentIndexChanged:
{
change()
if (root.visible)
change()
}
function change()
@ -188,6 +198,7 @@ Rectangle {
Layout.preferredWidth: parent.width * 0.60
Layout.fillHeight: true
id: deploymentOption
spacing: 8
Label
{
@ -343,7 +354,7 @@ Rectangle {
Label
{
id: labelAddresses
text: qsTr("Deployed Addresses")
text: qsTr("Deployed Contracts")
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
@ -351,7 +362,8 @@ Rectangle {
ColumnLayout
{
anchors.top: parent.top
anchors.topMargin: 1
ListModel
{
id: deployedAddrModel
@ -380,13 +392,15 @@ Rectangle {
Label
{
id: labelContract
width: 110
width: 112
elide: Text.ElideRight
text: index > -1 ? deployedAddrModel.get(index).id : ""
}
TextField
{
width: 123
anchors.verticalCenter: parent.verticalCenter
anchors.left: labelContract.right
text: index > - 1 ? deployedAddrModel.get(index).value : ""
}
@ -394,6 +408,28 @@ Rectangle {
}
}
}
RowLayout
{
id: verificationRow
Layout.fillWidth: true
visible: Object.keys(projectModel.deploymentAddresses).length > 0
Rectangle
{
width: labelWidth
Label
{
text: qsTr("Verifications")
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
Label
{
id: verificationLabel
}
}
}
Rectangle
@ -409,6 +445,12 @@ Rectangle {
projectModel.deployedScenarioIndex = contractList.currentIndex
NetworkDeploymentCode.deployContracts(root.gas, function(addresses)
{
worker.blockNumber(function (nb)
{
projectModel.deployBlockNumber = nb
verificationLabel.text = "0"
projectModel.saveProject()
})
projectModel.deploymentAddresses = addresses
projectModel.saveProject()
deployedAddresses.refresh()

17
mix/qml/DeploymentWorker.qml

@ -87,6 +87,21 @@ Item
poolLog.start();
}
function blockNumber(callback)
{
var requests = [];
requests.push({
jsonrpc: "2.0",
method: "eth_blockNumber",
params: [],
id: 0
});
TransactionHelper.rpcCall(requests, function (httpRequest, response){
var b = JSON.parse(response)[0].result;
callback(parseInt(b, 16))
});
}
Component.onCompleted:
{
renewCtx()
@ -168,6 +183,6 @@ Item
}
})
}
}
}
}

1
mix/qml/PackagingStep.qml

@ -106,6 +106,7 @@ Rectangle {
onClicked:
{
NetworkDeploymentCode.packageDapp(projectModel.deploymentAddresses);
projectModel.saveProject()
}
}

1
mix/qml/ProjectModel.qml

@ -51,6 +51,7 @@ Item {
property int deployedScenarioIndex
property string applicationUrlEth
property string applicationUrlHttp
property string deployBlockNumber
//interface
function saveAll() { ProjectModelCode.saveAll(); }

1
mix/qml/RegisteringStep.qml

@ -179,7 +179,6 @@ Rectangle {
{
id: appUrlFormatted
anchors.verticalCenter: parent.verticalCenter;
anchors.top: applicationUrlEthCtrl.bottom
anchors.topMargin: 10
font.italic: true
font.pointSize: appStyle.absoluteSize(-1)

1
mix/qml/ScenarioExecution.qml

@ -32,7 +32,6 @@ Rectangle {
{
id: columnExe
Layout.preferredWidth: parent.width
width: parent.width - 40
anchors.left: parent.left
anchors.leftMargin: 15
ColumnLayout

2
mix/qml/ScenarioLoader.qml

@ -154,7 +154,7 @@ ColumnLayout
function updateLabel()
{
comboLabel.text = ""
if (scenarioList.currentIndex < projectModel.stateListModel.count)
if (scenarioList.currentIndex > - 1 && scenarioList.currentIndex < projectModel.stateListModel.count)
comboLabel.text = projectModel.stateListModel.getState(scenarioList.currentIndex).title
}

8
mix/qml/js/ProjectModel.js

@ -79,7 +79,9 @@ function saveProjectFile()
packageHash: deploymentDialog.packageStep.packageHash,
packageBase64: deploymentDialog.packageStep.packageBase64,
deploymentDir: deploymentDialog.packageStep.packageDir,
lastPackageDate: deploymentDialog.packageStep.lastDeployDate
lastPackageDate: deploymentDialog.packageStep.lastDeployDate,
deployBlockNumber: projectModel.deployBlockNumber,
localPackageUrl: deploymentDialog.packageStep.localPackageUrl
};
for (var i = 0; i < projectListModel.count; i++)
projectData.files.push({
@ -117,6 +119,10 @@ function loadProject(path) {
projectModel.applicationUrlHttp = projectData.applicationUrlHttp
if (projectData.lastPackageDate)
deploymentDialog.packageStep.lastDeployDate = projectData.lastPackageDate
if (projectData.deployBlockNumber)
projectModel.deployBlockNumber = projectData.deployBlockNumber
if (projectData.localPackageUrl)
deploymentDialog.packageStep.localPackageUrl = projectData.localPackageUrl
if (!projectData.title) {
var parts = path.split("/");
projectData.title = parts[parts.length - 2];

Loading…
Cancel
Save