diff --git a/examples/basecoin/app/app_test.go b/examples/basecoin/app/app_test.go index 20985fa32..49eb580fd 100644 --- a/examples/basecoin/app/app_test.go +++ b/examples/basecoin/app/app_test.go @@ -53,14 +53,21 @@ func TestSendMsg(t *testing.T) { Signature: sig, }}) + // just marshal/unmarshal! + cdc := MakeTxCodec() + txBytes, err := cdc.MarshalBinary(tx) + require.NoError(t, err) + // Run a Check - res := bapp.Check(tx) - assert.Equal(t, sdk.CodeUnrecognizedAddress, res.Code, res.Log) + cres := bapp.CheckTx(txBytes) + assert.Equal(t, sdk.CodeUnrecognizedAddress, + sdk.CodeType(cres.Code), cres.Log) // Simulate a Block bapp.BeginBlock(abci.RequestBeginBlock{}) - res = bapp.Deliver(tx) - assert.Equal(t, sdk.CodeUnrecognizedAddress, res.Code, res.Log) + dres := bapp.DeliverTx(txBytes) + assert.Equal(t, sdk.CodeUnrecognizedAddress, + sdk.CodeType(dres.Code), dres.Log) } func TestGenesis(t *testing.T) { diff --git a/examples/basecoin/cmd/basecli/sendtx.go b/examples/basecoin/cmd/basecli/sendtx.go index add8c27eb..b81f898d5 100644 --- a/examples/basecoin/cmd/basecli/sendtx.go +++ b/examples/basecoin/cmd/basecli/sendtx.go @@ -64,24 +64,7 @@ func sendTx(cmd *cobra.Command, args []string) error { result.DeliverTx.Log) } - fmt.Printf("Result: %#v\n", result) - - // // parse out the value - // acct := new(types.AppAccount) - // cdc := app.MakeTxCodec() - // err = cdc.UnmarshalBinary(resp.Value, acct) - // if err != nil { - // return err - // } - - // // TODO: better - // // fmt.Printf("Account: %#v\n", acct) - // output, err := json.MarshalIndent(acct, "", " ") - // // output, err := json.MarshalIndent(acct.BaseAccount.Coins, "", " ") - // if err != nil { - // return err - // } - // fmt.Println(string(output)) + fmt.Printf("Committed at block %d. Hash: %s\n", result.Height, result.Hash.String()) return nil }