go-ethereum/consensus/ethash
Eng Zer Jun 8d066f1f42
all: use T.TempDir to create temporary test directories (#24633)
This commit replaces ioutil.TempDir with t.TempDir in tests. The
directory created by t.TempDir is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using ioutil.TempDir
had to be removed manually by calling os.RemoveAll, which is omitted in
some tests. The error handling boilerplate e.g.

	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}

is also tedious, but t.TempDir handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-08 15:44:55 +02:00
..
algorithm_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
algorithm.go consensus/ethash: replace a magic number with it's constant (#22618) 2021-04-06 21:02:52 +03:00
api.go all: fix miner hashRate -> hashrate on API calls 2021-03-31 10:56:51 +03:00
consensus_test.go consensus/ethash: implement faster difficulty calculators (#21976) 2020-12-11 11:06:44 +01:00
consensus.go consensus: define MaxGasLimit as a const in params (#24092) 2021-12-14 10:17:25 +01:00
difficulty.go go.mod: upgrade to github.com/holiman/uint256 v1.2.0 (#22745) 2021-05-10 12:29:33 +02:00
ethash_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
ethash.go core: eth: implement Kiln-v2 spec (#24506) 2022-03-17 17:20:03 +02:00
mmap_help_linux.go consensus/ethash: avoid runtime errors due to OOD on mmap writes (#23799) 2021-11-02 11:33:54 +01:00
mmap_help_other.go consensus/ethash: avoid runtime errors due to OOD on mmap writes (#23799) 2021-11-02 11:33:54 +01:00
sealer_test.go cmd/geth, consensus/ethash: add support for --miner.notify.full flag (#22558) 2021-03-26 18:30:10 +01:00
sealer.go consensus/ethash: less allocation during mining (#23199) 2021-07-28 14:24:41 +02:00