|
|
|
@ -15,16 +15,18 @@ func TestProtocol_Match(t *testing.T) { |
|
|
|
|
targetID string |
|
|
|
|
exp bool |
|
|
|
|
}{ |
|
|
|
|
{"harmony/sync/unitest/0/1.0.1", true}, |
|
|
|
|
{"harmony/sync/unitest/0/1.0.1/1", true}, |
|
|
|
|
{"harmony/sync/unitest/0/1.0.1/0", true}, |
|
|
|
|
{"h123456", false}, |
|
|
|
|
{"harmony/sync/unitest/0/0.9.9", false}, |
|
|
|
|
{"harmony/epoch/unitest/0/1.0.1", false}, |
|
|
|
|
{"harmony/sync/mainnet/0/1.0.1", false}, |
|
|
|
|
{"harmony/sync/unitest/1/1.0.1", false}, |
|
|
|
|
{"harmony/sync/unitest/0/0.9.9/1", false}, |
|
|
|
|
{"harmony/epoch/unitest/0/1.0.1/1", false}, |
|
|
|
|
{"harmony/sync/mainnet/0/1.0.1/1", false}, |
|
|
|
|
{"harmony/sync/unitest/1/1.0.1/1", false}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for i, test := range tests { |
|
|
|
|
p := &Protocol{ |
|
|
|
|
beaconNode: true, |
|
|
|
|
config: Config{ |
|
|
|
|
Network: "unitest", |
|
|
|
|
ShardID: 0, |
|
|
|
|