From 1d5a6065c5e48e4a34671f2a269a9a4afcbdba3e Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sun, 28 Dec 2014 03:06:47 -0800 Subject: [PATCH] Fix state_test bug -- include PubKey in TxInput --- state/state_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/state/state_test.go b/state/state_test.go index fb1e2ae55..fa30d283b 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -147,6 +147,7 @@ func TestTxSequence(t *testing.T) { state, privAccounts, _ := RandGenesisState(3, true, 1000, 1, true, 1000) acc0 := state.GetAccount(privAccounts[0].PubKey.Address()) + acc0PubKey := privAccounts[0].PubKey acc1 := state.GetAccount(privAccounts[1].PubKey.Address()) // Try executing a SendTx with various sequence numbers. @@ -157,6 +158,7 @@ func TestTxSequence(t *testing.T) { Address: acc0.Address, Amount: 1, Sequence: sequence, + PubKey: acc0PubKey, }, }, Outputs: []*TxOutput{ @@ -210,6 +212,7 @@ func TestTxs(t *testing.T) { //val0 := state.GetValidatorInfo(privValidators[0].Address) acc0 := state.GetAccount(privAccounts[0].PubKey.Address()) + acc0PubKey := privAccounts[0].PubKey acc1 := state.GetAccount(privAccounts[1].PubKey.Address()) // SendTx. @@ -221,6 +224,7 @@ func TestTxs(t *testing.T) { Address: acc0.Address, Amount: 1, Sequence: acc0.Sequence + 1, + PubKey: acc0PubKey, }, }, Outputs: []*TxOutput{ @@ -252,12 +256,13 @@ func TestTxs(t *testing.T) { { state := state.Copy() tx := &BondTx{ - PubKey: acc0.PubKey.(PubKeyEd25519), + PubKey: acc0PubKey.(PubKeyEd25519), Inputs: []*TxInput{ &TxInput{ Address: acc0.Address, Amount: 1, Sequence: acc0.Sequence + 1, + PubKey: acc0PubKey, }, }, UnbondTo: []*TxOutput{