mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-31 15:11:21 +00:00
* follow up to removing some consensus params Refs #2382
* change args type to int64 in state#makeParams
* make valsCount and evidenceCount ints again
* MaxEvidenceBytesPerBlock: include magic number in godoc
* [spec] creating a proposal
* test state#TxFilter
* panic if MaxDataBytes is less than 0
* fixes after review
* use amino#UvarintSize to calculate overhead
0c74291f3b/encoder.go (L85-L90)
* avoid cyclic imports
* you can do better Go, come on
* remove testdouble package
16 lines
460 B
Go
16 lines
460 B
Go
package state
|
|
|
|
import (
|
|
"github.com/tendermint/tendermint/types"
|
|
)
|
|
|
|
// TxFilter returns a function to filter transactions. The function limits the
|
|
// size of a transaction to the maximum block's data size.
|
|
func TxFilter(state State) func(tx types.Tx) bool {
|
|
maxDataBytes := types.MaxDataBytesUnknownEvidence(
|
|
state.ConsensusParams.BlockSize.MaxBytes,
|
|
state.Validators.Size(),
|
|
)
|
|
return func(tx types.Tx) bool { return int64(len(tx)) <= maxDataBytes }
|
|
}
|