Merge PR #1358: Fix typos and gofmt files

* Fix typos
* gofmt -s files
* Add mispellings and gofmt checks to circle CI
* circleci: Install misspell in the linting step
This commit is contained in:
Dev Ojha 2018-06-25 11:23:17 -07:00 committed by Christopher Goes
parent eb097c4c5c
commit 2e97baabf6
11 changed files with 30 additions and 30 deletions

View File

@ -62,12 +62,13 @@ jobs:
command: |
export PATH="$GOBIN:$PATH"
make get_tools
go get -u github.com/client9/misspell/cmd/misspell
- run:
name: Lint source
command: |
export PATH="$GOBIN:$PATH"
gometalinter.v2 --disable-all --enable='golint' --vendor ./...
gometalinter.v2 --disable-all --enable='golint' --enable='misspell' --vendor ./...
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
test_unit:
<<: *defaults
parallelism: 1

View File

@ -22,6 +22,7 @@ FEATURES
* Delegators delegate votes to validator by default but can override (for their stake)
* [tools] make get_tools installs tendermint's linter, and gometalinter
* [tools] Switch gometalinter to the stable version
* [tools] Add checking for misspellings and for incorrectly formatted files in circle CI
* [server] Default config now creates a profiler at port 6060, and increase p2p send/recv rates
FIXES

View File

@ -179,7 +179,7 @@ func (app *BaseApp) LastCommitID() sdk.CommitID {
return app.cms.LastCommitID()
}
// the last commited block height
// the last committed block height
func (app *BaseApp) LastBlockHeight() int64 {
return app.cms.LastCommitID().Version
}

View File

