MakePartSet takes partSize from config. fix replay test

This commit is contained in:
Jae Kwon
2016-09-16 09:20:07 -07:00
committed by Ethan Buchman
parent 95c8bb4252
commit d83fc02597
16 changed files with 102 additions and 67 deletions

View File

@ -14,10 +14,6 @@ import (
"github.com/tendermint/go-wire"
)
const (
partSize = 65536 // 64KB ... 4096 // 4KB
)
var (
ErrPartSetUnexpectedIndex = errors.New("Error part set unexpected index")
ErrPartSetInvalidProof = errors.New("Error part set invalid proof")
@ -95,7 +91,7 @@ type PartSet struct {
// Returns an immutable, full PartSet from the data bytes.
// The data bytes are split into "partSize" chunks, and merkle tree computed.
func NewPartSetFromData(data []byte) *PartSet {
func NewPartSetFromData(data []byte, partSize int) *PartSet {
// divide data into 4kb parts.
total := (len(data) + partSize - 1) / partSize
parts := make([]*Part, total)