MCPcopy Create free account
hub / github.com/akash-network/node / LatestHeight

Method LatestHeight

testutil/network/network.go:483–494  ·  view source on GitHub ↗

LatestHeight returns the latest height of the network or an error if the query fails or no validators exist.

()

Source from the content-addressed store, hash-verified

481// LatestHeight returns the latest height of the network or an error if the
482// query fails or no validators exist.
483func (n *Network) LatestHeight() (int64, error) {
484 if len(n.Validators) == 0 {
485 return 0, errors.New("no validators available")
486 }
487
488 status, err := n.Validators[0].RPCClient.Status(context.Background())
489 if err != nil {
490 return 0, err
491 }
492
493 return status.SyncInfo.LatestBlockHeight, nil
494}
495
496// WaitForHeight performs a blocking check where it waits for a block to be
497// committed after a given block. If that height is not reached within a timeout,

Callers 2

WaitForNextBlockMethod · 0.95
WaitForBlocksMethod · 0.95

Calls 1

StatusMethod · 0.80

Tested by

no test coverage detected