fix tests

This commit is contained in:
Ethan Buchman 2017-09-22 00:10:13 -04:00
parent f279171a28
commit 318345f996
3 changed files with 10 additions and 10 deletions

View File

@ -37,7 +37,7 @@ func TestChainAware(t *testing.T) {
hash := []byte("fake block hash") hash := []byte("fake block hash")
header := &types.Header{} header := &types.Header{}
for i := uint64(0); i < n; i++ { for i := uint64(0); i < n; i++ {
client.BeginBlockSync(&types.RequestBeginBlock{hash, header}) client.BeginBlockSync(types.RequestBeginBlock{hash, header})
client.EndBlockSync(i) client.EndBlockSync(i)
client.CommitSync() client.CommitSync()
} }

View File

@ -91,7 +91,7 @@ func TestPersistentDummyInfo(t *testing.T) {
header := &types.Header{ header := &types.Header{
Height: uint64(height), Height: uint64(height),
} }
dummy.BeginBlock(hash, header) dummy.BeginBlock(types.RequestBeginBlock{hash, header})
dummy.EndBlock(height) dummy.EndBlock(height)
dummy.Commit() dummy.Commit()
@ -120,7 +120,7 @@ func TestValSetChanges(t *testing.T) {
vals[i] = &types.Validator{pubkey, uint64(power)} vals[i] = &types.Validator{pubkey, uint64(power)}
} }
// iniitalize with the first nInit // iniitalize with the first nInit
dummy.InitChain(vals[:nInit]) dummy.InitChain(types.RequestInitChain{vals[:nInit]})
vals1, vals2 := vals[:nInit], dummy.Validators() vals1, vals2 := vals[:nInit], dummy.Validators()
valsEqual(t, vals1, vals2) valsEqual(t, vals1, vals2)
@ -180,7 +180,7 @@ func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff [
Height: height, Height: height,
} }
dummy.BeginBlock(hash, header) dummy.BeginBlock(types.RequestBeginBlock{hash, header})
for _, tx := range txs { for _, tx := range txs {
if r := dummy.DeliverTx(tx); r.IsErr() { if r := dummy.DeliverTx(tx); r.IsErr() {
t.Fatal(r) t.Fatal(r)

View File

@ -49,21 +49,21 @@ func ToRequestCommit() *Request {
} }
} }
func ToRequestQuery(reqQuery RequestQuery) *Request { func ToRequestQuery(req RequestQuery) *Request {
return &Request{ return &Request{
Value: &Request_Query{&reqQuery}, Value: &Request_Query{&req},
} }
} }
func ToRequestInitChain(reqInitChain RequestInitChain) *Request { func ToRequestInitChain(req RequestInitChain) *Request {
return &Request{ return &Request{
Value: &Request_InitChain{&reqInitChain}, Value: &Request_InitChain{&req},
} }
} }
func ToRequestBeginBlock(reqBeginBlock RequestBeginBlock) *Request { func ToRequestBeginBlock(req RequestBeginBlock) *Request {
return &Request{ return &Request{
Value: &Request_BeginBlock{&reqBeginBlock}, Value: &Request_BeginBlock{&req},
} }
} }