consumeEnvelope static method
Unmarshals a serialized Envelope and validates its signature using the provided 'domain' string. If validation fails, an error is returned.
Implementation
static Future<(Envelope, RecordBase)> consumeEnvelope( Uint8List data, String domain) async {
final e = unmarshalEnvelopeFromProto(data);
await e.validate(domain);
final rec = PeerRecord.fromProtobufBytes((await e.record()).writeToBuffer());
return (e, rec);
}