Move client context initialization from viper to separate package
This commit is contained in:
+3
-3
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/core"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -32,7 +32,7 @@ func blockCommand() *cobra.Command {
|
||||
|
||||
func getBlock(height *int64) ([]byte, error) {
|
||||
// get the node
|
||||
ctx := core.NewCoreContextFromViper()
|
||||
ctx := context.NewCoreContextFromViper()
|
||||
node, err := ctx.GetNode()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -57,7 +57,7 @@ func getBlock(height *int64) ([]byte, error) {
|
||||
}
|
||||
|
||||
func GetChainHeight() (int64, error) {
|
||||
node, err := core.NewCoreContextFromViper().GetNode()
|
||||
node, err := context.NewCoreContextFromViper().GetNode()
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
wire "github.com/tendermint/go-wire"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/core"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@ func statusCommand() *cobra.Command {
|
||||
|
||||
func getNodeStatus() (*ctypes.ResultStatus, error) {
|
||||
// get the node
|
||||
node, err := core.NewCoreContextFromViper().GetNode()
|
||||
node, err := context.NewCoreContextFromViper().GetNode()
|
||||
if err != nil {
|
||||
return &ctypes.ResultStatus{}, err
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/core"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
)
|
||||
|
||||
func validatorCommand() *cobra.Command {
|
||||
@@ -27,7 +27,7 @@ func validatorCommand() *cobra.Command {
|
||||
|
||||
func GetValidators(height *int64) ([]byte, error) {
|
||||
// get the node
|
||||
node, err := core.NewCoreContextFromViper().GetNode()
|
||||
node, err := context.NewCoreContextFromViper().GetNode()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user