Skip to content

Commit 4397978

Browse files
committed
Eliminate the support in the service since we do not want it.
1 parent 5af4001 commit 4397978

File tree

3 files changed

+2
-32
lines changed

3 files changed

+2
-32
lines changed

linera-sdk/src/service/runtime.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ where
160160
base_wit::assert_data_blob_exists(hash.into())
161161
}
162162

163-
/// Returns true if the corresponding contract uses a zero amount of storage.
164-
pub fn has_trivial_storage(&self, application: ApplicationId) -> bool {
165-
base_wit::has_trivial_storage(application.into())
166-
}
167163
}
168164

169165
impl<Application> ServiceRuntime<Application>

linera-sdk/src/service/test_runtime.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ where
3434
owner_balances: Mutex<Option<HashMap<AccountOwner, Amount>>>,
3535
query_application_handler: Mutex<Option<QueryApplicationHandler>>,
3636
expected_http_requests: Mutex<VecDeque<(http::Request, http::Response)>>,
37-
expected_has_trivial_storage_requests: Mutex<VecDeque<(ApplicationId, bool)>>,
3837
blobs: Mutex<Option<HashMap<DataBlobHash, Vec<u8>>>>,
3938
scheduled_operations: Mutex<Vec<Vec<u8>>>,
4039
key_value_store: KeyValueStore,
@@ -66,7 +65,6 @@ where
6665
owner_balances: Mutex::new(None),
6766
query_application_handler: Mutex::new(None),
6867
expected_http_requests: Mutex::new(VecDeque::new()),
69-
expected_has_trivial_storage_requests: Mutex::new(VecDeque::new()),
7068
blobs: Mutex::new(None),
7169
scheduled_operations: Mutex::new(vec![]),
7270
key_value_store: KeyValueStore::mock(),
@@ -413,18 +411,6 @@ where
413411
.push_back((request, response));
414412
}
415413

416-
/// Adds an expected `has_trivial_storage` call, and the response it should return in the test.
417-
pub fn add_expected_has_trivial_storage_requests(
418-
&mut self,
419-
application: ApplicationId,
420-
response: bool,
421-
) {
422-
self.expected_has_trivial_storage_requests
423-
.lock()
424-
.unwrap()
425-
.push_back((application, response));
426-
}
427-
428414
/// Makes an HTTP `request` as an oracle and returns the HTTP response.
429415
///
430416
/// Should only be used with queries where it is very likely that all validators will receive
@@ -495,19 +481,6 @@ where
495481
);
496482
}
497483

498-
/// Returns true if the corresponding contract uses a zero amount of storage.
499-
pub fn has_trivial_storage(&self, application: ApplicationId) -> bool {
500-
let maybe_request = self
501-
.expected_has_trivial_storage_requests
502-
.lock()
503-
.unwrap()
504-
.pop_front();
505-
let (expected_application_id, response) =
506-
maybe_request.expect("Unexpected has_trivial_storage request");
507-
assert_eq!(application, expected_application_id);
508-
response
509-
}
510-
511484
/// Loads a mocked value from the `slot` cache or panics with a provided `message`.
512485
fn fetch_mocked_value<T>(slot: &Mutex<Option<T>>, message: &str) -> T
513486
where

linera-views/src/views/key_value_store_view.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,9 @@ impl<C: Context> KeyValueStoreView<C> {
396396
/// # use linera_views::views::View;
397397
/// # let context = MemoryContext::new_for_testing(());
398398
/// let mut view = KeyValueStoreView::load(context).await.unwrap();
399+
/// view.insert(vec![0, 1], vec![0,1,2,3,4]).await.unwrap();
399400
/// let total_size = view.total_size();
400-
/// assert_eq!(total_size, SizeData::default());
401+
/// assert_eq!(total_size, SizeData { key: 2, value: 5});
401402
/// # })
402403
/// ```
403404
pub fn total_size(&self) -> SizeData {

0 commit comments

Comments
 (0)