Skip to content

Commit

Permalink
Merge pull request ethereum#299 from LianaHus/add_tr_params
Browse files Browse the repository at this point in the history
fixes bug when adding transaction parameters
  • Loading branch information
yann300 committed Apr 12, 2016
2 parents 26dbfb2 + 6e6745e commit 8d37d26
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions qml/BlockChain.qml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ ColumnLayout {
width: btnWidth
tooltip: qsTr("Add Transaction/Block")
height: btnHeight
imageSource: "qrc:/qml/img/plus.png"
Component.onCompleted:
{
actions.push({ label: qsTr("Add Transaction...") , action: addTransaction })
Expand Down
3 changes: 2 additions & 1 deletion qml/DropdownButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Item
{
property string tooltip
property var actions: []
property string imageSource: "qrc:/qml/img/showmoreactions.png"
id: root
function init()
{
Expand Down Expand Up @@ -41,7 +42,7 @@ Item
roundRight: false
width: parent.width
height: parent.height
sourceImg: "qrc:/qml/img/showmoreactions.png"
sourceImg: imageSource
text: tooltip
onClicked:
{
Expand Down
6 changes: 3 additions & 3 deletions src/ContractCallDataEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ QJsonArray ContractCallDataEncoder::decodeArray(SolidityType const& _type, bytes
bytes rawParam((static_cast<size_t>(count)));
value.populate(&rawParam);
if (_type.type == QSolidityType::Type::Bytes)
array.append(toString(decodeBytes(rawParam)));
array.append(toChar(decodeBytes(rawParam)));
else
array.append(toChar(decodeBytes(rawParam)));
}
Expand Down Expand Up @@ -361,7 +361,7 @@ QVariant ContractCallDataEncoder::decode(SolidityType const& _type, bytes const&
else if (type == QSolidityType::Type::Bool)
return QVariant::fromValue(toString(decodeBool(rawParam)));
else if (type == QSolidityType::Type::Bytes || type == QSolidityType::Type::Hash)
return QVariant::fromValue(toString(decodeBytes(rawParam)));
return QVariant::fromValue(toChar(decodeBytes(rawParam)));
else if (type == QSolidityType::Type::String)
return QVariant::fromValue(toChar(decodeBytes(rawParam)));
else if (type == QSolidityType::Type::Struct)
Expand Down Expand Up @@ -632,7 +632,7 @@ QVariant ContractCallDataEncoder::decodeType(SolidityType _type, bytes _value, u
if (_type.array)
{
QJsonArray array = decodeArray(_type, _value, _readPosition);
if (_type.type == SolidityType::String && array.count() <= 1)
if ((_type.type == SolidityType::String || _type.type == SolidityType::Bytes) && array.count() <= 1)
{
if (array.count() == 1)
return array[0].toString();
Expand Down

0 comments on commit 8d37d26

Please sign in to comment.