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