From 8f03b181c7678d15a401bc39a27c14af174c1007 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 13 Mar 2018 11:54:22 +0100 Subject: [PATCH] examples/basecoin/app: fix test by using StdSignDoc --- examples/basecoin/app/app_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/basecoin/app/app_test.go b/examples/basecoin/app/app_test.go index 770437254..c2ef3e454 100644 --- a/examples/basecoin/app/app_test.go +++ b/examples/basecoin/app/app_test.go @@ -23,6 +23,8 @@ import ( // Construct some global addrs and txs for tests. var ( + chainID = "" // TODO + priv1 = crypto.GenPrivKeyEd25519() addr1 = priv1.PubKey().Address() addr2 = crypto.GenPrivKeyEd25519().PubKey().Address() @@ -78,7 +80,6 @@ func TestMsgs(t *testing.T) { {setTrendMsg1}, } - chainID := "" sequences := []int64{0} for i, m := range msgs { sig := priv1.Sign(sdk.StdSignBytes(chainID, sequences, m.msg)) @@ -178,7 +179,6 @@ func TestSendMsgWithAccounts(t *testing.T) { assert.Equal(t, acc1, res1) // Sign the tx - chainID := "" // TODO: InitChain should get the ChainID sequences := []int64{0} sig := priv1.Sign(sdk.StdSignBytes(chainID, sequences, sendMsg)) tx := sdk.NewStdTx(sendMsg, []sdk.StdSignature{{ @@ -272,7 +272,7 @@ func SignCheckDeliver(t *testing.T, bapp *BasecoinApp, msg sdk.Msg, seq int64, e // Sign the tx tx := sdk.NewStdTx(msg, []sdk.StdSignature{{ PubKey: priv1.PubKey(), - Signature: priv1.Sign(msg.GetSignBytes()), + Signature: priv1.Sign(sdk.StdSignBytes(chainID, []int64{seq}, msg)), Sequence: seq, }})