mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* [NOD-570] Separate genesis variables for different netwroks * [NOD-570] Make Testnet genesis * [NOD-570] Make simnet and regtest genesis * [NOD-570] Remake devnet genesis * [NOD-570] Rename regNet -> regTest testnet->testNet * [NOD-570] Change network names to one word instead of camel case * [NOD-570] Change network names to one word instead of camel case * [NOD-570] Fix test names * [NOD-570] Fix TestGHOSTDAG Co-authored-by: Dan Aharoni <dereeno@protonmail.com>
59 lines
1.4 KiB
Go
59 lines
1.4 KiB
Go
// Copyright (c) 2013-2016 The btcsuite developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package wire
|
|
|
|
import "testing"
|
|
|
|
// TestServiceFlagStringer tests the stringized output for service flag types.
|
|
func TestServiceFlagStringer(t *testing.T) {
|
|
tests := []struct {
|
|
in ServiceFlag
|
|
want string
|
|
}{
|
|
{0, "0x0"},
|
|
{SFNodeNetwork, "SFNodeNetwork"},
|
|
{SFNodeGetUTXO, "SFNodeGetUTXO"},
|
|
{SFNodeBloom, "SFNodeBloom"},
|
|
{SFNodeXthin, "SFNodeXthin"},
|
|
{SFNodeBit5, "SFNodeBit5"},
|
|
{SFNodeCF, "SFNodeCF"},
|
|
{0xffffffff, "SFNodeNetwork|SFNodeGetUTXO|SFNodeBloom|SFNodeXthin|SFNodeBit5|SFNodeCF|0xffffffc0"},
|
|
}
|
|
|
|
t.Logf("Running %d tests", len(tests))
|
|
for i, test := range tests {
|
|
result := test.in.String()
|
|
if result != test.want {
|
|
t.Errorf("String #%d\n got: %s want: %s", i, result,
|
|
test.want)
|
|
continue
|
|
}
|
|
}
|
|
}
|
|
|
|
// TestKaspaNetStringer tests the stringized output for kaspa net types.
|
|
func TestKaspaNetStringer(t *testing.T) {
|
|
tests := []struct {
|
|
in KaspaNet
|
|
want string
|
|
}{
|
|
{Mainnet, "Mainnet"},
|
|
{Regtest, "Regtest"},
|
|
{Testnet, "Testnet"},
|
|
{Simnet, "Simnet"},
|
|
{0xffffffff, "Unknown KaspaNet (4294967295)"},
|
|
}
|
|
|
|
t.Logf("Running %d tests", len(tests))
|
|
for i, test := range tests {
|
|
result := test.in.String()
|
|
if result != test.want {
|
|
t.Errorf("String #%d\n got: %s want: %s", i, result,
|
|
test.want)
|
|
continue
|
|
}
|
|
}
|
|
}
|