cosmos-sdk/x/genutil
Emmanuel T Odeke d2b914781b
x/genutil: fix CollectTxs traversal logic (#6913)
* x/genutil: fix CollectTxs traversal logic

Fixes the file traversal of CollectTxs to correctly skip over
directories instead of trying to read them, failing and erroring
out.

Also while here, changed the order to perform the os read
only after the AppState UnmarshalJSON has succeeded, otherwise
an attack vector can be to purposefully request many file stats
which touches kernel resources, while  just causing failures
indefinitely.

Fixes #6788

* address comments

* Fix test by passing in blank AppState

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-08 11:22:39 +00:00
..
client 0.39->0.40 CLI `migrate` command (#6839) 2020-10-05 21:28:14 +00:00
legacy 0.39->0.40 CLI `migrate` command (#6839) 2020-10-05 21:28:14 +00:00
types 0.39->0.40 CLI `migrate` command (#6839) 2020-10-05 21:28:14 +00:00
collect.go x/genutil: fix CollectTxs traversal logic (#6913) 2020-10-08 11:22:39 +00:00
collect_test.go x/genutil: fix CollectTxs traversal logic (#6913) 2020-10-08 11:22:39 +00:00
doc.go Merge PR #4159: Module/Genesis Generalization 2019-05-16 11:25:32 -04:00
genesis.go Migrate x/genutil to use TxConfig (#6734) 2020-07-25 08:10:04 +00:00
gentx.go Migrate x/genutil to use TxConfig (#6734) 2020-07-25 08:10:04 +00:00
gentx_test.go Update tm pubkey references (#7102) 2020-08-28 16:02:38 +00:00
module.go rename RegisterCodec to RegisterLegacyAminoCodec (#7243) 2020-09-07 14:47:12 +00:00
utils.go types: tests -> test suites migration (#7400) 2020-09-28 12:46:49 +02:00
utils_test.go replace testutil.NewTestCaseDir() with Go1.15's T.TempDir() (#7014) 2020-09-18 12:08:24 +01:00