mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9230 from ethereum/issue-8716
Add unit denomination ``gwei``
This commit is contained in:
@@ -2,5 +2,6 @@ contract C {
|
||||
uint constant a = 1 wei + 2 szabo + 3 finney + 4 ether;
|
||||
uint constant b = 1 seconds + 2 minutes + 3 hours + 4 days + 5 weeks;
|
||||
uint constant c = 2 szabo / 1 seconds + 3 finney * 3 hours;
|
||||
uint constant d = 2 gwei / 1 seconds + 3 finney * 3 hours;
|
||||
}
|
||||
// ----
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
contract C {
|
||||
uint constant gwei = 1 gwei;
|
||||
}
|
||||
+4
-3
@@ -1,15 +1,16 @@
|
||||
contract c {
|
||||
contract C {
|
||||
function f() public
|
||||
{
|
||||
a = 1 wei;
|
||||
b = 2 szabo;
|
||||
c = 3 finney;
|
||||
b = 4 ether;
|
||||
d = 4 ether;
|
||||
e = 5 gwei;
|
||||
}
|
||||
uint256 a;
|
||||
uint256 b;
|
||||
uint256 c;
|
||||
uint256 d;
|
||||
uint256 e;
|
||||
}
|
||||
// ----
|
||||
// Warning 2519: (170-179): This declaration shadows an existing declaration.
|
||||
|
||||
Reference in New Issue
Block a user