Skip to main content

TestStore

Struct TestStore 

Source
pub struct TestStore { /* private fields */ }

Implementations§

Source§

impl TestStore

Source

pub fn root(&self) -> StoreRootRef

Source

pub async fn execute_unscoped_host_sql_for_test( &self, sql: impl Into<String>, ) -> Result<(), HostWriteError<DbError>>

Source

pub async fn bind_founder_device( &self, database: &Database, store_dir: StoreDir, ) -> Result<TestDevice, StoreError>

Source

pub async fn open_store_with_identity( &self, database: &Database, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<Store, StoreInitializationError>

Source

pub async fn open_store_with_storage( &self, database: StoreDatabase, storage: Arc<dyn CloudSyncObjectStorage>, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<Store, StoreInitializationError>

Source

pub async fn open_founder_store_with_storage( &self, database: StoreDatabase, storage: Arc<dyn CloudSyncObjectStorage>, store_dir: StoreDir, ) -> Result<Store, StoreInitializationError>

Source

pub fn tombstone_deletions(&self) -> Vec<String>

Source

pub fn tombstone_provider_key(&self, stored: &StoredBlobRef) -> String

Source

pub fn stored_tombstone_bytes(&self, key: &str) -> Option<Vec<u8>>

Source

pub async fn plant_tombstone_bytes( &self, key: &str, bytes: Vec<u8>, ) -> Result<(), StorageError>

Source

pub async fn plant_tombstone(&self, tombstone: &BlobTombstoneJson)

Plants a typed tombstone through the Store’s exact cloud layout while bypassing the signing drain, so deletion tests can exercise rejected signatures and Store identities.

Source

pub fn fail_exact_delete_on_call(&self, call: usize)

Source

pub fn fail_nth_exact_delete_of(&self, slots: &[&ObjectSlot], call: usize)

Source

pub fn sort_provider_listings(&self)

Source

pub fn provider_object_is_absent(&self, logical_key: &str) -> bool

Source

pub fn arm_provider_write_failures(&self)

Source

pub fn fail_exact_create_before_call(&self, call: usize)

Source

pub fn exact_creates(&self) -> Vec<ObjectSlot>

Source

pub fn clear_exact_creates(&self)

Source

pub fn fail_exact_create_after_call(&self, call: usize)

Source

pub fn pause_after_exact_create_call( &self, call: usize, ) -> (Arc<Notify>, Arc<Notify>)

Source

pub async fn pull_with_storage_for_test( &self, database: &Database, storage: Arc<dyn CloudSyncObjectStorage>, store_dir: &StoreDir, routing_encryption: Option<&EncryptionService>, ) -> Result<StorePullResult, SyncCycleFailure>

Source

pub async fn founder_recovery_authority(&self) -> OwnerRecoveryAuthority

Source

pub async fn create_circle( &self, metadata_stamp: &str, name: &str, ) -> Result<CircleId, CircleOperationError>

Source

pub async fn run_founder_cycle( &self, observer: Option<&dyn BlobTransitionObserver>, ) -> Result<SyncCycleResult, SyncCycleFailure>

Source

pub async fn publish_fixture_position(&self, note_id: &str) -> u64

Source

pub async fn create_exact_opaque_blob( &self, namespace: &str, id: &str, bytes: &[u8], ) -> StoredBlobRef

Source

pub async fn create_exact_browsable_blob( &self, namespace: &str, id: &str, cloud_path: &str, bytes: &[u8], ) -> StoredBlobRef

Source

pub async fn publish_exact_remote_blob_binding( &self, root_id: &str, row_id: &str, bytes: &[u8], ) -> StoredBlobRef

Source

pub async fn pull_into_result( &self, db: &Database, store_dir: &StoreDir, ) -> Result<(BTreeMap<String, u64>, StorePullResult), TestPullError>

Source

pub async fn pull_into( &self, db: &Database, store_dir: &StoreDir, ) -> (BTreeMap<String, u64>, StorePullResult)

Source

pub async fn pull_and_fill_into( &self, db: &Database, store_dir: &StoreDir, ) -> (BTreeMap<String, u64>, StorePullResult)

Pull, then run the eager cache fill the sync loop runs behind its cycles.

A pull records what its rows bind and downloads none of it, so a test that wants an eager blob’s bytes on disk has to do what the loop does.

Source

pub async fn promote_active_member_fixture( &self, owner_db: &Database, owner_db_store_dir: StoreDir, member_db: &Database, member_db_store_dir: StoreDir, owner: &UserKeypair, member: &UserKeypair, encryption: &EncryptionService, ) -> Result<StoreMembershipStateRef, TestError>

Source

pub async fn create( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<Arc<Self>, TestError>

Source

pub async fn create_with_connection( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<TestStoreParts, TestError>

Source

pub async fn create_encrypted( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, encryption: EncryptionService, ) -> Result<Arc<Self>, TestError>

Source

pub async fn create_encrypted_with_connection( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, encryption: EncryptionService, ) -> Result<TestStoreParts, TestError>

Source

pub async fn create_with_database( database: StoreDatabase, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<Arc<Self>, TestError>

Source

pub async fn create_browsable( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<Arc<Self>, TestError>

A store whose home keeps blobs browsable: stored in the clear under readable paths. The counterpart of Self::create, whose home is opaque (sealed under the store key, hashed paths). The pair is fixed per home, so a test that needs the browsable verification story needs this store.

Source

pub async fn create_browsable_with_connection( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<TestStoreParts, TestError>

Source

pub fn delay_exact_full_reads(&self, delay: Duration)

Provider operations asked for so far. The unit the cycle log reports in, so a budget written here is the budget read there. Delay every whole-object read and record how many overlap, so a test can assert on the schedule of reads rather than on wall-clock time.

Source

pub fn exact_full_read_max_inflight(&self) -> usize

Source

pub fn exact_reads(&self) -> Vec<ObjectSlot>

Source

pub fn clear_exact_reads(&self)

Source

pub fn provider_requests_issued(&self) -> u64

Source

pub fn protocol_founder_pubkey(&self) -> String

Source

pub async fn create_exact_protocol_object( &self, context: &ProtocolObjectContext, semantic_prefix: &str, extension: &str, bytes: &[u8], ) -> Result<ExactObjectRef, TestError>

Source

pub async fn publish_exact_protocol_object( &self, object: &ExactObjectRef, bytes: Vec<u8>, ) -> Result<(), StorageError>

Publish one object from the bytes and reference that identify it, for tests holding a candidate that carries references rather than uploads.

Source

pub async fn publish_prepared_protocol_object( &self, prepared: &PreparedExactObject, ) -> Result<(), StorageError>

Source

pub async fn read_exact_protocol_object( &self, context: &ProtocolObjectContext, object: &ExactObjectRef, semantic_prefix: &str, ) -> Result<Vec<u8>, StorageError>

Source

pub async fn contains_blob_object(&self, reference: &RowBlobRef) -> bool

Source

pub async fn contains_stored_blob_object( &self, stored: &StoredBlobRef, ) -> Result<bool, StorageError>

Source

pub async fn contains_blob_tombstone( &self, stored: &StoredBlobRef, ) -> Result<bool, CloudHomeError>

Source

pub async fn contains_membership_rollup( &self, rollup: &MembershipRollupRef, ) -> Result<bool, TestError>

Source

pub async fn contains_circle_snapshot_image( &self, circle_id: CircleId, meta: &CircleSnapshotMeta, ) -> Result<bool, TestError>

Source

pub async fn circle_package_in( &self, commit_ref: &StoreBatchCommitRef, ) -> CirclePackageRef

Source

pub async fn circle_package_object_present( &self, package: &CirclePackageRef, activation: &StoreBatchCommitRef, ) -> bool

Source

pub async fn publish_competing_store_head( &self, journal: &CircleOperationJournal, ) -> (ExactObjectRef, ExactObjectRef)

Source

pub async fn publish_third_candidate_winner( &self, peer_db: &Database, candidate: &BlockedMergeCandidate, )

Source

pub async fn overwrite_membership_head( &self, reference: &MembershipHeadRef, head: &AuthorHead, )

Source

pub async fn delete_membership_head_for_test( &self, reference: &MembershipHeadRef, ) -> Result<(), StorageError>

Source

pub async fn pending_device_join_observation( &self, pending: &DeviceJoinJournalDatabase, offer: &DeviceJoinOffer, ) -> Result<PendingDeviceJoinObservation<'_>, TestError>

Source

pub async fn open_pending_device_join( &self, pending: &DeviceJoinJournalDatabase, identity: &UserKeypair, offer: DeviceJoinOffer, ) -> Result<PendingDeviceJoinAuthority<'_>, TestError>

Source

pub async fn prepare_snapshot_bootstrap<'a>( &'a self, membership_floor: &MembershipFloor, binary_schema_version: u32, target_path: &Path, restorer_identity: &UserKeypair, ) -> Result<PreparedSnapshotBootstrap<'a>, SnapshotError>

Source

pub async fn bind_device_in( &self, db: &Database, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<TestDevice, StoreError>

Source

pub async fn bind_device( &self, db: &Database, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<TestDevice, StoreError>

Source

pub async fn drain_uploads( &self, database: &StoreDatabase, store_dir: &StoreDir, clock: &dyn Clock, routing_encryption: Option<&EncryptionService>, observer: Option<&dyn BlobTransitionObserver>, ) -> Result<DrainOutcome, TestError>

Source

pub async fn activate_joined_device( &self, observer_db: &Database, observer_store_dir: StoreDir, joining_db: &Database, joining_store_dir: StoreDir, joining_identity: &UserKeypair, published_at: &str, ) -> Result<TestDevice, TestError>

Source

pub async fn bind_store_device( &self, database: &StoreDatabase, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<TestDevice, TestError>

Source

pub async fn admit_member( &self, db: &Database, store_dir: StoreDir, identity: &UserKeypair, member_pubkey: &str, member_email: Option<&str>, role: MemberRole, encryption: &EncryptionService, store_name: &str, ) -> Result<MemberAdmission, MembershipOpsError>

Source

pub async fn admit_and_activate_peer( &self, observer_db: &Database, observer_db_store_dir: StoreDir, peer_db: &Database, peer_db_store_dir: StoreDir, peer: &UserKeypair, ) -> Result<TestDevice, TestError>

Source

pub async fn remove_member( &self, db: &Database, store_dir: StoreDir, identity: &UserKeypair, member_pubkey: &str, encryption: &EncryptionService, master_keys: &dyn MasterKeyCustody, ) -> Result<String, MembershipOpsError>

Source

pub async fn device_id(&self, name: &str) -> Result<String, TestError>

Source

pub async fn latest_store_position( &self, ) -> Result<Option<StoreBatchCommitRef>, TestError>

Source

pub async fn load_commit_for_test( &self, reference: &StoreBatchCommitRef, ) -> Result<VerifiedStoreBatchCommit, TestError>

Source

pub async fn load_membership_head_for_test( &self, reference: &MembershipHeadRef, ) -> Result<AuthorHead, TestError>

Source

pub async fn load_registration_for_test( &self, reference: &StoreDeviceRegistrationRef, ) -> Result<StoreDeviceRegistration, TestError>

Source

pub async fn load_store_package_for_test( &self, reference: &StoreBatchCommitRef, ) -> Result<Option<VerifiedObject<Vec<u8>>>, TestError>

Source

pub async fn prepare_founder_store_partition_blob_for_test( &self, fact: &StoreWriteBlobFact, authority: &BlobWriteAuthority<'_>, ) -> Result<(), StoreError>

Source

pub async fn next_commit_sequence(&self, name: &str) -> Result<u64, TestError>

Source

pub async fn founder_device_authority( &self, ) -> Result<TestDeviceSigningAuthority, TestError>

Source

pub async fn open_into( &self, db: &Database, store_dir: StoreDir, ) -> Result<TestDevice, StoreInitializationError>

Source

pub async fn open_into_store_database( &self, database: &StoreDatabase, store_dir: StoreDir, ) -> Result<TestDevice, StoreInitializationError>

Source

pub async fn publish_pending( &self, db: &Database, store_dir: &StoreDir, ) -> Result<bool, TestError>

Source

pub async fn publish_pending_store_database( &self, database: &StoreDatabase, store_dir: &StoreDir, ) -> Result<bool, TestError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,