Skip to content

Commit

Permalink
fix: let MockPriv use ed25519 key
Browse files Browse the repository at this point in the history
  • Loading branch information
Woosang Son committed Nov 2, 2020
1 parent d292dc7 commit a1d8c1a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
15 changes: 6 additions & 9 deletions types/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,9 @@ func TestBlockMakePartSetWithEvidence(t *testing.T) {
ev := NewMockEvidence(h, time.Now(), 0, voterSet.Voters[0].Address)
evList := []Evidence{ev}

block := MakeBlock(h, []Tx{Tx("Hello World")}, commit, evList)
bz, _ := cdc.MarshalBinaryLengthPrefixed(block)
blockSize := len(bz)
partSet := block.MakePartSet(512)
partSet := MakeBlock(h, []Tx{Tx("Hello World")}, commit, evList).MakePartSet(512)
assert.NotNil(t, partSet)
assert.Equal(t, int(math.Ceil(float64(blockSize)/512.0)), partSet.Total())
assert.Equal(t, 3, partSet.Total())
}

func TestBlockHashesTo(t *testing.T) {
Expand Down Expand Up @@ -388,8 +385,8 @@ func TestBlockMaxDataBytes(t *testing.T) {
0: {-10, 1, 0, true, 0},
1: {10, 1, 0, true, 0},
2: {865, 1, 0, true, 0},
3: {932, 1, 0, false, 0},
4: {933, 1, 0, false, 1},
3: {900, 1, 0, false, 0},
4: {901, 1, 0, false, 1},
}

for i, tc := range testCases {
Expand Down Expand Up @@ -417,8 +414,8 @@ func TestBlockMaxDataBytesUnknownEvidence(t *testing.T) {
0: {-10, 1, true, 0},
1: {10, 1, true, 0},
2: {961, 1, true, 0},
3: {1035, 1, false, 0},
4: {1036, 1, false, 1},
3: {999, 1, false, 0},
4: {1001, 1, false, 1},
}

for i, tc := range testCases {
Expand Down
2 changes: 1 addition & 1 deletion types/evidence.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

const (
// MaxEvidenceBytes is a maximum size of any evidence (including amino overhead).
MaxEvidenceBytes int64 = 548
MaxEvidenceBytes int64 = 484
)

// ErrEvidenceInvalid wraps a piece of evidence and the error denoting how or why it is invalid.
Expand Down
2 changes: 1 addition & 1 deletion types/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

const (
// MaxVoteBytes is a maximum vote size (including amino overhead).
MaxVoteBytes int64 = 255
MaxVoteBytes int64 = 223
nilVoteStr string = "nil-Vote"
)

Expand Down

0 comments on commit a1d8c1a

Please sign in to comment.