fix(primitives): Make cost models optional (#167)

This commit is contained in:
Santiago Carmuega 2022-08-07 21:39:04 -03:00 committed by GitHub
parent 180ab2bbde
commit 69644d4a0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -163,10 +163,10 @@ pub use crate::alonzo::CostModel;
#[cbor(map)]
pub struct CostMdls {
#[n(0)]
pub plutus_v1: CostModel,
pub plutus_v1: Option<CostModel>,
#[n(1)]
pub plutus_v2: CostModel,
pub plutus_v2: Option<CostModel>,
}
#[derive(Encode, Decode, Debug, PartialEq, Clone)]
@ -593,6 +593,8 @@ mod tests {
include_str!("../../../test_data/babbage1.block"),
include_str!("../../../test_data/babbage2.block"),
include_str!("../../../test_data/babbage3.block"),
// peculiar block with single plutus cost model
include_str!("../../../test_data/babbage4.block"),
];
for (idx, block_str) in test_blocks.iter().enumerate() {

1
test_data/babbage4.block Normal file

File diff suppressed because one or more lines are too long