+3
-2
@@ -1,6 +1,7 @@
|
||||
package rpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@@ -62,7 +63,7 @@ func getBlock(clientCtx client.Context, height *int64) ([]byte, error) {
|
||||
// header -> BlockchainInfo
|
||||
// header, tx -> Block
|
||||
// results -> BlockResults
|
||||
res, err := node.Block(height)
|
||||
res, err := node.Block(context.Background(), height)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -77,7 +78,7 @@ func GetChainHeight(clientCtx client.Context) (int64, error) {
|
||||
return -1, err
|
||||
}
|
||||
|
||||
status, err := node.Status()
|
||||
status, err := node.Status(context.Background())
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package rpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
@@ -51,7 +52,7 @@ func getNodeStatus(clientCtx client.Context) (*ctypes.ResultStatus, error) {
|
||||
return &ctypes.ResultStatus{}, err
|
||||
}
|
||||
|
||||
return node.Status()
|
||||
return node.Status(context.Background())
|
||||
}
|
||||
|
||||
// NodeInfoResponse defines a response type that contains node status and version
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package rpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@@ -119,7 +120,7 @@ func GetValidators(clientCtx client.Context, height *int64, page, limit *int) (R
|
||||
return ResultValidatorsOutput{}, err
|
||||
}
|
||||
|
||||
validatorsRes, err := node.Validators(height, page, limit)
|
||||
validatorsRes, err := node.Validators(context.Background(), height, page, limit)
|
||||
if err != nil {
|
||||
return ResultValidatorsOutput{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user