mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-25 09:24:30 +00:00
light: return light client status on rpc /status (#7536)
*light: rpc /status returns status of light client ; code refactoring light: moved lightClientInfo into light.go, renamed String to ID test/e2e: Return light client trusted height instead of SyncInfo trusted height test/e2e/start.go: Not waiting for light client to catch up in tests. Removed querying of syncInfo in start if the node is a light node * light: Removed call to primary /status. Added trustedPeriod to light info * light/provider: added ID function to return IP of primary and witnesses * light/provider/http/http_test: renamed String() to ID()
This commit is contained in:
@@ -100,7 +100,8 @@ func NewWithClientAndOptions(chainID string, client rpcclient.RemoteClient, opti
|
||||
}
|
||||
}
|
||||
|
||||
func (p *http) String() string {
|
||||
// Identifies the provider with an IP in string format
|
||||
func (p *http) ID() string {
|
||||
return fmt.Sprintf("http{%s}", p.client.Remote())
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package http_test
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -22,15 +21,15 @@ import (
|
||||
func TestNewProvider(t *testing.T) {
|
||||
c, err := lighthttp.New("chain-test", "192.168.0.1:26657")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, fmt.Sprintf("%s", c), "http{http://192.168.0.1:26657}")
|
||||
require.Equal(t, c.ID(), "http{http://192.168.0.1:26657}")
|
||||
|
||||
c, err = lighthttp.New("chain-test", "http://153.200.0.1:26657")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, fmt.Sprintf("%s", c), "http{http://153.200.0.1:26657}")
|
||||
require.Equal(t, c.ID(), "http{http://153.200.0.1:26657}")
|
||||
|
||||
c, err = lighthttp.New("chain-test", "153.200.0.1")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, fmt.Sprintf("%s", c), "http{http://153.200.0.1}")
|
||||
require.Equal(t, c.ID(), "http{http://153.200.0.1}")
|
||||
}
|
||||
|
||||
func TestProvider(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user