diff --git a/src/ledger/src/store/mod.rs b/src/ledger/src/store/mod.rs index 498776a22..f73ee032f 100644 --- a/src/ledger/src/store/mod.rs +++ b/src/ledger/src/store/mod.rs @@ -1547,6 +1547,20 @@ impl LedgerStatus { // Asset issuance should match the currently registered key } + let get_effect_asset = |derived_asset_code: &AssetTypeCode| -> Option { + for (code, asset) in &txn_effect.new_asset_codes { + let dc = AssetTypeCode::from_prefix_and_raw_asset_type_code( + AssetTypePrefix::UserDefined, + &code, + &CFG.checkpoint, + self.td_commit_height, + ); + if dc == *derived_asset_code { + return Some(asset.clone()) + } + } + return None + }; // New issuance numbers // (1) Must refer to a created asset type // - NOTE: if the asset type is created in this transaction, this @@ -1560,7 +1574,7 @@ impl LedgerStatus { let asset_type = self .asset_types .get(&code) - .or_else(|| txn_effect.new_asset_codes.get(&code).cloned()) + .or_else(|| get_effect_asset(&code)) .c(d!())?; let proper_key = asset_type.properties.issuer; if *iss_key != proper_key {