File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import (
3939
4040const uintBits = 32 << (uint64 (^ uint (0 )) >> 63 )
4141
42+ // Errors
4243var (
4344 ErrEmptyString = & decError {"empty hex string" }
4445 ErrSyntax = & decError {"invalid hex string" }
Original file line number Diff line number Diff line change @@ -22,12 +22,13 @@ import (
2222 "math/big"
2323)
2424
25+ // Various big integer limit values.
2526var (
2627 tt255 = BigPow (2 , 255 )
2728 tt256 = BigPow (2 , 256 )
2829 tt256m1 = new (big.Int ).Sub (tt256 , big .NewInt (1 ))
29- MaxBig256 = new (big.Int ).Set (tt256m1 )
3030 tt63 = BigPow (2 , 63 )
31+ MaxBig256 = new (big.Int ).Set (tt256m1 )
3132 MaxBig63 = new (big.Int ).Sub (tt63 , big .NewInt (1 ))
3233)
3334
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ import (
2121 "strconv"
2222)
2323
24+ // Integer limit values.
2425const (
25- // Integer limit values.
2626 MaxInt8 = 1 << 7 - 1
2727 MinInt8 = - 1 << 7
2828 MaxInt16 = 1 << 15 - 1
Original file line number Diff line number Diff line change 1414// You should have received a copy of the GNU Lesser General Public License
1515// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616
17- // package mclock is a wrapper for a monotonic clock source
17+ // Package mclock is a wrapper for a monotonic clock source
1818package mclock
1919
2020import (
@@ -23,8 +23,10 @@ import (
2323 "github.com/aristanetworks/goarista/monotime"
2424)
2525
26- type AbsTime time.Duration // absolute monotonic time
26+ // AbsTime represents absolute monotonic time.
27+ type AbsTime time.Duration
2728
29+ // Now returns the current absolute monotonic time.
2830func Now () AbsTime {
2931 return AbsTime (monotime .Now ())
3032}
Original file line number Diff line number Diff line change @@ -22,9 +22,11 @@ import (
2222 "github.com/ethereum/go-ethereum/common"
2323)
2424
25- var tt256 = new (big.Int ).Lsh (big .NewInt (1 ), 256 )
26- var tt256m1 = new (big.Int ).Sub (new (big.Int ).Lsh (big .NewInt (1 ), 256 ), big .NewInt (1 ))
27- var tt255 = new (big.Int ).Lsh (big .NewInt (1 ), 255 )
25+ var (
26+ tt256 = new (big.Int ).Lsh (big .NewInt (1 ), 256 )
27+ tt256m1 = new (big.Int ).Sub (new (big.Int ).Lsh (big .NewInt (1 ), 256 ), big .NewInt (1 ))
28+ tt255 = new (big.Int ).Lsh (big .NewInt (1 ), 255 )
29+ )
2830
2931func limitUnsigned256 (x * Number ) * Number {
3032 x .num .And (x .num , tt256m1 )
@@ -181,7 +183,6 @@ func (i *Number) FirstBitSet() int {
181183}
182184
183185// Variables
184-
185186var (
186187 Zero = Uint (0 )
187188 One = Uint (1 )
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import (
2929 "github.com/ethereum/go-ethereum/crypto/sha3"
3030)
3131
32+ // Lengths of hashes and addresses in bytes.
3233const (
3334 HashLength = 32
3435 AddressLength = 20
You can’t perform that action at this time.
0 commit comments