Browse Source

- Fix for #1448, #1447

cl-refactor
yann300 10 years ago
parent
commit
5bfff8fcac
  1. 1
      mix/CodeModel.cpp
  2. 3
      mix/ContractCallDataEncoder.cpp
  3. 1
      mix/qml/StructView.qml
  4. 7
      mix/qml/TransactionDialog.qml

1
mix/CodeModel.cpp

@ -342,6 +342,7 @@ SolidityType CodeModel::nodeType(dev::solidity::Type const* _type)
r.type = SolidityType::Type::Bytes;
r.size = static_cast<unsigned>(b->getNumBytes());
}
break;
case Type::Category::Contract:
r.type = SolidityType::Type::Address;
break;

3
mix/ContractCallDataEncoder.cpp

@ -91,6 +91,7 @@ unsigned ContractCallDataEncoder::encodeSingleItem(QVariant const& _data, Solidi
{
QByteArray bytesAr = src.toLocal8Bit();
result = bytes(bytesAr.begin(), bytesAr.end());
result = paddedRight(result, alignSize);
}
else
{
@ -101,7 +102,7 @@ unsigned ContractCallDataEncoder::encodeSingleItem(QVariant const& _data, Solidi
unsigned dataSize = _type.dynamicSize ? result.size() : alignSize;
_dest.insert(_dest.end(), result.begin(), result.end());
if (_dest.size() % alignSize != 0)
if ((_dest.size() - 4) % alignSize != 0)
_dest.resize((_dest.size() & ~(alignSize - 1)) + alignSize);
return dataSize;
}

1
mix/qml/StructView.qml

@ -44,6 +44,7 @@ Column
anchors.verticalCenter: parent.verticalCenter
sourceComponent:
{
console.log("loading param");
var t = modelData.type.category;
if (t === QSolidityType.SignedInteger || t === QSolidityType.UnsignedInteger)
return Qt.createComponent("qrc:/qml/QIntTypeView.qml");

7
mix/qml/TransactionDialog.qml

@ -81,6 +81,7 @@ Window {
loadParameter(params[p]);
}
}
initTypeLoader();
modalTransactionDialog.setX((Screen.width - width) / 2);
modalTransactionDialog.setY((Screen.height - height) / 2);
@ -126,11 +127,15 @@ Window {
}
}
}
initTypeLoader();
}
function initTypeLoader()
{
typeLoader.value = {}
typeLoader.members = []
typeLoader.value = paramValues;
typeLoader.members = paramsModel;
}
function close()

Loading…
Cancel
Save