diff options
Diffstat (limited to 'Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm')
-rw-r--r-- | Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm index 6715b24..263ca22 100644 --- a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm +++ b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm @@ -16,7 +16,6 @@ #import "Firestore/Example/Tests/SpecTests/FSTMockDatastore.h" -#import "Firestore/Source/Core/FSTSnapshotVersion.h" #import "Firestore/Source/Local/FSTQueryData.h" #import "Firestore/Source/Model/FSTMutation.h" #import "Firestore/Source/Remote/FSTSerializerBeta.h" @@ -36,6 +35,7 @@ using firebase::firestore::auth::CredentialsProvider; using firebase::firestore::auth::EmptyCredentialsProvider; using firebase::firestore::core::DatabaseInfo; using firebase::firestore::model::DatabaseId; +using firebase::firestore::model::SnapshotVersion; @class GRPCProtoCall; @@ -120,9 +120,8 @@ NS_ASSUME_NONNULL_BEGIN FSTLog(@"watchQuery: %d: %@", query.targetID, query.query); self.datastore.watchStreamRequestCount += 1; // Snapshot version is ignored on the wire - FSTQueryData *sentQueryData = - [query queryDataByReplacingSnapshotVersion:[FSTSnapshotVersion noVersion] - resumeToken:query.resumeToken]; + FSTQueryData *sentQueryData = [query queryDataByReplacingSnapshotVersion:SnapshotVersion::None() + resumeToken:query.resumeToken]; self.activeTargets[@(query.targetID)] = sentQueryData; } @@ -138,7 +137,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Helper methods. -- (void)writeWatchChange:(FSTWatchChange *)change snapshotVersion:(FSTSnapshotVersion *)snap { +- (void)writeWatchChange:(FSTWatchChange *)change snapshotVersion:(const SnapshotVersion &)snap { if ([change isKindOfClass:[FSTWatchTargetChange class]]) { FSTWatchTargetChange *targetChange = (FSTWatchTargetChange *)change; if (targetChange.cause) { @@ -242,7 +241,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Helper methods. /** Injects a write ack as though it had come from the backend in response to a write. */ -- (void)ackWriteWithVersion:(FSTSnapshotVersion *)commitVersion +- (void)ackWriteWithVersion:(const SnapshotVersion &)commitVersion mutationResults:(NSArray<FSTMutationResult *> *)results { [self.delegate writeStreamDidReceiveResponseWithVersion:commitVersion mutationResults:results]; } @@ -326,7 +325,7 @@ NS_ASSUME_NONNULL_BEGIN return [self.writeStream sentMutationsCount]; } -- (void)ackWriteWithVersion:(FSTSnapshotVersion *)commitVersion +- (void)ackWriteWithVersion:(const SnapshotVersion &)commitVersion mutationResults:(NSArray<FSTMutationResult *> *)results { [self.writeStream ackWriteWithVersion:commitVersion mutationResults:results]; } @@ -340,11 +339,11 @@ NS_ASSUME_NONNULL_BEGIN [FSTWatchTargetChange changeWithState:FSTWatchTargetChangeStateAdded targetIDs:targetIDs cause:nil]; - [self writeWatchChange:change snapshotVersion:[FSTSnapshotVersion noVersion]]; + [self writeWatchChange:change snapshotVersion:SnapshotVersion::None()]; } - (void)writeWatchCurrentWithTargetIDs:(NSArray<FSTBoxedTargetID *> *)targetIDs - snapshotVersion:(FSTSnapshotVersion *)snapshotVersion + snapshotVersion:(const SnapshotVersion &)snapshotVersion resumeToken:(NSData *)resumeToken { FSTWatchTargetChange *change = [FSTWatchTargetChange changeWithState:FSTWatchTargetChangeStateCurrent @@ -353,7 +352,7 @@ NS_ASSUME_NONNULL_BEGIN [self writeWatchChange:change snapshotVersion:snapshotVersion]; } -- (void)writeWatchChange:(FSTWatchChange *)change snapshotVersion:(FSTSnapshotVersion *)snap { +- (void)writeWatchChange:(FSTWatchChange *)change snapshotVersion:(const SnapshotVersion &)snap { [self.watchStream writeWatchChange:change snapshotVersion:snap]; } |