Compare commits

...

2 커밋

2개의 변경된 파일16개의 추가작업 그리고 0개의 파일을 삭제

파일 보기

@ -180,3 +180,8 @@ func (srs *StandardRicochetService) OnBadUsageError(oc *OpenConnection, channelI
func (srs *StandardRicochetService) OnFailedError(oc *OpenConnection, channelID int32) { func (srs *StandardRicochetService) OnFailedError(oc *OpenConnection, channelID int32) {
oc.RejectOpenChannel(channelID, "FailedError") oc.RejectOpenChannel(channelID, "FailedError")
} }
// RGetServerHostname returns the generated tor hostname from the private key
func (srs *StandardRicochetService) GetServerHostname() string {
return srs.serverHostname
}

파일 보기

@ -105,3 +105,14 @@ func TestServerCouldNotConnect(t *testing.T) {
t.Errorf("Should not have been been able to connect to 127.0.0.1:65535|kwke2hntvyfqm7dr") t.Errorf("Should not have been been able to connect to 127.0.0.1:65535|kwke2hntvyfqm7dr")
} }
} }
func TestGetServerHostname(t *testing.T) {
ricochetService := new(TestService)
err := ricochetService.Init("./private_key")
if err != nil {
t.Errorf("Could not initate ricochet service: %v", err)
}
if ricochetService.GetServerHostname() != "kwke2hntvyfqm7dr" {
t.Errorf("GetServerHostname did not return expected 'kwke2hntvyfqm7dr'")
}
}