'make format'
This commit is contained in:
parent
a9d9eb578c
commit
234262160e
|
@ -6,6 +6,7 @@ import (
|
||||||
"github.com/tendermint/tendermint/crypto"
|
"github.com/tendermint/tendermint/crypto"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
@ -13,7 +14,6 @@ import (
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"github.com/tendermint/tendermint/crypto/multisig"
|
"github.com/tendermint/tendermint/crypto/multisig"
|
||||||
"github.com/tendermint/tendermint/libs/cli"
|
"github.com/tendermint/tendermint/libs/cli"
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
keys "github.com/cosmos/cosmos-sdk/crypto/keys"
|
keys "github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func updateKeyCommand() *cobra.Command {
|
func updateKeyCommand() *cobra.Command {
|
||||||
|
|
|
@ -77,7 +77,7 @@ func ReadPassphraseFromStdin(name string) (string, error) {
|
||||||
|
|
||||||
// TODO make keybase take a database not load from the directory
|
// TODO make keybase take a database not load from the directory
|
||||||
|
|
||||||
// GetKeyBase initializes a read-only KeyBase based on the configuration.
|
// GetKeyBase initializes a read-only KeyBase based on the configuration.
|
||||||
func GetKeyBase() (keys.Keybase, error) {
|
func GetKeyBase() (keys.Keybase, error) {
|
||||||
rootDir := viper.GetString(cli.HomeFlag)
|
rootDir := viper.GetString(cli.HomeFlag)
|
||||||
return GetKeyBaseFromDir(rootDir)
|
return GetKeyBaseFromDir(rootDir)
|
||||||
|
|
|
@ -16,7 +16,7 @@ func TestGetKeyBaseLocks(t *testing.T) {
|
||||||
// Acquire db
|
// Acquire db
|
||||||
kb, err := GetKeyBaseFromDirWithWritePerm(dir)
|
kb, err := GetKeyBaseFromDirWithWritePerm(dir)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
_, _, err = kb.CreateMnemonic("foo", keys.English, "12345678", keys.Secp256k1)
|
_, _, err = kb.CreateMnemonic("foo", keys.English, "12345678", keys.Secp256k1)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
// Reset global variable
|
// Reset global variable
|
||||||
keybase = nil
|
keybase = nil
|
||||||
|
|
|
@ -15,11 +15,11 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys/mintkey"
|
"github.com/cosmos/cosmos-sdk/crypto/keys/mintkey"
|
||||||
"github.com/cosmos/cosmos-sdk/types"
|
"github.com/cosmos/cosmos-sdk/types"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
||||||
tmcrypto "github.com/tendermint/tendermint/crypto"
|
tmcrypto "github.com/tendermint/tendermint/crypto"
|
||||||
"github.com/tendermint/tendermint/crypto/encoding/amino"
|
"github.com/tendermint/tendermint/crypto/encoding/amino"
|
||||||
"github.com/tendermint/tendermint/crypto/secp256k1"
|
"github.com/tendermint/tendermint/crypto/secp256k1"
|
||||||
dbm "github.com/tendermint/tendermint/libs/db"
|
dbm "github.com/tendermint/tendermint/libs/db"
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ Keybase = dbKeybase{}
|
var _ Keybase = dbKeybase{}
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"github.com/tendermint/tendermint/crypto/encoding/amino"
|
"github.com/tendermint/tendermint/crypto/encoding/amino"
|
||||||
"github.com/tendermint/tendermint/crypto/xsalsa20symmetric"
|
"github.com/tendermint/tendermint/crypto/xsalsa20symmetric"
|
||||||
|
|
||||||
cmn "github.com/tendermint/tendermint/libs/common"
|
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
||||||
|
cmn "github.com/tendermint/tendermint/libs/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/context"
|
"github.com/cosmos/cosmos-sdk/client/context"
|
||||||
"github.com/cosmos/cosmos-sdk/client/utils"
|
"github.com/cosmos/cosmos-sdk/client/utils"
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||||
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys/keyerror"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// SignBody defines the properties of a sign request's body.
|
// SignBody defines the properties of a sign request's body.
|
||||||
|
|
|
@ -15,9 +15,9 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/x/gov/client"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"github.com/cosmos/cosmos-sdk/x/gov/client"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -10,9 +10,9 @@ import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/x/gov"
|
"github.com/cosmos/cosmos-sdk/x/gov"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/x/gov/client"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/cosmos/cosmos-sdk/x/gov/client"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// REST Variable names
|
// REST Variable names
|
||||||
|
@ -41,12 +41,12 @@ func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec)
|
||||||
}
|
}
|
||||||
|
|
||||||
type postProposalReq struct {
|
type postProposalReq struct {
|
||||||
BaseReq utils.BaseReq `json:"base_req"`
|
BaseReq utils.BaseReq `json:"base_req"`
|
||||||
Title string `json:"title"` // Title of the proposal
|
Title string `json:"title"` // Title of the proposal
|
||||||
Description string `json:"description"` // Description of the proposal
|
Description string `json:"description"` // Description of the proposal
|
||||||
ProposalType string `json:"proposal_type"` // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal}
|
ProposalType string `json:"proposal_type"` // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal}
|
||||||
Proposer sdk.AccAddress `json:"proposer"` // Address of the proposer
|
Proposer sdk.AccAddress `json:"proposer"` // Address of the proposer
|
||||||
InitialDeposit sdk.Coins `json:"initial_deposit"` // Coins to add to the proposal's deposit
|
InitialDeposit sdk.Coins `json:"initial_deposit"` // Coins to add to the proposal's deposit
|
||||||
}
|
}
|
||||||
|
|
||||||
type depositReq struct {
|
type depositReq struct {
|
||||||
|
@ -58,7 +58,7 @@ type depositReq struct {
|
||||||
type voteReq struct {
|
type voteReq struct {
|
||||||
BaseReq utils.BaseReq `json:"base_req"`
|
BaseReq utils.BaseReq `json:"base_req"`
|
||||||
Voter sdk.AccAddress `json:"voter"` // address of the voter
|
Voter sdk.AccAddress `json:"voter"` // address of the voter
|
||||||
Option string `json:"option"` // option from OptionSet chosen by the voter
|
Option string `json:"option"` // option from OptionSet chosen by the voter
|
||||||
}
|
}
|
||||||
|
|
||||||
func postProposalHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc {
|
func postProposalHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc {
|
||||||
|
|
|
@ -42,4 +42,3 @@ func NormalizeProposalStatus(status string) string {
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,11 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/context"
|
"github.com/cosmos/cosmos-sdk/client/context"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/utils"
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/cosmos/cosmos-sdk/client/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec) {
|
func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ func registerTxRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec
|
||||||
|
|
||||||
// Unjail TX body
|
// Unjail TX body
|
||||||
type UnjailReq struct {
|
type UnjailReq struct {
|
||||||
BaseReq utils.BaseReq `json:"base_req"`
|
BaseReq utils.BaseReq `json:"base_req"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func unjailRequestHandlerFn(cdc *codec.Codec, kb keys.Keybase, cliCtx context.CLIContext) http.HandlerFunc {
|
func unjailRequestHandlerFn(cdc *codec.Codec, kb keys.Keybase, cliCtx context.CLIContext) http.HandlerFunc {
|
||||||
|
|
Loading…
Reference in New Issue