MockDuniterStorageService class

Mock implementation of DuniterStorageService for testing All methods return configurable mock data without network calls

Implemented types

Constructors

MockDuniterStorageService()

Properties

blockHeightNotifier → ValueListenable<int>
no setteroverride
currencyConstants ↔ ChainConstants
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
nameMultiLookupCount ↔ int
Number of times getIdentityIndexByNameMulti was called, lets batching tests assert that N lookups coalesced into a single call.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
udInfoNotifier → ValueListenable<UniversalDividendInfo>
no setteroverride

Methods

accountSurvivesAtZero(String address) → Future<bool>
Whether address keeps existing once its balance reaches zero.
override
blocNumberToDate(int blocNumber, DateTime genesisBlockchainTime) → DateTime
inherited
dateToBlockNumber(DateTime date, DateTime genesisBlockchainTime) → int
Convert a DateTime to an approximate block number Inverse of blocNumberToDate
inherited
dispose() → void
inherited
getBalance(String address) → Future<WalletBalance>
Fetch balance for a single account via the runtime API (1 RPC call).
override
getBalances(List<String> addresses) → Future<Map<String, WalletBalance>>
Batch retrieval of balances for multiple addresses.
inherited
getBlockHash(int blockNumber) → Future<String>
inherited
getBlockNumberByHash(String hash) → Future<int>
inherited
getCertPeriodBlocks() → int
override
getCertPeriodDuration() → Duration
override
getCertsCounter(String address) → Future<CertificationData>
override
getCertsCountersBatch(List<String> addresses) → Future<Map<String, CertificationData>>
Batch retrieval of certification data for multiple addresses. Uses batch RPC calls for optimal performance (single RPC call).
inherited
getCertState({required String fromAddress, required String toAddress}) → Future<CertState>
override
getCertValidityPeriod(String from, String to) → Future<int>
inherited
getCurrentBlockHeight() → Future<int>
override
getGenesisBlockchainTime() → Future<DateTime>
override
getIdentityIndexByName(String name) → Future<int?>
Index of the on-chain identity that reserved name, or null if the name is free. Authoritative exact-match lookup over the IdentitiesNames storage map (names are reserved at identity confirmation, freed on removal). name is UTF-8 encoded to the raw IdtyName byte key.
override
getIdentityIndexByNameMulti(List<String> names) → Future<List<int?>>
Batch retrieval of identity indexes for multiple exact names. Single RPC via polkadart's multiIdentitiesNames. Order is preserved and the result is padded to names.length (same contract as getIdentityIndexOfMulti).
override
getIdentityIndexOf(String address) → Future<int?>
inherited
getIdentityIndexOfMulti(List<String> addresses) → Future<List<int?>>
Batch retrieval of identity indexes for multiple addresses. Uses a single RPC call via polkadart's multiIdentityIndexOf.
inherited
getIdtyStatus(String address) → Future<IdtyStatus>
override
getIdtyStatusByIndex(int idtyIndex) → Future<IdtyStatus>
inherited
getIdtyStatusMulti(List<String> addresses) → Future<List<IdtyStatus>>
Batch retrieval of identity statuses for multiple addresses. Uses batch RPC calls for optimal performance.
inherited
getLastFinalizedHash() → Future<String>
inherited
getMembershipExpiryDate(String address, {required int currentBlockNumber}) → Future<DateTime?>
inherited
getMembershipStatus(String address) → Future<MembershipStatus>
inherited
getMigrateWalletChecks({required String fromAddress, required String toAddress}) → Future<MigrateWalletChecks>
inherited
getOldOwnerKey(String address) → Future<OldOwnerKey?>
inherited
getProfileData(String address) → Future<ProfileData>
Retrieve all profile data (identity status, balance, certifications) in 1-2 RPC calls.
inherited
hasAccountConsumers(String address) → Future<bool>
inherited
hasPendingDistanceEvaluation(String address) → Future<bool>
Whether a distance evaluation is currently pending for the identity at address. Used by callers that need to know if a re-membership path has actually been triggered (e.g., after a batched certify + distance eval, a sub-call failure via non-atomic utility.batch would leave no pending request on-chain even though the batch "succeeded" overall).
inherited
invalidateGenesisTimeCache() → void
Invalidate the cached genesis time (e.g. on network change)
override
isSmith(String address) → Future<bool>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
override
setAccountSurvivesAtZero(String address, {bool survives = true}) → void
Mark address as identity-backed, i.e. sufficients > 0 on chain, so it survives at zero balance.
setBalance(String address, WalletBalance balance) → void
setCertData(String address, CertificationData data) → void
setCertPeriodBlocks(int blocks) → void
setCertPeriodDuration(Duration duration) → void
setCertState(String toAddress, CertState state, {String? fromAddress}) → void
setCurrentBlockHeight(int height) → void
setGenesisTime(DateTime time) → void
setIdtyStatus(String address, IdtyStatus status) → void
setReservedName(String name, {int index = 1}) → void
Mark name as reserved by an on-chain identity (with an arbitrary index).
subscribeBalance(String address, void onUpdate(WalletBalance)) → Future<StreamSubscription<StorageChangeSet>>
inherited
subscribeBalancesBatch(List<String> addresses, void onUpdate(String address, WalletBalance balance)) → Future<StreamSubscription<StorageChangeSet>>
inherited
subscribeCertsBatch(List<String> addresses, void onUpdate(String address, CertificationData data)) → Future<StreamSubscription<StorageChangeSet>>
inherited
subscribeIdtyStatusBatch(List<String> addresses, void onUpdate(String address, IdtyStatus status)) → Future<StreamSubscription<StorageChangeSet>>
inherited
subscribeToCertsCounter(String address, void onUpdate(CertificationData)) → Future<StreamSubscription<StorageChangeSet>>
inherited
subscribeToCurrentBlockNumber() → Future<void>
inherited
subscribeToIdtyStatus(String address, void onUpdate(IdtyStatus)) → Future<StreamSubscription<StorageChangeSet>>
inherited
subscribeToUniversalDividend() → Future<void>
Getters to subscribes storage values
inherited
toString() → String
A string representation of this object.
inherited
unsubscribeFromCurrentBlockNumber() → Future<void>
inherited
unsubscribeFromUniversalDividend() → Future<void>
inherited
updateWithOnlineData() → Future<void>
Update storage service with online data when connection is established
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited