isSaneResponse function

bool isSaneResponse(
  1. MergeToDoListResponse respPb
)

Returns true iff respPb.sanityCheck is sane.

Implementation

bool isSaneResponse(pb.MergeToDoListResponse respPb) {
  // In python3, 2**64-18369614221190021342 is 77129852519530274. Int64 is the
  // wrong abstraction for a `fixed64` field; Uint64 would be better but does
  // not exist. Integer overflow yields -77129852519530274:
  if (sanityCheckForResponse != Int64.parseInt("18369614221190021342")) {
    throw ApiException("Assertion failed re: -77129852519530274 and 18369614221190021342");
  }
  return (respPb.sanityCheck == sanityCheckForResponse);
}