// Copyright 2017 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // The go-ethereum library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . package tests import ( "fmt" "math/big" "github.com/dexon-foundation/dexon/common" "github.com/dexon-foundation/dexon/common/math" "github.com/dexon-foundation/dexon/consensus/ethash" "github.com/dexon-foundation/dexon/core/types" "github.com/dexon-foundation/dexon/params" ) //go:generate gencodec -type DifficultyTest -field-override difficultyTestMarshaling -out gen_difficultytest.go type DifficultyTest struct { ParentTimestamp uint64 `json:"parentTimestamp"` ParentDifficulty *big.Int `json:"parentDifficulty"` UncleHash common.Hash `json:"parentUncles"` CurrentTimestamp uint64 `json:"currentTimestamp"` CurrentBlockNumber uint64 `json:"currentBlockNumber"` CurrentDifficulty *big.Int `json:"currentDifficulty"` } type difficultyTestMarshaling struct { ParentTimestamp math.HexOrDecimal64 ParentDifficulty *math.HexOrDecimal256 CurrentTimestamp math.HexOrDecimal64 CurrentDifficulty *math.HexOrDecimal256 UncleHash common.Hash CurrentBlockNumber math.HexOrDecimal64 } func (test *DifficultyTest) Run(config *params.ChainConfig) error { parentNumber := big.NewInt(int64(test.CurrentBlockNumber - 1)) parent := &types.Header{ Difficulty: test.ParentDifficulty, Time: test.ParentTimestamp, Number: parentNumber, UncleHash: test.UncleHash, } actual := ethash.CalcDifficulty(config, test.CurrentTimestamp, parent) exp := test.CurrentDifficulty if actual.Cmp(exp) != 0 { return fmt.Errorf("parent[time %v diff %v unclehash:%x] child[time %v number %v] diff %v != expected %v", test.ParentTimestamp, test.ParentDifficulty, test.UncleHash, test.CurrentTimestamp, test.CurrentBlockNumber, actual, exp) } return nil } ot/npm_and_yarn/devel/electron4/files/minimist-1.2.2'>dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.2 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/textproc/hs-polyparse
Commit message (Expand)AuthorAgeFilesLines
* - Update The Glorious Glasgow Haskell Compiler to version 8.0.2tcberner2017-08-092-3/+4
* - Update The Glorious Glasgow Haskell Compiler to version 7.10.2pgj2015-08-212-4/+3
* Update the default version of GCC in the Ports Collection from GCC 4.7.4gerald2014-09-111-1/+1
* - Update The Glorious Glasgow Haskell Compiler to version 7.8.3pgj2014-08-111-1/+1
* - Reroll and update bootstrap Haskell compilers to GHC 7.6.3 on 8.x andpgj2014-03-291-1/+1
* Update the default version of GCC used in the Ports Collection fromgerald2014-03-111-1/+1
* - Stagify lang/ghc and all the Haskell Cabal portspgj2014-01-101-1/+0
* - Fix a run-time problem with lang/ghc on FreeBSD 10.0 and later, caused bypgj2014-01-101-1/+1
* Update to libmpc version 1.0.1 which brings the following fixes:gerald2013-10-26