Clean up sendtx example
This commit is contained in:
parent
f481900b23
commit
67e896dcaf
|
@ -53,14 +53,21 @@ func TestSendMsg(t *testing.T) {
|
||||||
Signature: sig,
|
Signature: sig,
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
// just marshal/unmarshal!
|
||||||
|
cdc := MakeTxCodec()
|
||||||
|
txBytes, err := cdc.MarshalBinary(tx)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Run a Check
|
// Run a Check
|
||||||
res := bapp.Check(tx)
|
cres := bapp.CheckTx(txBytes)
|
||||||
assert.Equal(t, sdk.CodeUnrecognizedAddress, res.Code, res.Log)
|
assert.Equal(t, sdk.CodeUnrecognizedAddress,
|
||||||
|
sdk.CodeType(cres.Code), cres.Log)
|
||||||
|
|
||||||
// Simulate a Block
|
// Simulate a Block
|
||||||
bapp.BeginBlock(abci.RequestBeginBlock{})
|
bapp.BeginBlock(abci.RequestBeginBlock{})
|
||||||
res = bapp.Deliver(tx)
|
dres := bapp.DeliverTx(txBytes)
|
||||||
assert.Equal(t, sdk.CodeUnrecognizedAddress, res.Code, res.Log)
|
assert.Equal(t, sdk.CodeUnrecognizedAddress,
|
||||||
|
sdk.CodeType(dres.Code), dres.Log)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGenesis(t *testing.T) {
|
func TestGenesis(t *testing.T) {
|
||||||
|
|
|
@ -64,24 +64,7 @@ func sendTx(cmd *cobra.Command, args []string) error {
|
||||||
result.DeliverTx.Log)
|
result.DeliverTx.Log)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Result: %#v\n", result)
|
fmt.Printf("Committed at block %d. Hash: %s\n", result.Height, result.Hash.String())
|
||||||
|
|
||||||
// // 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))
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue