Skip to content

Commit

Permalink
fix: fix order of ExUnits in insert-d-parameter transaction (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmbientTea authored Dec 9, 2024
1 parent a3a7a8f commit cde1094
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion toolkit/offchain/src/csl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl ScriptExUnits {
pub(crate) fn get_validator_budgets(
mut responses: Vec<OgmiosEvaluateTransactionResponse>,
) -> Result<ScriptExUnits, JsError> {
responses.sort_unstable_by_key(|r| r.validator.index);
responses.sort_by_key(|r| r.validator.index);
let (mint_ex_units, spend_ex_units) = responses
.into_iter()
.partition::<Vec<_>, _>(|response| response.validator.purpose == "mint");
Expand Down
3 changes: 2 additions & 1 deletion toolkit/offchain/src/d_param/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ where
hex::encode(tx.to_bytes())
)
})?;
let mint_witness_ex_units = get_validator_budgets(evaluate_response)?;
let mut mint_witness_ex_units = get_validator_budgets(evaluate_response)?;
mint_witness_ex_units.mint_ex_units.reverse();
let tx = mint_d_param_token_tx(
validator,
policy,
Expand Down

0 comments on commit cde1094

Please sign in to comment.