|
|
@ -22,6 +22,7 @@ func TestInquirerValidPath(t *testing.T) { |
|
|
|
|
|
|
|
// construct a bunch of commits, each with one more height than the last
|
|
|
|
chainID := "inquiry-test" |
|
|
|
consHash := []byte("params") |
|
|
|
count := 50 |
|
|
|
commits := make([]lite.FullCommit, count) |
|
|
|
for i := 0; i < count; i++ { |
|
|
@ -30,7 +31,7 @@ func TestInquirerValidPath(t *testing.T) { |
|
|
|
vals := keys.ToValidators(vote, 0) |
|
|
|
h := int64(20 + 10*i) |
|
|
|
appHash := []byte(fmt.Sprintf("h=%d", h)) |
|
|
|
commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, 0, len(keys)) |
|
|
|
commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, consHash, 0, len(keys)) |
|
|
|
} |
|
|
|
|
|
|
|
// initialize a certifier with the initial state
|
|
|
@ -69,6 +70,7 @@ func TestInquirerMinimalPath(t *testing.T) { |
|
|
|
|
|
|
|
// construct a bunch of commits, each with one more height than the last
|
|
|
|
chainID := "minimal-path" |
|
|
|
consHash := []byte("other-params") |
|
|
|
count := 12 |
|
|
|
commits := make([]lite.FullCommit, count) |
|
|
|
for i := 0; i < count; i++ { |
|
|
@ -77,7 +79,7 @@ func TestInquirerMinimalPath(t *testing.T) { |
|
|
|
vals := keys.ToValidators(vote, 0) |
|
|
|
h := int64(5 + 10*i) |
|
|
|
appHash := []byte(fmt.Sprintf("h=%d", h)) |
|
|
|
commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, 0, len(keys)) |
|
|
|
commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, consHash, 0, len(keys)) |
|
|
|
} |
|
|
|
|
|
|
|
// initialize a certifier with the initial state
|
|
|
@ -117,6 +119,7 @@ func TestInquirerVerifyHistorical(t *testing.T) { |
|
|
|
// construct a bunch of commits, each with one more height than the last
|
|
|
|
chainID := "inquiry-test" |
|
|
|
count := 10 |
|
|
|
consHash := []byte("special-params") |
|
|
|
commits := make([]lite.FullCommit, count) |
|
|
|
for i := 0; i < count; i++ { |
|
|
|
// extend the keys by 1 each time
|
|
|
@ -124,7 +127,7 @@ func TestInquirerVerifyHistorical(t *testing.T) { |
|
|
|
vals := keys.ToValidators(vote, 0) |
|
|
|
h := int64(20 + 10*i) |
|
|
|
appHash := []byte(fmt.Sprintf("h=%d", h)) |
|
|
|
commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, 0, len(keys)) |
|
|
|
commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, consHash, 0, len(keys)) |
|
|
|
} |
|
|
|
|
|
|
|
// initialize a certifier with the initial state
|
|
|
|