examples/basecoin/app: fix test by using StdSignDoc

This commit is contained in:
Ethan Buchman 2018-03-13 11:54:22 +01:00
parent eea4e8d151
commit 8f03b181c7
1 changed files with 3 additions and 3 deletions

View File

@ -23,6 +23,8 @@ import (
// Construct some global addrs and txs for tests. // Construct some global addrs and txs for tests.
var ( var (
chainID = "" // TODO
priv1 = crypto.GenPrivKeyEd25519() priv1 = crypto.GenPrivKeyEd25519()
addr1 = priv1.PubKey().Address() addr1 = priv1.PubKey().Address()
addr2 = crypto.GenPrivKeyEd25519().PubKey().Address() addr2 = crypto.GenPrivKeyEd25519().PubKey().Address()
@ -78,7 +80,6 @@ func TestMsgs(t *testing.T) {
{setTrendMsg1}, {setTrendMsg1},
} }
chainID := ""
sequences := []int64{0} sequences := []int64{0}
for i, m := range msgs { for i, m := range msgs {
sig := priv1.Sign(sdk.StdSignBytes(chainID, sequences, m.msg)) sig := priv1.Sign(sdk.StdSignBytes(chainID, sequences, m.msg))
@ -178,7 +179,6 @@ func TestSendMsgWithAccounts(t *testing.T) {
assert.Equal(t, acc1, res1) assert.Equal(t, acc1, res1)
// Sign the tx // Sign the tx
chainID := "" // TODO: InitChain should get the ChainID
sequences := []int64{0} sequences := []int64{0}
sig := priv1.Sign(sdk.StdSignBytes(chainID, sequences, sendMsg)) sig := priv1.Sign(sdk.StdSignBytes(chainID, sequences, sendMsg))
tx := sdk.NewStdTx(sendMsg, []sdk.StdSignature{{ 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 // Sign the tx
tx := sdk.NewStdTx(msg, []sdk.StdSignature{{ tx := sdk.NewStdTx(msg, []sdk.StdSignature{{
PubKey: priv1.PubKey(), PubKey: priv1.PubKey(),
Signature: priv1.Sign(msg.GetSignBytes()), Signature: priv1.Sign(sdk.StdSignBytes(chainID, []int64{seq}, msg)),
Sequence: seq, Sequence: seq,
}}) }})