Skip to content

Commit

Permalink
Merge pull request #132 from zoedberg/fix_blank_builder
Browse files Browse the repository at this point in the history
fix blank_builder to avoid AssetTagMissed error
  • Loading branch information
dr-orlovsky authored Jan 18, 2024
2 parents 3e1e417 + 5ed4957 commit e9985d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/persistence/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ pub trait Inventory: Deref<Target = Self::Stash> {
)));
}

let builder = if let Some(iimpl) = schema_ifaces.iimpls.get(&iface.iface_id()) {
let mut builder = if let Some(iimpl) = schema_ifaces.iimpls.get(&iface.iface_id()) {
TransitionBuilder::blank_transition(iface.clone(), schema.clone(), iimpl.clone())
.expect("internal inconsistency")
} else {
Expand All @@ -528,6 +528,12 @@ pub trait Inventory: Deref<Target = Self::Stash> {
)
.expect("internal inconsistency")
};
let tags = self.contract_asset_tags(contract_id)?;
for (assignment_type, asset_tag) in tags {
builder = builder
.add_asset_tag_raw(*assignment_type, *asset_tag)
.expect("tags are in bset and must not repeat");
}

Ok(builder)
}
Expand Down

0 comments on commit e9985d4

Please sign in to comment.