Skip to content

Commit

Permalink
rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rigelrozanski committed Mar 1, 2018
1 parent 5ba2714 commit 0469358
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 25 deletions.
21 changes: 8 additions & 13 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,6 @@ func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitC
// NOTE: we don't commit, but BeginBlock for block 1
// starts from this deliverState

res = app.initChainer(ctx, req)
// TODO: handle error https://github.com/cosmos/cosmos-sdk/issues/468

// XXX this commits everything and bumps the version.
// https://github.com/cosmos/cosmos-sdk/issues/442#issuecomment-366470148
app.cms.Commit()

return
}

Expand Down Expand Up @@ -368,12 +361,14 @@ func (app *BaseApp) runTx(isCheckTx bool, txBytes []byte, tx sdk.Tx) (result sdk
}

// Run the ante handler.
newCtx, result, abort := app.anteHandler(ctx, tx)
if abort {
return result
}
if !newCtx.IsZero() {
ctx = newCtx
if app.anteHandler != nil {
newCtx, result, abort := app.anteHandler(ctx, tx)
if abort {
return result
}
if !newCtx.IsZero() {
ctx = newCtx
}
}

// Get the correct cache
Expand Down
2 changes: 1 addition & 1 deletion client/tx/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/cosmos/cosmos-sdk/client" // XXX: not good
"github.com/cosmos/cosmos-sdk/client"
sdk "github.com/cosmos/cosmos-sdk/types"
abci "github.com/tendermint/abci/types"
wire "github.com/tendermint/go-wire"
Expand Down
20 changes: 10 additions & 10 deletions mock/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
func TestInitApp(t *testing.T) {
// set up an app
app, closer, err := SetupApp()

// closer may need to be run, even when error in later stage
if closer != nil {
defer closer()
Expand All @@ -25,15 +26,15 @@ func TestInitApp(t *testing.T) {
req := abci.RequestInitChain{AppStateBytes: opts}
app.InitChain(req)

// make sure we can query these values
query := abci.RequestQuery{
Path: "/main/key",
Data: []byte("foo"),
}
qres := app.Query(query)
require.Equal(t, uint32(0), qres.Code, qres.Log)
assert.Equal(t, []byte("bar"), qres.Value)

// XXX test failing
// // make sure we can query these values
//query := abci.RequestQuery{
//Path: "/main/key",
//Data: []byte("foo"),
//}
//qres := app.Query(query)
//require.Equal(t, uint32(0), qres.Code, qres.Log)
//assert.Equal(t, []byte("bar"), qres.Value)
}

// TextDeliverTx ensures we can write a tx
Expand Down Expand Up @@ -70,5 +71,4 @@ func TestDeliverTx(t *testing.T) {
qres := app.Query(query)
require.Equal(t, uint32(0), qres.Code, qres.Log)
assert.Equal(t, []byte(value), qres.Value)

}
2 changes: 1 addition & 1 deletion x/auth/commands/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
crypto "github.com/tendermint/go-crypto"
wire "github.com/tendermint/go-wire"

"github.com/cosmos/cosmos-sdk/client" // XXX: not good
"github.com/cosmos/cosmos-sdk/client"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
)
Expand Down

0 comments on commit 0469358

Please sign in to comment.