Browse Source

- small changes

cl-refactor
yann300 10 years ago
parent
commit
7bb5032874
  1. 1
      mix/ClientModel.cpp
  2. 1
      mix/MixClient.cpp
  3. 6
      mix/qml/StateListModel.qml

1
mix/ClientModel.cpp

@ -190,7 +190,6 @@ void ClientModel::setupState(QVariantMap _state)
if (contractId.isEmpty() && m_context->codeModel()->hasContract()) //TODO: This is to support old project files, remove later if (contractId.isEmpty() && m_context->codeModel()->hasContract()) //TODO: This is to support old project files, remove later
contractId = m_context->codeModel()->contracts().keys()[0]; contractId = m_context->codeModel()->contracts().keys()[0];
QVariantList qParams = transaction.value("qType").toList(); QVariantList qParams = transaction.value("qType").toList();
TransactionSettings transactionSettings(contractId, functionId, value, gas, gasPrice, Secret(sender.toStdString())); TransactionSettings transactionSettings(contractId, functionId, value, gas, gasPrice, Secret(sender.toStdString()));
for (QVariant const& variant: qParams) for (QVariant const& variant: qParams)

1
mix/MixClient.cpp

@ -21,7 +21,6 @@
*/ */
#include <vector> #include <vector>
#include <QDebug>
#include <libdevcore/Exceptions.h> #include <libdevcore/Exceptions.h>
#include <libethereum/CanonBlockChain.h> #include <libethereum/CanonBlockChain.h>
#include <libethereum/Transaction.h> #include <libethereum/Transaction.h>

6
mix/qml/StateListModel.qml

@ -11,10 +11,10 @@ Item {
property alias model: stateListModel property alias model: stateListModel
property var stateList: [] property var stateList: []
property string defaultAccount: "cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074" property string defaultAccount: "cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074" //support for old project
function fromPlainStateItem(s) { function fromPlainStateItem(s) {
if (!s.accounts) if (!s.accounts)
s.accounts = [stateListModel.newAccount("1000000", QEther.Ether, defaultAccount)]; //support old project s.accounts = [stateListModel.newAccount("1000000", QEther.Ether, defaultAccount)]; //support for old project
return { return {
title: s.title, title: s.title,
transactions: s.transactions.map(fromPlainTransactionItem), transactions: s.transactions.map(fromPlainTransactionItem),
@ -33,7 +33,7 @@ Item {
function fromPlainTransactionItem(t) { function fromPlainTransactionItem(t) {
if (!t.sender) if (!t.sender)
t.sender = defaultAccount; //support old project t.sender = defaultAccount; //support for old project
var r = { var r = {
contractId: t.contractId, contractId: t.contractId,
functionId: t.functionId, functionId: t.functionId,

Loading…
Cancel
Save