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 codeModel: codeModel
Component.onCompleted: Component.onCompleted:
{ {
console.log("tmp")
init("/tmp") init("/tmp")
} }
} }

50
mix/qml/DeployContractStep.qml

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

17
mix/qml/DeploymentWorker.qml

@ -87,6 +87,21 @@ Item
poolLog.start(); 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: Component.onCompleted:
{ {
renewCtx() renewCtx()
@ -168,6 +183,6 @@ Item
} }
}) })
} }
} }
} }

1
mix/qml/PackagingStep.qml

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

1
mix/qml/ProjectModel.qml

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

1
mix/qml/RegisteringStep.qml

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

1
mix/qml/ScenarioExecution.qml

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

2
mix/qml/ScenarioLoader.qml

@ -154,7 +154,7 @@ ColumnLayout
function updateLabel() function updateLabel()
{ {
comboLabel.text = "" 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 comboLabel.text = projectModel.stateListModel.getState(scenarioList.currentIndex).title
} }

8
mix/qml/js/ProjectModel.js

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

Loading…
Cancel
Save