@@ -266,9 +266,9 @@ library LineraTypes {
266266 // choice=7 corresponds to ReadBalanceOwners
267267 // choice=8 corresponds to ChainOwnership
268268 // choice=9 corresponds to ReadDataBlob
269- CryptoHash read_data_blob;
269+ DataBlobHash read_data_blob;
270270 // choice=10 corresponds to AssertDataBlobExists
271- CryptoHash assert_data_blob_exists;
271+ DataBlobHash assert_data_blob_exists;
272272 }
273273
274274 function BaseRuntimePrecompile_case_chain_id ()
@@ -277,8 +277,8 @@ library LineraTypes {
277277 returns (BaseRuntimePrecompile memory )
278278 {
279279 AccountOwner memory read_owner_balance;
280- CryptoHash memory read_data_blob;
281- CryptoHash memory assert_data_blob_exists;
280+ DataBlobHash memory read_data_blob;
281+ DataBlobHash memory assert_data_blob_exists;
282282 return BaseRuntimePrecompile (uint8 (0 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
283283 }
284284
@@ -288,8 +288,8 @@ library LineraTypes {
288288 returns (BaseRuntimePrecompile memory )
289289 {
290290 AccountOwner memory read_owner_balance;
291- CryptoHash memory read_data_blob;
292- CryptoHash memory assert_data_blob_exists;
291+ DataBlobHash memory read_data_blob;
292+ DataBlobHash memory assert_data_blob_exists;
293293 return BaseRuntimePrecompile (uint8 (1 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
294294 }
295295
@@ -299,8 +299,8 @@ library LineraTypes {
299299 returns (BaseRuntimePrecompile memory )
300300 {
301301 AccountOwner memory read_owner_balance;
302- CryptoHash memory read_data_blob;
303- CryptoHash memory assert_data_blob_exists;
302+ DataBlobHash memory read_data_blob;
303+ DataBlobHash memory assert_data_blob_exists;
304304 return BaseRuntimePrecompile (uint8 (2 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
305305 }
306306
@@ -310,8 +310,8 @@ library LineraTypes {
310310 returns (BaseRuntimePrecompile memory )
311311 {
312312 AccountOwner memory read_owner_balance;
313- CryptoHash memory read_data_blob;
314- CryptoHash memory assert_data_blob_exists;
313+ DataBlobHash memory read_data_blob;
314+ DataBlobHash memory assert_data_blob_exists;
315315 return BaseRuntimePrecompile (uint8 (3 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
316316 }
317317
@@ -321,8 +321,8 @@ library LineraTypes {
321321 returns (BaseRuntimePrecompile memory )
322322 {
323323 AccountOwner memory read_owner_balance;
324- CryptoHash memory read_data_blob;
325- CryptoHash memory assert_data_blob_exists;
324+ DataBlobHash memory read_data_blob;
325+ DataBlobHash memory assert_data_blob_exists;
326326 return BaseRuntimePrecompile (uint8 (4 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
327327 }
328328
@@ -331,8 +331,8 @@ library LineraTypes {
331331 pure
332332 returns (BaseRuntimePrecompile memory )
333333 {
334- CryptoHash memory read_data_blob;
335- CryptoHash memory assert_data_blob_exists;
334+ DataBlobHash memory read_data_blob;
335+ DataBlobHash memory assert_data_blob_exists;
336336 return BaseRuntimePrecompile (uint8 (5 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
337337 }
338338
@@ -342,8 +342,8 @@ library LineraTypes {
342342 returns (BaseRuntimePrecompile memory )
343343 {
344344 AccountOwner memory read_owner_balance;
345- CryptoHash memory read_data_blob;
346- CryptoHash memory assert_data_blob_exists;
345+ DataBlobHash memory read_data_blob;
346+ DataBlobHash memory assert_data_blob_exists;
347347 return BaseRuntimePrecompile (uint8 (6 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
348348 }
349349
@@ -353,8 +353,8 @@ library LineraTypes {
353353 returns (BaseRuntimePrecompile memory )
354354 {
355355 AccountOwner memory read_owner_balance;
356- CryptoHash memory read_data_blob;
357- CryptoHash memory assert_data_blob_exists;
356+ DataBlobHash memory read_data_blob;
357+ DataBlobHash memory assert_data_blob_exists;
358358 return BaseRuntimePrecompile (uint8 (7 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
359359 }
360360
@@ -364,28 +364,28 @@ library LineraTypes {
364364 returns (BaseRuntimePrecompile memory )
365365 {
366366 AccountOwner memory read_owner_balance;
367- CryptoHash memory read_data_blob;
368- CryptoHash memory assert_data_blob_exists;
367+ DataBlobHash memory read_data_blob;
368+ DataBlobHash memory assert_data_blob_exists;
369369 return BaseRuntimePrecompile (uint8 (8 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
370370 }
371371
372- function BaseRuntimePrecompile_case_read_data_blob (CryptoHash memory read_data_blob )
372+ function BaseRuntimePrecompile_case_read_data_blob (DataBlobHash memory read_data_blob )
373373 internal
374374 pure
375375 returns (BaseRuntimePrecompile memory )
376376 {
377377 AccountOwner memory read_owner_balance;
378- CryptoHash memory assert_data_blob_exists;
378+ DataBlobHash memory assert_data_blob_exists;
379379 return BaseRuntimePrecompile (uint8 (9 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
380380 }
381381
382- function BaseRuntimePrecompile_case_assert_data_blob_exists (CryptoHash memory assert_data_blob_exists )
382+ function BaseRuntimePrecompile_case_assert_data_blob_exists (DataBlobHash memory assert_data_blob_exists )
383383 internal
384384 pure
385385 returns (BaseRuntimePrecompile memory )
386386 {
387387 AccountOwner memory read_owner_balance;
388- CryptoHash memory read_data_blob;
388+ DataBlobHash memory read_data_blob;
389389 return BaseRuntimePrecompile (uint8 (10 ), read_owner_balance, read_data_blob, assert_data_blob_exists);
390390 }
391391
@@ -398,10 +398,10 @@ library LineraTypes {
398398 return abi.encodePacked (input.choice, bcs_serialize_AccountOwner (input.read_owner_balance));
399399 }
400400 if (input.choice == 9 ) {
401- return abi.encodePacked (input.choice, bcs_serialize_CryptoHash (input.read_data_blob));
401+ return abi.encodePacked (input.choice, bcs_serialize_DataBlobHash (input.read_data_blob));
402402 }
403403 if (input.choice == 10 ) {
404- return abi.encodePacked (input.choice, bcs_serialize_CryptoHash (input.assert_data_blob_exists));
404+ return abi.encodePacked (input.choice, bcs_serialize_DataBlobHash (input.assert_data_blob_exists));
405405 }
406406 return abi.encodePacked (input.choice);
407407 }
@@ -418,13 +418,13 @@ library LineraTypes {
418418 if (choice == 5 ) {
419419 (new_pos, read_owner_balance) = bcs_deserialize_offset_AccountOwner (new_pos, input);
420420 }
421- CryptoHash memory read_data_blob;
421+ DataBlobHash memory read_data_blob;
422422 if (choice == 9 ) {
423- (new_pos, read_data_blob) = bcs_deserialize_offset_CryptoHash (new_pos, input);
423+ (new_pos, read_data_blob) = bcs_deserialize_offset_DataBlobHash (new_pos, input);
424424 }
425- CryptoHash memory assert_data_blob_exists;
425+ DataBlobHash memory assert_data_blob_exists;
426426 if (choice == 10 ) {
427- (new_pos, assert_data_blob_exists) = bcs_deserialize_offset_CryptoHash (new_pos, input);
427+ (new_pos, assert_data_blob_exists) = bcs_deserialize_offset_DataBlobHash (new_pos, input);
428428 }
429429 require (choice < 11 );
430430 return (new_pos, BaseRuntimePrecompile (choice, read_owner_balance, read_data_blob, assert_data_blob_exists));
@@ -1160,6 +1160,41 @@ library LineraTypes {
11601160 return value;
11611161 }
11621162
1163+ struct DataBlobHash {
1164+ CryptoHash value;
1165+ }
1166+
1167+ function bcs_serialize_DataBlobHash (DataBlobHash memory input )
1168+ internal
1169+ pure
1170+ returns (bytes memory )
1171+ {
1172+ return bcs_serialize_CryptoHash (input.value);
1173+ }
1174+
1175+ function bcs_deserialize_offset_DataBlobHash (uint256 pos , bytes memory input )
1176+ internal
1177+ pure
1178+ returns (uint256 , DataBlobHash memory )
1179+ {
1180+ uint256 new_pos;
1181+ CryptoHash memory value;
1182+ (new_pos, value) = bcs_deserialize_offset_CryptoHash (pos, input);
1183+ return (new_pos, DataBlobHash (value));
1184+ }
1185+
1186+ function bcs_deserialize_DataBlobHash (bytes memory input )
1187+ internal
1188+ pure
1189+ returns (DataBlobHash memory )
1190+ {
1191+ uint256 new_pos;
1192+ DataBlobHash memory value;
1193+ (new_pos, value) = bcs_deserialize_offset_DataBlobHash (0 , input);
1194+ require (new_pos == input.length , "incomplete deserialization " );
1195+ return value;
1196+ }
1197+
11631198 struct GenericApplicationId {
11641199 uint8 choice;
11651200 // choice=0 corresponds to System
0 commit comments