From 8d6b69068151c333dd5c65613ffd79c504fbdadf Mon Sep 17 00:00:00 2001 From: arkpar Date: Fri, 17 Apr 2015 14:23:54 +0200 Subject: [PATCH 1/3] Fixed packed negative signed integers storage display --- mix/ClientModel.cpp | 2 ++ mix/test/qml/js/TestDebugger.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 3478a88fa..dad1ced62 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -498,6 +498,8 @@ QVariant ClientModel::formatStorageValue(SolidityType const& _type, map Date: Fri, 17 Apr 2015 14:45:44 +0200 Subject: [PATCH 2/3] add some balance for gas estimation --- mix/MixClient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index 965a4c5ac..35d7dc413 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -117,6 +117,7 @@ void MixClient::executeTransaction(Transaction const& _t, State& _state, bool _c lastHashes[i] = lastHashes[i - 1] ? bc().details(lastHashes[i - 1]).parent : h256(); State execState = _state; + execState.addBalance(t.sender(), t.gas() * t.gasPrice()); //give it enough balance for gas estimation Executive execution(execState, lastHashes, 0); execution.initialize(&rlp); execution.execute(); From 8148e7b1df562ab9bd947d0e42bf56264d1dbcdd Mon Sep 17 00:00:00 2001 From: arkpar Date: Fri, 17 Apr 2015 15:55:09 +0200 Subject: [PATCH 3/3] tests --- mix/test/qml/TestMain.qml | 10 ++++++++++ mix/test/qml/js/TestMiner.js | 10 ++++++++++ mix/test/qml/js/TestProject.js | 4 ++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/mix/test/qml/TestMain.qml b/mix/test/qml/TestMain.qml index 73cff824e..778e4dc20 100644 --- a/mix/test/qml/TestMain.qml +++ b/mix/test/qml/TestMain.qml @@ -58,11 +58,20 @@ TestCase ts.keyPressChar(mainApplication, "S", Qt.ControlModifier, 200); //Ctrl+S } + function waitForMining() + { + while (mainApplication.clientModel.mining) + ts.waitForSignal(mainApplication.clientModel, "miningComplete()", 5000); + wait(1); //allow events to propagate 2 times for transaction log to be updated + wait(1); + } function waitForExecution() { while (mainApplication.clientModel.running) ts.waitForSignal(mainApplication.clientModel, "runComplete()", 5000); + wait(1); //allow events to propagate 2 times for transaction log to be updated + wait(1); } function editHtml(c) @@ -89,6 +98,7 @@ TestCase function test_dbg_vm() { TestDebugger.test_vmDebugging(); } function test_miner_getDefaultiner() { TestMiner.test_getDefaultMiner(); } function test_miner_selectMiner() { TestMiner.test_selectMiner(); } + function test_miner_mine() { TestMiner.test_mine(); } function test_project_contractRename() { TestProject.test_contractRename(); } } diff --git a/mix/test/qml/js/TestMiner.js b/mix/test/qml/js/TestMiner.js index a24b0ce19..9d98c9f24 100644 --- a/mix/test/qml/js/TestMiner.js +++ b/mix/test/qml/js/TestMiner.js @@ -18,3 +18,13 @@ function test_selectMiner() compare(state.miner.secret, account.secret); } +function test_mine() +{ + newProject(); + mainApplication.mainContent.startQuickDebugging(); + waitForExecution(); + mainApplication.clientModel.mine(); + waitForMining(); + tryCompare(mainApplication.mainContent.rightPane.transactionLog.transactionModel.get(3), "contract", " - Block - "); +} + diff --git a/mix/test/qml/js/TestProject.js b/mix/test/qml/js/TestProject.js index 444760ea3..0d20ec9a8 100644 --- a/mix/test/qml/js/TestProject.js +++ b/mix/test/qml/js/TestProject.js @@ -1,11 +1,12 @@ function test_contractRename() { newProject(); + waitForExecution(); tryCompare(mainApplication.mainContent.projectNavigator.sections.itemAt(0).model.get(0), "name", "Contract"); editContract("contract Renamed {}"); mainApplication.mainContent.startQuickDebugging(); waitForExecution(); - wait(1000); + tryCompare(mainApplication.mainContent.rightPane.transactionLog.transactionModel.get(2), "contract", "Renamed"); tryCompare(mainApplication.mainContent.projectNavigator.sections.itemAt(0).model.get(0), "name", "Renamed"); mainApplication.projectModel.stateListModel.editState(0); mainApplication.projectModel.stateDialog.model.editTransaction(2); @@ -14,5 +15,4 @@ function test_contractRename() tryCompare(transactionDialog, "functionId", "Renamed"); transactionDialog.close(); mainApplication.projectModel.stateDialog.close(); - tryCompare(mainApplication.mainContent.rightPane.transactionLog.transactionModel.get(2), "contract", "Renamed"); }