Skip to content

Commit

Permalink
ltc: test enabled TestSimNetGenesisBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
losh11 committed Jun 20, 2023
1 parent f3103bf commit 14ba933
Showing 1 changed file with 59 additions and 59 deletions.
118 changes: 59 additions & 59 deletions chaincfg/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,30 +93,30 @@ func TestTestNet4GenesisBlock(t *testing.T) {

// TestSimNetGenesisBlock tests the genesis block of the simulation test network
// for validity by checking the encoded bytes and hashes.
// func TestSimNetGenesisBlock(t *testing.T) {
// // Encode the genesis block to raw bytes.
// var buf bytes.Buffer
// err := SimNetParams.GenesisBlock.Serialize(&buf)
// if err != nil {
// t.Fatalf("TestSimNetGenesisBlock: %v", err)
// }
func TestSimNetGenesisBlock(t *testing.T) {
// Encode the genesis block to raw bytes.
var buf bytes.Buffer
err := SimNetParams.GenesisBlock.Serialize(&buf)
if err != nil {
t.Fatalf("TestSimNetGenesisBlock: %v", err)
}

// // Ensure the encoded block matches the expected bytes.
// if !bytes.Equal(buf.Bytes(), simNetGenesisBlockBytes) {
// t.Fatalf("TestSimNetGenesisBlock: Genesis block does not "+
// "appear valid - got %v, want %v",
// spew.Sdump(buf.Bytes()),
// spew.Sdump(simNetGenesisBlockBytes))
// }
// Ensure the encoded block matches the expected bytes.
if !bytes.Equal(buf.Bytes(), simNetGenesisBlockBytes) {
t.Fatalf("TestSimNetGenesisBlock: Genesis block does not "+
"appear valid - got %v, want %v",
spew.Sdump(buf.Bytes()),
spew.Sdump(simNetGenesisBlockBytes))
}

// // Check hash of the block against expected hash.
// hash := SimNetParams.GenesisBlock.BlockHash()
// if !SimNetParams.GenesisHash.IsEqual(&hash) {
// t.Fatalf("TestSimNetGenesisBlock: Genesis block hash does "+
// "not appear valid - got %v, want %v", spew.Sdump(hash),
// spew.Sdump(SimNetParams.GenesisHash))
// }
// }
// Check hash of the block against expected hash.
hash := SimNetParams.GenesisBlock.BlockHash()
if !SimNetParams.GenesisHash.IsEqual(&hash) {
t.Fatalf("TestSimNetGenesisBlock: Genesis block hash does "+
"not appear valid - got %v, want %v", spew.Sdump(hash),
spew.Sdump(SimNetParams.GenesisHash))
}
}

// TestSigNetGenesisBlock tests the genesis block of the signet test network for
// validity by checking the encoded bytes and hashes.
Expand Down Expand Up @@ -267,43 +267,43 @@ var testNet4GenesisBlockBytes = []byte{

// simNetGenesisBlockBytes are the wire encoded bytes for the genesis block of
// the simulation test network as of protocol version 70002.
// var simNetGenesisBlockBytes = []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, 0xd9, 0xce, 0xd4, 0xed, /* |........| */
// 0x11, 0x30, 0xf7, 0xb7, 0xfa, 0xad, 0x9b, 0xe2, /* |.0......| */
// 0x53, 0x23, 0xff, 0xaf, 0xa3, 0x32, 0x32, 0xa1, /* |S#...22.| */
// 0x7c, 0x3e, 0xdf, 0x6c, 0xfd, 0x97, 0xbe, 0xe6, /* ||>.l....| */
// 0xba, 0xfb, 0xdd, 0x97, 0x45, 0x06, 0x86, 0x53, /* |....E..S| */
// 0xff, 0xff, 0x7f, 0x20, 0x02, 0x00, 0x00, 0x00, /* |... ....| */
// 0x01, 0x01, 0x00, 0x00, 0x00, 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, 0xff, 0xff, /* |........| */
// 0xff, 0xff, 0x48, 0x04, 0xff, 0xff, 0x00, 0x1d, /* |..H.....| */
// 0x01, 0x04, 0x40, 0x4e, 0x59, 0x20, 0x54, 0x69, /* |..@NY Ti| */
// 0x6d, 0x65, 0x73, 0x20, 0x30, 0x35, 0x2f, 0x4f, /* |mes 05/O| */
// 0x63, 0x74, 0x2f, 0x32, 0x30, 0x31, 0x31, 0x20, /* |ct/2011 | */
// 0x53, 0x74, 0x65, 0x76, 0x65, 0x20, 0x4a, 0x6f, /* |Steve Jo| */
// 0x62, 0x73, 0x2c, 0x20, 0x41, 0x70, 0x70, 0x6c, /* |bs, Appl| */
// 0x65, 0xe2, 0x80, 0x99, 0x73, 0x20, 0x56, 0x69, /* |e...s Vi| */
// 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x2c, /* |sionary,| */
// 0x20, 0x44, 0x69, 0x65, 0x73, 0x20, 0x61, 0x74, /* | Dies at| */
// 0x20, 0x35, 0x36, 0xff, 0xff, 0xff, 0xff, 0x01, /* | 56.....| */
// 0x00, 0xf2, 0x05, 0x2a, 0x01, 0x00, 0x00, 0x00, /* |...*....| */
// 0x43, 0x41, 0x04, 0x01, 0x84, 0x71, 0x0f, 0xa6, /* |CA...q..| */
// 0x89, 0xad, 0x50, 0x23, 0x69, 0x0c, 0x80, 0xf3, /* |..P#i...| */
// 0xa4, 0x9c, 0x8f, 0x13, 0xf8, 0xd4, 0x5b, 0x8c, /* |......[.| */
// 0x85, 0x7f, 0xbc, 0xbc, 0x8b, 0xc4, 0xa8, 0xe4, /* |........| */
// 0xd3, 0xeb, 0x4b, 0x10, 0xf4, 0xd4, 0x60, 0x4f, /* |..K...`O| */
// 0xa0, 0x8d, 0xce, 0x60, 0x1a, 0xaf, 0x0f, 0x47, /* |...`...G| */
// 0x02, 0x16, 0xfe, 0x1b, 0x51, 0x85, 0x0b, 0x4a, /* |....Q..J| */
// 0xcf, 0x21, 0xb1, 0x79, 0xc4, 0x50, 0x70, 0xac, /* |.!.y.Pp.| */
// 0x7b, 0x03, 0xa9, 0xac, 0x00, 0x00, 0x00, 0x00, /* |{.......| */
// }
var simNetGenesisBlockBytes = []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, 0xd9, 0xce, 0xd4, 0xed, /* |........| */
0x11, 0x30, 0xf7, 0xb7, 0xfa, 0xad, 0x9b, 0xe2, /* |.0......| */
0x53, 0x23, 0xff, 0xaf, 0xa3, 0x32, 0x32, 0xa1, /* |S#...22.| */
0x7c, 0x3e, 0xdf, 0x6c, 0xfd, 0x97, 0xbe, 0xe6, /* ||>.l....| */
0xba, 0xfb, 0xdd, 0x97, 0x45, 0x06, 0x86, 0x53, /* |....E..S| */
0xff, 0xff, 0x7f, 0x20, 0x02, 0x00, 0x00, 0x00, /* |... ....| */
0x01, 0x01, 0x00, 0x00, 0x00, 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, 0xff, 0xff, /* |........| */
0xff, 0xff, 0x48, 0x04, 0xff, 0xff, 0x00, 0x1d, /* |..H.....| */
0x01, 0x04, 0x40, 0x4e, 0x59, 0x20, 0x54, 0x69, /* |..@NY Ti| */
0x6d, 0x65, 0x73, 0x20, 0x30, 0x35, 0x2f, 0x4f, /* |mes 05/O| */
0x63, 0x74, 0x2f, 0x32, 0x30, 0x31, 0x31, 0x20, /* |ct/2011 | */
0x53, 0x74, 0x65, 0x76, 0x65, 0x20, 0x4a, 0x6f, /* |Steve Jo| */
0x62, 0x73, 0x2c, 0x20, 0x41, 0x70, 0x70, 0x6c, /* |bs, Appl| */
0x65, 0xe2, 0x80, 0x99, 0x73, 0x20, 0x56, 0x69, /* |e...s Vi| */
0x73, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x2c, /* |sionary,| */
0x20, 0x44, 0x69, 0x65, 0x73, 0x20, 0x61, 0x74, /* | Dies at| */
0x20, 0x35, 0x36, 0xff, 0xff, 0xff, 0xff, 0x01, /* | 56.....| */
0x00, 0xf2, 0x05, 0x2a, 0x01, 0x00, 0x00, 0x00, /* |...*....| */
0x43, 0x41, 0x04, 0x01, 0x84, 0x71, 0x0f, 0xa6, /* |CA...q..| */
0x89, 0xad, 0x50, 0x23, 0x69, 0x0c, 0x80, 0xf3, /* |..P#i...| */
0xa4, 0x9c, 0x8f, 0x13, 0xf8, 0xd4, 0x5b, 0x8c, /* |......[.| */
0x85, 0x7f, 0xbc, 0xbc, 0x8b, 0xc4, 0xa8, 0xe4, /* |........| */
0xd3, 0xeb, 0x4b, 0x10, 0xf4, 0xd4, 0x60, 0x4f, /* |..K...`O| */
0xa0, 0x8d, 0xce, 0x60, 0x1a, 0xaf, 0x0f, 0x47, /* |...`...G| */
0x02, 0x16, 0xfe, 0x1b, 0x51, 0x85, 0x0b, 0x4a, /* |....Q..J| */
0xcf, 0x21, 0xb1, 0x79, 0xc4, 0x50, 0x70, 0xac, /* |.!.y.Pp.| */
0x7b, 0x03, 0xa9, 0xac, 0x00, 0x00, 0x00, 0x00, /* |{.......| */
}

// sigNetGenesisBlockBytes are the wire encoded bytes for the genesis block of
// the signet test network as of protocol version 70002.
Expand Down

0 comments on commit 14ba933

Please sign in to comment.