go-ethereum/core/state
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
..
pruner core/rawdb: add HasCode, HashTrieNode and use them where possible (#24454) 2022-03-09 00:39:34 +01:00
snapshot all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
access_list.go all: implement EIP-2929 (gas cost increases for state access opcodes) + yolo-v2 (#21509) 2020-10-23 08:26:57 +02:00
database.go core/state: move state account to core/types + abstracted "write account to trie" (#23567) 2021-09-28 10:48:07 +02:00
dump.go core/state: move state account to core/types + abstracted "write account to trie" (#23567) 2021-09-28 10:48:07 +02:00
iterator.go core/state: move state account to core/types + abstracted "write account to trie" (#23567) 2021-09-28 10:48:07 +02:00
iterator_test.go core, eth, les, trie: add a prefix to contract code (#21080) 2020-08-21 15:10:40 +03:00
journal.go core/state: fix typos in comments (#23702) 2021-10-10 15:00:00 +02:00
metrics.go core, light, tests, trie: add state metrics (#23433) 2021-08-24 22:00:42 +03:00
state_object.go core/state: fix read-meters + simplify code (#24304) 2022-02-14 09:22:57 +01:00
state_object_test.go build: use golangci-lint (#20295) 2019-11-18 10:49:17 +02:00
state_test.go cmd/geth, eth, core: snapshot dump + unify with trie dump (#22795) 2021-05-12 11:05:39 +03:00
statedb.go core/statedb: always clear out access list when setting a new one 2022-03-08 12:00:29 +02:00
statedb_test.go all: removed blockhash from statedb (#23126) 2021-06-30 15:17:01 +02:00
sync.go core, eth, les, trie: remove the sync bloom, used by fast sync 2021-12-03 12:32:41 +02:00
sync_test.go core, eth, les, trie: remove the sync bloom, used by fast sync 2021-12-03 12:32:41 +02:00
trie_prefetcher.go core/state: avoid unnecessary alloc in trie prefetcher (#23198) 2021-07-12 21:34:20 +02:00
trie_prefetcher_test.go core/state: add trie prefetcher tests (#23216) 2021-08-03 17:35:25 +02:00