Don't allow duplicates for light client providers (#7781)

* Allow for zero witness providers

* Verify provider duplicates, fix tests

* Add duplicate provider ID to the error

* Return error on attempt to remove last witness

* Verify duplicates when restoring from store
This commit is contained in:
Anca Zamfir
2022-02-08 22:09:10 +01:00
committed by GitHub
parent fd50d90b70
commit 27ccf3b590
9 changed files with 165 additions and 120 deletions
+1 -2
View File
@@ -11,7 +11,6 @@ import (
"github.com/tendermint/tendermint/abci/example/kvstore"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/light"
"github.com/tendermint/tendermint/light/provider"
httpp "github.com/tendermint/tendermint/light/provider/http"
dbs "github.com/tendermint/tendermint/light/store/db"
rpctest "github.com/tendermint/tendermint/rpc/test"
@@ -74,7 +73,7 @@ func ExampleClient() {
Hash: block.Hash(),
},
primary,
[]provider.Provider{primary}, // NOTE: primary should not be used here
nil,
dbs.New(db),
light.Logger(logger),
)