X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=netsync%2Fconsensusmgr%2Fconsensus_msg_test.go;h=d00c93bbd98d4fef297dcd12e6e19360ec887016;hp=f42991695bed80664bb40a3ec9c4d5a2de19ee71;hb=669d176c004324fe81a26261a6e41ddea95b6f17;hpb=54373c1a3efe0e373ec1605840a4363e4b246c46 diff --git a/netsync/consensusmgr/consensus_msg_test.go b/netsync/consensusmgr/consensus_msg_test.go index f4299169..d00c93bb 100644 --- a/netsync/consensusmgr/consensus_msg_test.go +++ b/netsync/consensusmgr/consensus_msg_test.go @@ -55,11 +55,10 @@ func TestDecodeMessage(t *testing.T) { func TestBlockSignBroadcastMsg(t *testing.T) { blockSignMsg := &BlockSignatureMsg{ BlockHash: [32]byte{0x01}, - Height: 100, Signature: []byte{0x00}, PubKey: []byte{0x01}, } - signatureBroadcastMsg := NewBroadcastMsg(NewBlockSignatureMsg(bc.NewHash(blockSignMsg.BlockHash), blockSignMsg.Height, blockSignMsg.Signature, blockSignMsg.PubKey), consensusChannel) + signatureBroadcastMsg := NewBroadcastMsg(NewBlockSignatureMsg(bc.NewHash(blockSignMsg.BlockHash), blockSignMsg.Signature, blockSignMsg.PubKey), consensusChannel) binMsg := wire.BinaryBytes(signatureBroadcastMsg.GetMsg()) gotMsgType, gotMsg, err := decodeMessage(binMsg) @@ -139,16 +138,15 @@ func TestBlockProposeMsg(t *testing.T) { func TestBlockSignatureMsg(t *testing.T) { msg := &BlockSignatureMsg{ BlockHash: [32]byte{0x01}, - Height: 100, Signature: []byte{0x00}, PubKey: []byte{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, } - gotMsg := NewBlockSignatureMsg(bc.NewHash(msg.BlockHash), msg.Height, msg.Signature, msg.PubKey) + gotMsg := NewBlockSignatureMsg(bc.NewHash(msg.BlockHash), msg.Signature, msg.PubKey) if !reflect.DeepEqual(gotMsg, msg) { t.Fatalf("test block signature message err. got:%s\n want:%s", spew.Sdump(gotMsg), spew.Sdump(msg)) } - wantString := "{block_hash: 0100000000000000000000000000000000000000000000000000000000000000,block_height:100,signature:00,pubkey:01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}" + wantString := "{block_hash: 0100000000000000000000000000000000000000000000000000000000000000,signature:00,pubkey:01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}" if gotMsg.String() != wantString { t.Fatalf("test block signature message err. got string:%s\n want string:%s", gotMsg.String(), wantString) }