Fix build

This commit is contained in:
nielsandriesse 2020-11-08 09:03:08 +11:00
parent 4b63588f1a
commit b4545903b1
2 changed files with 3 additions and 3 deletions

View file

@ -48,7 +48,7 @@ public enum MessageReceiver {
guard message.isValid else { throw Error.invalidMessage }
return message
} else {
return Error.unknownMessage
throw Error.unknownMessage
}
}
}

View file

@ -60,7 +60,7 @@ public enum MessageSender {
}
let recipient = message.recipient!
let base64EncodedData = ciphertext.base64EncodedString()
guard let (timestamp, nonce) = ProofOfWork.calculate(ttl: ttl, publicKey: recipient, data: base64EncodedData) else {
guard let (timestamp, nonce) = ProofOfWork.calculate(ttl: type(of: message).ttl, publicKey: recipient, data: base64EncodedData) else {
SNLog("Proof of work calculation failed.")
return Promise(error: Error.proofOfWorkCalculationFailed)
}
@ -70,7 +70,7 @@ public enum MessageSender {
NotificationCenter.default.post(name: .messageSending, object: NSNumber(value: message.sentTimestamp!))
}
}
let snodeMessage = SnodeMessage(recipient: recipient, data: base64EncodedData, ttl: ttl, timestamp: timestamp, nonce: nonce)
let snodeMessage = SnodeMessage(recipient: recipient, data: base64EncodedData, ttl: type(of: message).ttl, timestamp: timestamp, nonce: nonce)
let (promise, seal) = Promise<Void>.pending()
SnodeAPI.sendMessage(snodeMessage).done(on: Threading.workQueue) { promises in
var isSuccess = false