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; unsigned const alignSize = 32;
QString src = _data.toString(); QString src = _data.toString();
bytes result; 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); src = src.remove(src.length() - 1, 1).remove(0, 1);
QByteArray bytesAr = src.toLocal8Bit();
result = bytes(bytesAr.begin(), bytesAr.end()); QRegExp rx("[a-z]+");
} if (src.startsWith("0x"))
else if (src.startsWith("0x"))
{ {
result = fromHex(src.toStdString().substr(2)); result = fromHex(src.toStdString().substr(2));
if (_type.type != SolidityType::Type::Bytes) if (_type.type != SolidityType::Type::Bytes)
result = padded(result, alignSize); result = padded(result, alignSize);
} }
else if (rx.indexIn(src.toLower(), 0) != -1)
{
QByteArray bytesAr = src.toLocal8Bit();
result = bytes(bytesAr.begin(), bytesAr.end());
}
else else
{ {
bigint i(src.toStdString()); bigint i(src.toStdString());

1
mix/qml/QHashTypeView.qml

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

1
mix/qml/QIntTypeView.qml

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

1
mix/qml/QStringTypeView.qml

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

11
mix/qml/StructView.qml

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

Loading…
Cancel
Save