Use byte literals in tests to make go vet happy.

The go vet command complains about untagged struct initializers when
defining a ShaHash directly.  This seems to be a limitation where go vet
does not exclude the warning for types which are a constant size byte array
like it does for normal constant size byte array definition.

This commit simply modifies the tests to use a constant definition cast to a
ShaHash to overcome the limitation of go vet.
This commit is contained in:
Dave Collins 2014-09-05 13:56:31 -05:00
parent 4deb922c9d
commit 225248d283

View file

@ -18,21 +18,21 @@ import (
// mainNetGenesisHash is the hash of the first block in the block chain for the // mainNetGenesisHash is the hash of the first block in the block chain for the
// main network (genesis block). // main network (genesis block).
var mainNetGenesisHash = btcwire.ShaHash{ var mainNetGenesisHash = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy.
0x6f, 0xe2, 0x8c, 0x0a, 0xb6, 0xf1, 0xb3, 0x72, 0x6f, 0xe2, 0x8c, 0x0a, 0xb6, 0xf1, 0xb3, 0x72,
0xc1, 0xa6, 0xa2, 0x46, 0xae, 0x63, 0xf7, 0x4f, 0xc1, 0xa6, 0xa2, 0x46, 0xae, 0x63, 0xf7, 0x4f,
0x93, 0x1e, 0x83, 0x65, 0xe1, 0x5a, 0x08, 0x9c, 0x93, 0x1e, 0x83, 0x65, 0xe1, 0x5a, 0x08, 0x9c,
0x68, 0xd6, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0xd6, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00,
} })
// mainNetGenesisMerkleRoot is the hash of the first transaction in the genesis // mainNetGenesisMerkleRoot is the hash of the first transaction in the genesis
// block for the main network. // block for the main network.
var mainNetGenesisMerkleRoot = btcwire.ShaHash{ var mainNetGenesisMerkleRoot = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy.
0x3b, 0xa3, 0xed, 0xfd, 0x7a, 0x7b, 0x12, 0xb2, 0x3b, 0xa3, 0xed, 0xfd, 0x7a, 0x7b, 0x12, 0xb2,
0x7a, 0xc7, 0x2c, 0x3e, 0x67, 0x76, 0x8f, 0x61, 0x7a, 0xc7, 0x2c, 0x3e, 0x67, 0x76, 0x8f, 0x61,
0x7f, 0xc8, 0x1b, 0xc3, 0x88, 0x8a, 0x51, 0x32, 0x7f, 0xc8, 0x1b, 0xc3, 0x88, 0x8a, 0x51, 0x32,
0x3a, 0x9f, 0xb8, 0xaa, 0x4b, 0x1e, 0x5e, 0x4a, 0x3a, 0x9f, 0xb8, 0xaa, 0x4b, 0x1e, 0x5e, 0x4a,
} })
// fakeRandReader implements the io.Reader interface and is used to force // fakeRandReader implements the io.Reader interface and is used to force
// errors in the RandomUint64 function. // errors in the RandomUint64 function.