@ -236,7 +236,7 @@ func TestCoinSend(t *testing.T) {
receiveAddr, resultTx := doSend(t, port, seed, name, password, addr)
tests.WaitForHeight(resultTx.Height+1, port)
// check if tx was commited
// check if tx was committed
assert.Equal(t, uint32(0), resultTx.CheckTx.Code)
assert.Equal(t, uint32(0), resultTx.DeliverTx.Code)
@ -271,7 +271,7 @@ func TestIBCTransfer(t *testing.T) {
tests.WaitForHeight(resultTx.Height+1, port)
// check if tx was commited
// check if tx was committed
assert.Equal(t, uint32(0), resultTx.CheckTx.Code)
assert.Equal(t, uint32(0), resultTx.DeliverTx.Code)
@ -387,7 +387,7 @@ func TestBonding(t *testing.T) {
resultTx := doBond(t, port, seed, name, password, addr, validator1Owner)
tests.WaitForHeight(resultTx.Height+1, port)
// check if tx was commited
// check if tx was committed
assert.Equal(t, uint32(0), resultTx.CheckTx.Code)
assert.Equal(t, uint32(0), resultTx.DeliverTx.Code)
@ -412,7 +412,7 @@ func TestBonding(t *testing.T) {
bond = getDelegation(t, port, addr, validator1Owner)
assert.Equal(t, "30/1", bond.Shares.String())
// check if tx was commited
// check if tx was committed
assert.Equal(t, uint32(0), resultTx.CheckTx.Code)
assert.Equal(t, uint32(0), resultTx.DeliverTx.Code)
@ -434,7 +434,7 @@ func TestSubmitProposal(t *testing.T) {
resultTx := doSubmitProposal(t, port, seed, name, password, addr)
tests.WaitForHeight(resultTx.Height+1, port)
// check if tx was commited
// check if tx was committed
assert.Equal(t, uint32(0), resultTx.CheckTx.Code)
assert.Equal(t, uint32(0), resultTx.DeliverTx.Code)
@ -456,7 +456,7 @@ func TestDeposit(t *testing.T) {
resultTx := doSubmitProposal(t, port, seed, name, password, addr)
tests.WaitForHeight(resultTx.Height+1, port)
// check if tx was commited
// check if tx was committed
assert.Equal(t, uint32(0), resultTx.CheckTx.Code)
assert.Equal(t, uint32(0), resultTx.DeliverTx.Code)
@ -486,7 +486,7 @@ func TestVote(t *testing.T) {
resultTx := doSubmitProposal(t, port, seed, name, password, addr)
tests.WaitForHeight(resultTx.Height+1, port)
// check if tx was commited
// check if tx was committed
assert.Equal(t, uint32(0), resultTx.CheckTx.Code)
assert.Equal(t, uint32(0), resultTx.DeliverTx.Code)

View File

@ -100,7 +100,7 @@ func TestMsgQuiz(t *testing.T) {
mock.SignCheckDeliver(t, mapp.BaseApp, []sdk.Msg{setTrendMsg2}, []int64{0}, []int64{4}, true, priv1) // reset the trend
mock.SignCheckDeliver(t, mapp.BaseApp, []sdk.Msg{quizMsg1}, []int64{0}, []int64{5}, false, priv1) // the same answer will nolonger do!
mock.CheckBalance(t, mapp, addr1, sdk.Coins{{"icecold", sdk.NewInt(138)}})
mock.SignCheckDeliver(t, mapp.BaseApp, []sdk.Msg{quizMsg2}, []int64{0}, []int64{6}, true, priv1) // earlier answer now relavent again
mock.SignCheckDeliver(t, mapp.BaseApp, []sdk.Msg{quizMsg2}, []int64{0}, []int64{6}, true, priv1) // earlier answer now relevant again
mock.CheckBalance(t, mapp, addr1, sdk.Coins{{"badvibesonly", sdk.NewInt(69)}, {"icecold", sdk.NewInt(138)}})
mock.SignCheckDeliver(t, mapp.BaseApp, []sdk.Msg{setTrendMsg3}, []int64{0}, []int64{7}, false, priv1) // expect to fail to set the trend to something which is not cool
}

View File

@ -170,9 +170,9 @@ func TestIAVLSubspaceIterator(t *testing.T) {
iter = sdk.KVStorePrefixIterator(iavlStore, []byte{byte(55), byte(255), byte(255)})
expected2 := [][]byte{
[]byte{byte(55), byte(255), byte(255), byte(0)},
[]byte{byte(55), byte(255), byte(255), byte(1)},
[]byte{byte(55), byte(255), byte(255), byte(255)},
{byte(55), byte(255), byte(255), byte(0)},
{byte(55), byte(255), byte(255), byte(1)},
{byte(55), byte(255), byte(255), byte(255)},
}
for i = 0; iter.Valid(); iter.Next() {
expectedKey := expected2[i]
@ -185,9 +185,9 @@ func TestIAVLSubspaceIterator(t *testing.T) {
iter = sdk.KVStorePrefixIterator(iavlStore, []byte{byte(255), byte(255)})
expected2 = [][]byte{
[]byte{byte(255), byte(255), byte(0)},
[]byte{byte(255), byte(255), byte(1)},
[]byte{byte(255), byte(255), byte(255)},
{byte(255), byte(255), byte(0)},
{byte(255), byte(255), byte(1)},
{byte(255), byte(255), byte(255)},
}
for i = 0; iter.Valid(); iter.Next() {
expectedKey := expected2[i]
@ -229,9 +229,9 @@ func TestIAVLReverseSubspaceIterator(t *testing.T) {
iter = sdk.KVStoreReversePrefixIterator(iavlStore, []byte{byte(55), byte(255), byte(255)})
expected2 := [][]byte{
[]byte{byte(55), byte(255), byte(255), byte(255)},
[]byte{byte(55), byte(255), byte(255), byte(1)},
[]byte{byte(55), byte(255), byte(255), byte(0)},
{byte(55), byte(255), byte(255), byte(255)},
{byte(55), byte(255), byte(255), byte(1)},
{byte(55), byte(255), byte(255), byte(0)},
}
for i = 0; iter.Valid(); iter.Next() {
expectedKey := expected2[i]
@ -244,9 +244,9 @@ func TestIAVLReverseSubspaceIterator(t *testing.T) {
iter = sdk.KVStoreReversePrefixIterator(iavlStore, []byte{byte(255), byte(255)})
expected2 = [][]byte{
[]byte{byte(255), byte(255), byte(255)},
[]byte{byte(255), byte(255), byte(1)},
[]byte{byte(255), byte(255), byte(0)},
{byte(255), byte(255), byte(255)},
{byte(255), byte(255), byte(1)},
{byte(255), byte(255), byte(0)},
}
for i = 0; iter.Valid(); iter.Next() {
expectedKey := expected2[i]

View File

@ -77,7 +77,7 @@ func CodeToDefaultMsg(code CodeType) string {
case CodeUnauthorized:
return "unauthorized"
case CodeInsufficientFunds:
return "insufficent funds"
return "insufficient funds"
case CodeUnknownRequest:
return "unknown request"
case CodeInvalidAddress:

View File

@ -1,7 +1,5 @@
package types
import ()
// Gas measured by the SDK
type Gas = int64

View File

@ -34,7 +34,7 @@ func (tx StdTx) GetMsgs() []sdk.Msg { return tx.Msgs }
// Addresses are returned in a determistic order.
// They are accumulated from the GetSigners method for each Msg
// in the order they appear in tx.GetMsgs().
// Duplicate addresses will be ommitted.
// Duplicate addresses will be omitted.
func (tx StdTx) GetSigners() []sdk.Address {
seen := map[string]bool{}
var signers []sdk.Address

View File

@ -132,13 +132,13 @@ func TestMsgSendValidation(t *testing.T) {
}{
{false, MsgSend{}}, // no input or output
{false, MsgSend{Inputs: []Input{input1}}}, // just input
{false, MsgSend{Outputs: []Output{output1}}}, // just ouput
{false, MsgSend{Outputs: []Output{output1}}}, // just output
{false, MsgSend{
Inputs: []Input{NewInput(emptyAddr, atom123)}, // invalid input
Outputs: []Output{output1}}},
{false, MsgSend{
Inputs: []Input{input1},
Outputs: []Output{{emptyAddr, atom123}}}, // invalid ouput
Outputs: []Output{{emptyAddr, atom123}}}, // invalid output
},
{false, MsgSend{
Inputs: []Input{input1},

View File

@ -243,7 +243,7 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID int64, depositerAddr
return ErrAlreadyFinishedProposal(keeper.codespace, proposalID), false
}
// Subtract coins from depositers account
// Subtract coins from depositer's account
_, _, err := keeper.ck.SubtractCoins(ctx, depositerAddr, depositAmount)
if err != nil {
return err, false