@Override public ByteStringMessage<ProtocolWaveletDelta> verifyDelta(ProtocolSignedDelta signedDelta) throws SignatureException, UnknownSignerException { ByteStringMessage<ProtocolWaveletDelta> delta; try { delta = ByteStringMessage.parseProtocolWaveletDelta(signedDelta.getDelta()); } catch (InvalidProtocolBufferException e) { throw new IllegalArgumentException("signed delta does not contain valid delta", e); } if (disableVerfication) { return delta; } List<String> domains = getParticipantDomains(delta.getMessage()); if (domains.size() != signedDelta.getSignatureCount()) { throw new SignatureException("found " + domains.size() + " domains in " + "extended address path, but " + signedDelta.getSignatureCount() + " signatures."); } for (int i = 0; i < domains.size(); i++) { String domain = domains.get(i); ProtocolSignature signature = signedDelta.getSignature(i); verifySingleSignature(delta, signature, domain); } return delta; }
PersistenceException { ProtocolWaveletDelta protocolDelta = ByteStringMessage.parseProtocolWaveletDelta(signedDelta.getDelta()).getMessage();
appliedDelta.getMessage().getSignedOriginalDelta().getDelta()); LOG.info("actual delta: " + actualDelta); } catch (InvalidProtocolBufferException e) {
appliedDelta.getMessage().getSignedOriginalDelta().getDelta()); WaveletDelta delta = CoreWaveletOperationSerializer.deserialize(protocolDelta.getMessage());
delta = ByteStringMessage.parseProtocolWaveletDelta(signedDelta.getDelta()).getMessage(); } catch (InvalidProtocolBufferException e) { LOG.warning("Submit request: Invalid delta protobuf. WaveletName: " + waveletName, e);
/** * Inspects the given applied delta to determine the {@code HashedVersion} it * was applied at. * This may require looking at the contained {@code ProtocolWaveletDelta}. * * @param appliedDeltaBytes to inspect * @return hashed version the delta was applied at * @throws InvalidProtocolBufferException if the contained * {@code ProtocolWaveletDelta} is invalid * (is only inspected if the applied delta has the hashed version set) */ public static HashedVersion getHashedVersionAppliedAt( ByteStringMessage<ProtocolAppliedWaveletDelta> appliedDeltaBytes) throws InvalidProtocolBufferException { ProtocolAppliedWaveletDelta appliedDelta = appliedDeltaBytes.getMessage(); return CoreWaveletOperationSerializer.deserialize( // If the delta was transformed, the version it was actually applied at is specified // in the top-level message, otherwise we take if from the original signed delta. appliedDelta.hasHashedVersionAppliedAt() ? appliedDelta.getHashedVersionAppliedAt() : ProtocolWaveletDelta.parseFrom(appliedDelta.getSignedOriginalDelta().getDelta()) .getHashedVersion()); }