Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-kosu: update to tm-v0.32.2 #245

Merged
merged 1 commit into from Aug 29, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

go-kosu: update to tm-v0.32.2

  • Loading branch information
gchaincl committed Aug 29, 2019
commit 006cf6266369c0d23194082394f44c93b964061c
@@ -13,8 +13,8 @@ import (
"github.com/tendermint/tendermint/config"
cfg "github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/db"
"github.com/tendermint/tendermint/libs/log"
db "github.com/tendermint/tm-db"

"go-kosu/abci/types"
"go-kosu/store"
@@ -240,9 +240,9 @@ func (app *App) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock {
}

// CheckTx .
func (app *App) CheckTx(req []byte) abci.ResponseCheckTx {
func (app *App) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx {
stx := &types.SignedTransaction{}
if err := types.DecodeTx(req, stx); err != nil {
if err := types.DecodeTx(req.Tx, stx); err != nil {
return abci.ResponseCheckTx{Code: 1, Log: err.Error()}
}
tx := stx.Tx
@@ -282,9 +282,9 @@ func (app *App) CheckTx(req []byte) abci.ResponseCheckTx {
}

// DeliverTx .
func (app *App) DeliverTx(req []byte) abci.ResponseDeliverTx {
func (app *App) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx {
stx := &types.SignedTransaction{}
if err := types.DecodeTx(req, stx); err != nil {
if err := types.DecodeTx(req.Tx, stx); err != nil {
return abci.ResponseDeliverTx{Code: 1, Info: err.Error()}
}
tx := stx.Tx
@@ -11,8 +11,8 @@ import (
"github.com/stretchr/testify/require"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/db"
tmtypes "github.com/tendermint/tendermint/types"
db "github.com/tendermint/tm-db"

"go-kosu/abci/types"
)
@@ -54,7 +54,7 @@ func TestCheckTxSignature(t *testing.T) {
buf, err := types.EncodeTx(tx)
require.NoError(t, err)

res := app.CheckTx(buf)
res := app.CheckTx(abci.RequestCheckTx{Tx: buf})
assert.True(t, res.IsErr())
assert.Contains(t, res.Log, "signature")
}
@@ -69,6 +69,8 @@ func (app *App) deliverOrderTx(tx *types.TransactionOrder) abci.ResponseDeliverT

return abci.ResponseDeliverTx{
Code: 0,
Tags: NewTagsFromOrderInfo(orderID, posterAddress, poster.Limit),
Events: []abci.Event{
{Type: "tags", Attributes: NewTagsFromOrderInfo(orderID, posterAddress, poster.Limit)},
},
}
}
@@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/db"
db "github.com/tendermint/tm-db"
)

var testCases = []struct {
@@ -60,7 +60,9 @@ func TestDeliverOrderTx(t *testing.T) {
buf, err := types.EncodeTx(tx)
require.NoError(t, err)

res := app.DeliverTx(buf)
res := app.DeliverTx(
abci.RequestDeliverTx{Tx: buf},
)

t.Run("AssertCode", func(t *testing.T) {
assert.Equal(t, uint32(1), res.Code,
@@ -91,7 +93,9 @@ func TestDeliverOrderTx(t *testing.T) {
buf, err := types.EncodeTx(tx)
require.NoError(t, err)

res := app.DeliverTx(buf)
res := app.DeliverTx(
abci.RequestDeliverTx{Tx: buf},
)

t.Run("AssertCode", func(t *testing.T) {
assert.Equal(t, abci.CodeTypeOK, res.Code,
@@ -114,7 +118,10 @@ func TestDeliverOrderTx(t *testing.T) {
{Key: []byte("order.poster"), Value: expectedPoster.Bytes()},
{Key: []byte("poster.limit"), Value: []byte("33332")},
}
assert.Equal(t, expectedTags, res.Tags)
expectedEvents := []abci.Event{
{Type: "tags", Attributes: expectedTags},
}
assert.Equal(t, expectedEvents, res.Events)
})
}
}
@@ -38,7 +38,9 @@ func (app *App) deliverRebalance(tx *types.TransactionRebalance) abci.ResponseDe

return abci.ResponseDeliverTx{
Code: 0,
Tags: NewTagsFromRoundInfo(info),
Events: []abci.Event{
{Type: "tags", Attributes: NewTagsFromRoundInfo(info)},
},
}
}

@@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/db"
db "github.com/tendermint/tm-db"
)

func TestDeliverRebalanceTx(t *testing.T) {
@@ -35,7 +35,9 @@ func TestDeliverRebalanceTx(t *testing.T) {
buf, err := types.EncodeTx(tx)
require.NoError(t, err)

res := app.DeliverTx(buf)
res := app.DeliverTx(
abci.RequestDeliverTx{Tx: buf},
)

t.Run("AssertCode", func(t *testing.T) {
assert.Equal(t, abci.CodeTypeOK, res.Code,
@@ -49,7 +51,10 @@ func TestDeliverRebalanceTx(t *testing.T) {
{Key: []byte("round.start"), Value: []byte("100")},
{Key: []byte("round.end"), Value: []byte("110")},
}
assert.Equal(t, expectedTags, res.Tags)
expectedEvents := []abci.Event{
{Type: "tags", Attributes: expectedTags},
}
assert.Equal(t, expectedEvents, res.Events)
})
}

@@ -165,7 +170,7 @@ func deliverRebalance(t *testing.T, app *App, priv []byte, number, start, end ui
buf, err := types.EncodeTx(tx)
require.NoError(t, err)

res := app.DeliverTx(buf)
res := app.DeliverTx(abci.RequestDeliverTx{Tx: buf})

t.Run("AssertCode", func(t *testing.T) {
assert.Equal(t, abci.CodeTypeOK, res.Code,
@@ -7,8 +7,9 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/db"
db "github.com/tendermint/tm-db"
)

func TestDeliverWitnessTx(t *testing.T) {
@@ -39,7 +40,7 @@ func TestDeliverWitnessTx(t *testing.T) {
buf, err := types.EncodeTx(tx)
require.NoError(t, err)

res := app.DeliverTx(buf)
res := app.DeliverTx(abci.RequestDeliverTx{Tx: buf})

log.Printf("res = %+v\n", res)
assert.EqualValues(t, 0, res.Code, res.Log)
@@ -11,8 +11,8 @@ import (
"strings"

"github.com/spf13/cobra"
"github.com/tendermint/tendermint/libs/db"
"github.com/tendermint/tendermint/libs/log"
db "github.com/tendermint/tm-db"

"go-kosu/abci"
"go-kosu/rpc"
@@ -32,16 +32,12 @@ type Config struct {
Web3 string
}

func newDB(dir string, debug bool) (db.DB, error) {
func newDB(dir string) (db.DB, error) {
gdb, err := db.NewGoLevelDB(dbName, dir)
if err != nil {
return nil, err
}

if debug {
return db.NewDebugDB("db", gdb), nil
}

return gdb, nil
}

@@ -69,7 +65,7 @@ func startWitness(ctx context.Context, app *abci.App, ethAddr string, logger log
}

func run(cfg *Config) error {
db, err := newDB(cfg.Home, cfg.Debug)
db, err := newDB(cfg.Home)
if err != nil {
return err
}
@@ -3,41 +3,41 @@ module go-kosu
go 1.12

require (
bou.ke/monkey v1.0.1 // indirect
github.com/allegro/bigcache v1.2.0 // indirect
github.com/aristanetworks/goarista v0.0.0-20190409235741-55bc7be9dd31 // indirect
github.com/btcsuite/btcd v0.0.0-20190427004231-96897255fd17 // indirect
github.com/cespare/cp v1.1.1 // indirect
github.com/cosmos/cosmos-sdk v0.35.0
github.com/cosmos/cosmos-sdk v0.37.0
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/edsrzf/mmap-go v1.0.0 // indirect
github.com/ethereum/go-ethereum v1.8.27
github.com/fjl/memsize v0.0.0-20180929194037-2a09253e352a // indirect
github.com/go-logfmt/logfmt v0.4.0 // indirect
github.com/gogo/protobuf v1.2.1
github.com/golang/protobuf v1.3.2
github.com/google/gofuzz v1.0.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/huin/goupnp v1.0.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.1 // indirect
github.com/karalabe/hid v0.0.0-20181128192157-d815e0c1a2e2 // indirect
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mattn/go-isatty v0.0.7 // indirect
github.com/otiai10/copy v0.0.0-20180813032824-7e9a647135a1 // indirect
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95 // indirect
github.com/otiai10/mint v1.2.3 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/prometheus/common v0.2.0
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a // indirect
github.com/rjeczalik/notify v0.9.2 // indirect
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a
github.com/spf13/cobra v0.0.3
github.com/spf13/cobra v0.0.5
github.com/spf13/viper v1.3.2
github.com/stretchr/testify v1.3.0
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 // indirect
github.com/tendermint/iavl v0.12.2 // indirect
github.com/tendermint/tendermint v0.31.5
github.com/tendermint/tendermint v0.32.2
github.com/tendermint/tm-db v0.1.1
github.com/tidwall/gjson v1.3.0
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734
golang.org/x/net v0.0.0-20190628185345-da137c7871d7 // indirect
golang.org/x/tools v0.0.0-20190703212419-2214986f1668 // indirect
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2 // indirect
google.golang.org/grpc v1.22.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/urfave/cli.v1 v1.20.0 // indirect
)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.