You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
675 B

  1. package checktx
  2. import (
  3. "github.com/tendermint/tendermint/abci/example/kvstore"
  4. "github.com/tendermint/tendermint/config"
  5. mempl "github.com/tendermint/tendermint/mempool"
  6. "github.com/tendermint/tendermint/proxy"
  7. )
  8. var mempool mempl.Mempool
  9. func init() {
  10. app := kvstore.NewApplication()
  11. cc := proxy.NewLocalClientCreator(app)
  12. appConnMem, _ := cc.NewABCIClient()
  13. err := appConnMem.Start()
  14. if err != nil {
  15. panic(err)
  16. }
  17. cfg := config.DefaultMempoolConfig()
  18. cfg.Broadcast = false
  19. mempool = mempl.NewCListMempool(cfg, appConnMem, 0)
  20. }
  21. func Fuzz(data []byte) int {
  22. err := mempool.CheckTx(data, nil, mempl.TxInfo{})
  23. if err != nil {
  24. return 0
  25. }
  26. return 1
  27. }