Browse Source

- bugfix: #1397.

- Debugger panel: UI bug fixes.
cl-refactor
yann300 10 years ago
parent
commit
2321f2914b
  1. 16
      mix/ContractCallDataEncoder.cpp
  2. 1
      mix/qml/QHashTypeView.qml
  3. 1
      mix/qml/QIntTypeView.qml
  4. 1
      mix/qml/QStringTypeView.qml
  5. 11
      mix/qml/StructView.qml

16
mix/ContractCallDataEncoder.cpp

@ -76,18 +76,22 @@ unsigned ContractCallDataEncoder::encodeSingleItem(QVariant const& _data, Solidi
unsigned const alignSize = 32;
QString src = _data.toString();
bytes result;
if (src.length() >= 2 && ((src.startsWith("\"") && src.endsWith("\"")) || (src.startsWith("\'") && src.endsWith("\'"))))
{
if ((src.startsWith("\"") && src.endsWith("\"")) || (src.startsWith("\'") && src.endsWith("\'")))
src = src.remove(src.length() - 1, 1).remove(0, 1);
QByteArray bytesAr = src.toLocal8Bit();
result = bytes(bytesAr.begin(), bytesAr.end());
}
else if (src.startsWith("0x"))
QRegExp rx("[a-z]+");
if (src.startsWith("0x"))
{
result = fromHex(src.toStdString().substr(2));
if (_type.type != SolidityType::Type::Bytes)
result = padded(result, alignSize);
}
else if (rx.indexIn(src.toLower(), 0) != -1)
{
QByteArray bytesAr = src.toLocal8Bit();
result = bytes(bytesAr.begin(), bytesAr.end());
}
else
{
bigint i(src.toStdString());

1
mix/qml/QHashTypeView.qml

@ -15,7 +15,6 @@ Item
Rectangle {
anchors.fill: parent
radius: 4
color: "#f7f7f7"
TextInput {
id: textinput
text: value

1
mix/qml/QIntTypeView.qml

@ -16,7 +16,6 @@ Item
Rectangle {
anchors.fill: parent
radius: 4
color: "#f7f7f7"
TextInput {
id: textinput
text: value

1
mix/qml/QStringTypeView.qml

@ -15,7 +15,6 @@ Item
Rectangle {
anchors.fill: parent
radius: 4
color: "#f7f7f7"
TextInput {
id: textinput
text: value

11
mix/qml/StructView.qml

@ -24,24 +24,24 @@ Column
height: 20
id: typeLabel
text: modelData.type.name
Layout.preferredWidth: 60
anchors.verticalCenter: parent.verticalCenter
}
DefaultLabel {
id: nameLabel
text: modelData.name
Layout.preferredWidth: 100
anchors.verticalCenter: parent.verticalCenter
}
DefaultLabel {
id: equalLabel
text: "="
Layout.preferredWidth: 15
anchors.verticalCenter: parent.verticalCenter
}
Loader
{
id: typeLoader
Layout.preferredWidth: 150
anchors.verticalCenter: parent.verticalCenter
sourceComponent:
{
var t = modelData.type.category;
@ -63,7 +63,8 @@ Column
var ptype = members[index].type;
var pname = members[index].name;
var vals = value;
if (ptype.category === QSolidityType.Struct && !item.members) {
if (ptype.category === QSolidityType.Struct && !item.members)
{
item.value = getValue();
item.members = ptype.members;
}

Loading…
Cancel
Save