Skip to content

Commit be9d398

Browse files
authored
Add conversion tests for pending blobs. (#3124)
## Motivation In #3121 I added gRPC message types but forgot to write conversion unit tests. ## Proposal Add the missing tests. ## Test Plan This! ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links - PR with missing tests: #3121 - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 29c7584 commit be9d398

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

linera-rpc/src/grpc/conversions.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ pub mod tests {
951951

952952
use linera_base::{
953953
crypto::{BcsSignable, CryptoHash, KeyPair},
954-
data_types::{Amount, Round, Timestamp},
954+
data_types::{Amount, Blob, Round, Timestamp},
955955
};
956956
use linera_chain::{
957957
data_types::{Block, BlockExecutionOutcome},
@@ -1085,6 +1085,20 @@ pub mod tests {
10851085
round_trip_check::<_, api::ChainInfoQuery>(chain_info_query_some);
10861086
}
10871087

1088+
#[test]
1089+
pub fn test_pending_blob_request() {
1090+
let chain_id = ChainId::root(2);
1091+
let blob_id = Blob::new(BlobContent::new_data(*b"foo")).id();
1092+
let pending_blob_request = (chain_id, blob_id);
1093+
round_trip_check::<_, api::PendingBlobRequest>(pending_blob_request);
1094+
}
1095+
1096+
#[test]
1097+
pub fn test_pending_blob_result() {
1098+
let blob = BlobContent::new_data(*b"foo");
1099+
round_trip_check::<_, api::PendingBlobResult>(blob);
1100+
}
1101+
10881102
#[test]
10891103
pub fn test_lite_certificate() {
10901104
let key_pair = KeyPair::generate();

0 commit comments

Comments
 (0)