The documentation suggests that the redeemers "map" in the Transaction type is sorted on ScriptPurpose (also defined nearby):
|
/// > Redeemers are ordered by ascending [ScriptPurpose](./transaction.html#ScriptPurpose). |
However, this is not the case unless there is some preprocessing. The plutus-ledger-api ScriptPurpose is different from the cardano-ledger script purpose. Like most things in the script context, the ordering follows the ledger types and specs, not the plutus types. For whatever reason, IOG decided to make the plutus ScriptPurpose ordering different...
Concretely, minting redeemers do not seem to appear at the beginning of redeemers in aiken code, as one might expect looking at ScriptPurpose. It's actually spending redeemers that appear first.
The documentation suggests that the redeemers "map" in the
Transactiontype is sorted onScriptPurpose(also defined nearby):stdlib/lib/cardano/transaction.ak
Line 68 in 5fb16bf
However, this is not the case unless there is some preprocessing. The plutus-ledger-api
ScriptPurposeis different from the cardano-ledger script purpose. Like most things in the script context, the ordering follows the ledger types and specs, not the plutus types. For whatever reason, IOG decided to make the plutusScriptPurposeordering different...Concretely, minting redeemers do not seem to appear at the beginning of redeemers in aiken code, as one might expect looking at
ScriptPurpose. It's actually spending redeemers that appear first.