diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index a44af8a2d..e15d08ab8 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -273,12 +273,12 @@ void Main::installWatches() Address Main::getNameReg() const { - return abiOut
(ethereum()->call(c_newConfig, abiIn(1, (u256)1))); + return abiOut
(ethereum()->call(c_newConfig, abiIn("lookup(uint256)", (u256)1))); } Address Main::getCurrencies() const { - return abiOut
(ethereum()->call(c_newConfig, abiIn(1, (u256)2))); + return abiOut
(ethereum()->call(c_newConfig, abiIn("lookup(uint256)", (u256)2))); } void Main::installNameRegWatch() @@ -475,7 +475,7 @@ QString Main::pretty(dev::Address _a) const if (g_newNameReg) { - QString s = QString::fromStdString(toString(abiOut(ethereum()->call(g_newNameReg, abiIn(2, _a))))); + QString s = QString::fromStdString(toString(abiOut(ethereum()->call(g_newNameReg, abiIn("nameOf(address)", _a))))); // s_memos[_a] = s; if (s.size()) return s; @@ -522,11 +522,11 @@ Address Main::fromString(QString const& _n) const if (!s_memos.count(_n)) {*/ // if (!g_newNameReg) - auto g_newNameReg = abiOut
(ethereum()->call(c_newConfig, abiIn(1, (u256)1))); + auto g_newNameReg = getNameReg(); if (g_newNameReg) { - Address a = abiOut
(ethereum()->call(g_newNameReg, abiIn(0, ::fromString(_n.toStdString())))); + Address a = abiOut
(ethereum()->call(g_newNameReg, abiIn("addressOf(string32)", ::fromString(_n.toStdString())))); // s_memos[_n] = a; if (a) return a; diff --git a/libdevcore/vector_ref.h b/libdevcore/vector_ref.h index 2771c739a..0cd3f8064 100644 --- a/libdevcore/vector_ref.h +++ b/libdevcore/vector_ref.h @@ -28,7 +28,7 @@ public: bool contentsEqual(std::vector const& _c) const { return _c.size() == m_count && !memcmp(_c.data(), m_data, m_count); } std::vector toVector() const { return std::vector(m_data, m_data + m_count); } - std::vector toBytes() const { return std::vector((unsigned char const*)m_data, m_data + m_count * sizeof(_T)); } + std::vector toBytes() const { return std::vector((unsigned char const*)m_data, (unsigned char const*)m_data + m_count * sizeof(_T)); } std::string toString() const { return std::string((char const*)m_data, ((char const*)m_data) + m_count * sizeof(_T)); } template operator vector_ref<_T2>() const { assert(m_count * sizeof(_T) / sizeof(_T2) * sizeof(_T2) / sizeof(_T) == m_count); return vector_ref<_T2>((_T2*)m_data, m_count * sizeof(_T) / sizeof(_T2)); } diff --git a/libethereum/Client.h b/libethereum/Client.h index 6a3d7ec22..efe076dab 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -119,9 +119,9 @@ template bytes abiInAux(T const& _t, U const& ... _u) return ABISerialiser::serialise(_t) + abiInAux(_u ...); } -template bytes abiIn(byte _id, T const& ... _t) +template bytes abiIn(std::string _id, T const& ... _t) { - return bytes(1, _id) + abiInAux(_t ...); + return sha3(_id).ref().cropped(0, 4).toBytes() + abiInAux(_t ...); } template struct ABIDeserialiser {};