From 1df0c9fe5bb87799fd8c50bb67ddd2c39c04105d Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Thu, 29 Jun 2017 16:15:49 +0200 Subject: [PATCH] cleanup --- stack/middleware.go | 4 ++-- stack/recovery_test.go | 2 +- txs/base_test.go | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/stack/middleware.go b/stack/middleware.go index a1b8e58b7..509a57760 100644 --- a/stack/middleware.go +++ b/stack/middleware.go @@ -46,9 +46,9 @@ type Stack struct { var _ basecoin.Handler = &Stack{} -// NewStack prepares a middleware stack, you must `.Use()` a Handler +// New prepares a middleware stack, you must `.Use()` a Handler // before you can execute it. -func NewStack(middlewares ...Middleware) *Stack { +func New(middlewares ...Middleware) *Stack { return &Stack{ middles: middlewares, } diff --git a/stack/recovery_test.go b/stack/recovery_test.go index 1b55087dc..c4d359dd1 100644 --- a/stack/recovery_test.go +++ b/stack/recovery_test.go @@ -32,7 +32,7 @@ func TestRecovery(t *testing.T) { i := strconv.Itoa(idx) fail := PanicHandler{Msg: tc.msg, Err: tc.err} rec := Recovery{} - app := NewStack(rec).Use(fail) + app := New(rec).Use(fail) // make sure check returns error, not a panic crash _, err := app.CheckTx(ctx, store, tx) diff --git a/txs/base_test.go b/txs/base_test.go index 529c632d9..8a29d822a 100644 --- a/txs/base_test.go +++ b/txs/base_test.go @@ -20,7 +20,10 @@ func TestEncoding(t *testing.T) { raw := NewRaw([]byte{0x34, 0xa7}).Wrap() raw2 := NewRaw([]byte{0x73, 0x86, 0x22}).Wrap() coin := types.Coin{Denom: "atom", Amount: 123} - addr := []byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef} + addr := basecoin.Actor{ + App: "cash", + Address: []byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef}, + } cases := []struct { Tx basecoin.Tx