@@ -118,6 +118,33 @@ func TestSimNetGenesisBlock(t *testing.T) {
118
118
}
119
119
}
120
120
121
+ // TestSigNetGenesisBlock tests the genesis block of the signet test network for
122
+ // validity by checking the encoded bytes and hashes.
123
+ func TestSigNetGenesisBlock (t * testing.T ) {
124
+ // Encode the genesis block to raw bytes.
125
+ var buf bytes.Buffer
126
+ err := SigNetParams .GenesisBlock .Serialize (& buf )
127
+ if err != nil {
128
+ t .Fatalf ("TestSigNetGenesisBlock: %v" , err )
129
+ }
130
+
131
+ // Ensure the encoded block matches the expected bytes.
132
+ if ! bytes .Equal (buf .Bytes (), sigNetGenesisBlockBytes ) {
133
+ t .Fatalf ("TestSigNetGenesisBlock: Genesis block does not " +
134
+ "appear valid - got %v, want %v" ,
135
+ spew .Sdump (buf .Bytes ()),
136
+ spew .Sdump (sigNetGenesisBlockBytes ))
137
+ }
138
+
139
+ // Check hash of the block against expected hash.
140
+ hash := SigNetParams .GenesisBlock .BlockHash ()
141
+ if ! SigNetParams .GenesisHash .IsEqual (& hash ) {
142
+ t .Fatalf ("TestSigNetGenesisBlock: Genesis block hash does " +
143
+ "not appear valid - got %v, want %v" , spew .Sdump (hash ),
144
+ spew .Sdump (SigNetParams .GenesisHash ))
145
+ }
146
+ }
147
+
121
148
// genesisBlockBytes are the wire encoded bytes for the genesis block of the
122
149
// main network as of protocol version 60002.
123
150
var genesisBlockBytes = []byte {
@@ -281,3 +308,44 @@ var simNetGenesisBlockBytes = []byte{
281
308
0x8a , 0x4c , 0x70 , 0x2b , 0x6b , 0xf1 , 0x1d , 0x5f , /* |.Lp+k.._|*/
282
309
0xac , 0x00 , 0x00 , 0x00 , 0x00 , /* |.....| */
283
310
}
311
+
312
+ // sigNetGenesisBlockBytes are the wire encoded bytes for the genesis block of
313
+ // the signet test network as of protocol version 70002.
314
+ var sigNetGenesisBlockBytes = []byte {
315
+ 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , /* |...@....| */
316
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , /* |........| */
317
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , /* |........| */
318
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , /* |........| */
319
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x3b , 0xa3 , 0xed , 0xfd , /* |........| */
320
+ 0x7a , 0x7b , 0x12 , 0xb2 , 0x7a , 0xc7 , 0x2c , 0x3e , /* |....;...| */
321
+ 0x67 , 0x76 , 0x8f , 0x61 , 0x7f , 0xc8 , 0x1b , 0xc3 , /* |z{..z.,>| */
322
+ 0x88 , 0x8a , 0x51 , 0x32 , 0x3a , 0x9f , 0xb8 , 0xaa , /* |gv.a....| */
323
+ 0x4b , 0x1e , 0x5e , 0x4a , 0x00 , 0x8f , 0x4d , 0x5f , /* |..Q2:...| */
324
+ 0xae , 0x77 , 0x03 , 0x1e , 0x8a , 0xd2 , 0x22 , 0x03 , /* |K.^J..M_| */
325
+ 0x01 , 0x01 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , /* |.w....".| */
326
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , /* |........| */
327
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , /* |........| */
328
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , /* |........| */
329
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0xff , 0xff , /* |........| */
330
+ 0xff , 0xff , 0x4d , 0x04 , 0xff , 0xff , 0x00 , 0x1d , /* |........| */
331
+ 0x01 , 0x04 , 0x45 , 0x54 , 0x68 , 0x65 , 0x20 , 0x54 , /* |..M.....| */
332
+ 0x69 , 0x6d , 0x65 , 0x73 , 0x20 , 0x30 , 0x33 , 0x2f , /* |..EThe T| */
333
+ 0x4a , 0x61 , 0x6e , 0x2f , 0x32 , 0x30 , 0x30 , 0x39 , /* |imes 03/| */
334
+ 0x20 , 0x43 , 0x68 , 0x61 , 0x6e , 0x63 , 0x65 , 0x6c , /* |Jan/2009| */
335
+ 0x6c , 0x6f , 0x72 , 0x20 , 0x6f , 0x6e , 0x20 , 0x62 , /* | Chancel| */
336
+ 0x72 , 0x69 , 0x6e , 0x6b , 0x20 , 0x6f , 0x66 , 0x20 , /* |lor on b| */
337
+ 0x73 , 0x65 , 0x63 , 0x6f , 0x6e , 0x64 , 0x20 , 0x62 , /* |rink of| */
338
+ 0x61 , 0x69 , 0x6c , 0x6f , 0x75 , 0x74 , 0x20 , 0x66 , /* |second b| */
339
+ 0x6f , 0x72 , 0x20 , 0x62 , 0x61 , 0x6e , 0x6b , 0x73 , /* |ailout f| */
340
+ 0xff , 0xff , 0xff , 0xff , 0x01 , 0x00 , 0xf2 , 0x05 , /* |or banks| */
341
+ 0x2a , 0x01 , 0x00 , 0x00 , 0x00 , 0x43 , 0x41 , 0x04 , /* |........| */
342
+ 0x67 , 0x8a , 0xfd , 0xb0 , 0xfe , 0x55 , 0x48 , 0x27 , /* |*....CA.| */
343
+ 0x19 , 0x67 , 0xf1 , 0xa6 , 0x71 , 0x30 , 0xb7 , 0x10 , /* |g....UH'| */
344
+ 0x5c , 0xd6 , 0xa8 , 0x28 , 0xe0 , 0x39 , 0x09 , 0xa6 , /* |.g..q0..| */
345
+ 0x79 , 0x62 , 0xe0 , 0xea , 0x1f , 0x61 , 0xde , 0xb6 , /* |\..(.9..| */
346
+ 0x49 , 0xf6 , 0xbc , 0x3f , 0x4c , 0xef , 0x38 , 0xc4 , /* |yb...a..| */
347
+ 0xf3 , 0x55 , 0x04 , 0xe5 , 0x1e , 0xc1 , 0x12 , 0xde , /* |I..?L.8.| */
348
+ 0x5c , 0x38 , 0x4d , 0xf7 , 0xba , 0x0b , 0x8d , 0x57 , /* |.U......| */
349
+ 0x8a , 0x4c , 0x70 , 0x2b , 0x6b , 0xf1 , 0x1d , 0x5f , /* |\8M....W| */
350
+ 0xac , 0x00 , 0x00 , 0x00 , 0x00 , /* |.....| */
351
+ }
0 commit comments