Skip to content

Commit e55a274

Browse files
authored
Merge pull request #513 from Emurgo/evgenii/add_mint_fix
fix 'add_mint' summarization
2 parents 8b0a2b2 + 10dbfca commit e55a274

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

rust/src/tx_builder.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,12 @@ impl TransactionBuilder {
10981098
.map(|m| m.get(&policy_id).as_ref().cloned())
10991099
.unwrap_or(None)
11001100
.unwrap_or(MintAssets::new());
1101-
asset.insert(asset_name, amount);
1101+
if let Some(mint_amount) = asset.get(asset_name) {
1102+
let new_amount = mint_amount.0 + amount.0;
1103+
asset.insert(asset_name, Int(new_amount));
1104+
} else {
1105+
asset.insert(asset_name, amount);
1106+
}
11021107
self._set_mint_asset(&policy_id, policy_script, &asset);
11031108
}
11041109

0 commit comments

Comments
 (0)