From 690cc9389848e5f97781dbabd3a1f5291bb48304 Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Wed, 10 Apr 2019 16:20:31 +0800 Subject: Fix time constants --- libsolidity/ast/Types.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 3a8c9878..fed0cb3e 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -938,7 +938,6 @@ tuple RationalNumberType::isValidLiteral(Literal const& _literal { case Literal::SubDenomination::None: case Literal::SubDenomination::Wei: - case Literal::SubDenomination::Second: break; case Literal::SubDenomination::Szabo: value *= bigint("1000000000000"); @@ -949,20 +948,23 @@ tuple RationalNumberType::isValidLiteral(Literal const& _literal case Literal::SubDenomination::Ether: value *= bigint("1000000000000000000"); break; + case Literal::SubDenomination::Second: + value *= bigint("1000"); + break; case Literal::SubDenomination::Minute: - value *= bigint("60"); + value *= bigint("60000"); break; case Literal::SubDenomination::Hour: - value *= bigint("3600"); + value *= bigint("3600000"); break; case Literal::SubDenomination::Day: - value *= bigint("86400"); + value *= bigint("86400000"); break; case Literal::SubDenomination::Week: - value *= bigint("604800"); + value *= bigint("604800000"); break; case Literal::SubDenomination::Year: - value *= bigint("31536000"); + value *= bigint("31536000000"); break; } -- cgit