diff options
author | chriseth <c@ethdev.com> | 2016-11-14 20:13:37 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-16 21:37:19 +0800 |
commit | ec31d08775021de0f3279dbeb115b3e688c5997e (patch) | |
tree | 32f8d14735ffd15f7fb2c7ca5b8498cc1bab8748 /libsolidity/ast | |
parent | a8e7ed37a10f9dd43bfc57db7733412503c1a24e (diff) | |
download | dexon-solidity-ec31d08775021de0f3279dbeb115b3e688c5997e.tar.gz dexon-solidity-ec31d08775021de0f3279dbeb115b3e688c5997e.tar.zst dexon-solidity-ec31d08775021de0f3279dbeb115b3e688c5997e.zip |
Change encoding to address-funid and add "function" as ABI type.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.cpp | 2 | ||||
-rw-r--r-- | libsolidity/ast/Types.cpp | 9 | ||||
-rw-r--r-- | libsolidity/ast/Types.h | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index d6aca175..37dfd3c6 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -236,7 +236,7 @@ bool ASTJsonConverter::visit(FunctionTypeName const& _node) make_pair("payable", _node.isPayable()), make_pair("visibility", visibility), make_pair("constant", _node.isDeclaredConst()) - }); + }, true); return true; } diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index c1ae183e..3a8fc075 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -1930,6 +1930,12 @@ TypePointer FunctionType::unaryOperatorResult(Token::Value _operator) const return TypePointer(); } +string FunctionType::canonicalName(bool) const +{ + solAssert(m_location == Location::External, ""); + return "function"; +} + string FunctionType::toString(bool _short) const { string name = "function ("; @@ -2102,7 +2108,6 @@ TypePointer FunctionType::encodingType() const { // Only external functions can be encoded, internal functions cannot leave code boundaries. if (m_location == Location::External) - // This looks like bytes24, but bytes24 is stored differently on the stack. return shared_from_this(); else return TypePointer(); @@ -2111,7 +2116,7 @@ TypePointer FunctionType::encodingType() const TypePointer FunctionType::interfaceType(bool /*_inLibrary*/) const { if (m_location == Location::External) - return make_shared<FixedBytesType>(storageBytes()); + return shared_from_this(); else return TypePointer(); } diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index 84e56663..34fcfc82 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -897,6 +897,7 @@ public: virtual bool operator==(Type const& _other) const override; virtual TypePointer unaryOperatorResult(Token::Value _operator) const override; + virtual std::string canonicalName(bool /*_addDataLocation*/) const override; virtual std::string toString(bool _short) const override; virtual unsigned calldataEncodedSize(bool _padded) const override; virtual bool canBeStored() const override { return m_location == Location::Internal || m_location == Location::External; } |