| 89 | } |
| 90 | |
| 91 | Status UnpackProtoAction(const Action& action, google::protobuf::Message* out) { |
| 92 | google::protobuf::Any any; |
| 93 | if (!any.ParseFromArray(action.body->data(), static_cast<int>(action.body->size()))) { |
| 94 | return Status::Invalid("Unable to parse action ", action.type); |
| 95 | } |
| 96 | if (!any.UnpackTo(out)) { |
| 97 | return Status::Invalid("Unable to unpack ", out->GetTypeName()); |
| 98 | } |
| 99 | return Status::OK(); |
| 100 | } |
| 101 | |
| 102 | // Timestamp |
| 103 |
no test coverage detected