diff options
Diffstat (limited to 'libsolidity/ast/Types.cpp')
-rw-r--r-- | libsolidity/ast/Types.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index f4559eda..41700e28 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -3002,30 +3002,19 @@ bool MagicType::operator==(Type const& _other) const return other.m_kind == m_kind; } -MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const* _contract) const +MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const*) const { - const bool v050 = _contract->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050); switch (m_kind) { case Kind::Block: - { - std::vector<MemberList::Member> members = { - {"coinbase", make_shared<IntegerType>(160, IntegerType::Modifier::Address)}, - {"timestamp", make_shared<IntegerType>(256)}, - {"difficulty", make_shared<IntegerType>(256)}, - {"number", make_shared<IntegerType>(256)}, - {"gaslimit", make_shared<IntegerType>(256)} - }; - - if (!v050) - { - auto blockhashFun = make_shared<FunctionType>(strings{"uint256"}, strings{"bytes32"}, - FunctionType::Kind::BlockHash, false, StateMutability::View); - - members.emplace_back("blockhash", blockhashFun); - } - return MemberList::MemberMap(members); - } + return MemberList::MemberMap({ + {"coinbase", make_shared<IntegerType>(160, IntegerType::Modifier::Address)}, + {"timestamp", make_shared<IntegerType>(256)}, + {"blockhash", make_shared<FunctionType>(strings{"uint"}, strings{"bytes32"}, FunctionType::Kind::BlockHash, false, StateMutability::View)}, + {"difficulty", make_shared<IntegerType>(256)}, + {"number", make_shared<IntegerType>(256)}, + {"gaslimit", make_shared<IntegerType>(256)} + }); case Kind::Message: return MemberList::MemberMap({ {"sender", make_shared<IntegerType>(160, IntegerType::Modifier::Address)}, |