mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 13:55:17 +00:00
lite2: add Start, TrustedValidatorSet funcs (#4337)
* lite2: add Start method There are few reasons to do that: 1) separation of state and dynamics (some users will want to delay starting the light client; does not matter we should not allow them to create a light client object) 2) less important, but some users might not need autoUpdateRoutine and removeNoLongerTrustedHeadersRoutine routines * lite2: wait till routines are finished in Stop because they are started in Start, it feels more natural to wait for them to finish in Stop. * lite2: add TrustedValidatorSet func
This commit is contained in:
@@ -63,6 +63,10 @@ func TestExample_Client_AutoUpdate(t *testing.T) {
|
||||
if err != nil {
|
||||
stdlog.Fatal(err)
|
||||
}
|
||||
err = c.Start()
|
||||
if err != nil {
|
||||
stdlog.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
c.Stop()
|
||||
c.Cleanup()
|
||||
@@ -125,6 +129,10 @@ func TestExample_Client_ManualUpdate(t *testing.T) {
|
||||
if err != nil {
|
||||
stdlog.Fatal(err)
|
||||
}
|
||||
err = c.Start()
|
||||
if err != nil {
|
||||
stdlog.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
c.Stop()
|
||||
c.Cleanup()
|
||||
|
||||
Reference in New Issue
Block a user