Skip to content

Commit

Permalink
implements ConsensusTimeoutsInfo for baseRPCClient
Browse files Browse the repository at this point in the history
  • Loading branch information
staheri14 committed Oct 7, 2024
1 parent 6f88a30 commit 3f8320f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rpc/client/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"
"time"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/bytes"
cmtjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
Expand Down Expand Up @@ -388,6 +389,15 @@ func (c *baseRPCClient) BlockchainInfo(
return result, nil
}

func (c *baseRPCClient) ConsensusTimeoutsInfo(ctx context.Context, heightPtr int64) (*abci.TimeoutsInfo, error) {
result := new(abci.TimeoutsInfo)
_, err := c.caller.Call(ctx, "timeout", map[string]interface{}{"height": heightPtr}, result)
if err != nil {
return nil, err
}
return result, nil
}

func (c *baseRPCClient) Genesis(ctx context.Context) (*ctypes.ResultGenesis, error) {
result := new(ctypes.ResultGenesis)
_, err := c.caller.Call(ctx, "genesis", map[string]interface{}{}, result)
Expand Down
2 changes: 2 additions & 0 deletions rpc/client/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ implementation.
import (
"context"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/bytes"
"github.com/tendermint/tendermint/libs/service"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
Expand Down Expand Up @@ -116,6 +117,7 @@ type HistoryClient interface {
Genesis(context.Context) (*ctypes.ResultGenesis, error)
GenesisChunked(context.Context, uint) (*ctypes.ResultGenesisChunk, error)
BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)
ConsensusTimeoutsInfo(ctx context.Context, heightPtr int64) (*abci.TimeoutsInfo, error)
}

// StatusClient provides access to general chain info.
Expand Down

0 comments on commit 3f8320f

Please sign in to comment.