Anastasia-Labs / lucid-evolution

https://anastasia-labs.github.io/lucid-evolution/
47 stars 21 forks source link

Provider evaluateTx return EvalRedeemer with redeemer_tag mismatch when transaction register and delegate to a stake pool #385

Closed leobel closed 10 hours ago

leobel commented 3 weeks ago

Provider (tested with Blokfrost on Preview) evaluateTx return EvalRedeemer.redeemer_tag == "certificate" when tx register certificate and delegate to a stake pool. Applying the evaluation then fails due to applyUPLCEvalProvider expecting EvalRedeemer.redeemer_tag == "publish":

export const toCMLRedeemerTag = (tag: string) => {
  switch (tag) {
    case "spend":
      return CML.RedeemerTag.Spend;
    case "mint":
      return CML.RedeemerTag.Mint;
    case "publish":
      return CML.RedeemerTag.Cert;
    case "withdraw":
      return CML.RedeemerTag.Reward;
    case "vote":
      return CML.RedeemerTag.Voting;
    case "propose":
      return CML.RedeemerTag.Proposing;
    default:
      throw new Error(`Exhaustive check failed: Unhandled case ${tag}`);
  }
};

Here is a tx you can test with:

84aa0081825820fd0fe35440a60946923a95a227cd7b79b0215e7356487aa083aeea5eb3ad1c2f00018182581d603dce7844f36b23b8c3f90afba40aa188e7f1d3f6e8acd1d544ed1da91a0073e9d7021a00062829031a03ce59980481840b8201581c354cc2d68b7cb4ee4a87d714ab2a80e69ae1c8e07981835b6a9c1c51581c094dc39da2d8434f9ddb93749a1930288e5dd89ae04fa5914e157bd61a001e84800b582000000000000000000000000000000000000000000000000000000000000000000d81825820d6da036c1aeb7680323258c763a2a6e25be9b280c2a8fedd5e43cb89730fdadf011082581d603dce7844f36b23b8c3f90afba40aa188e7f1d3f6e8acd1d544ed1da91b000000025002c138111a004c4b401281825820d6da036c1aeb7680323258c763a2a6e25be9b280c2a8fedd5e43cb89730fdadf00a30081825820000000003dce7844f36b23b8c3f90afba40aa188e7f1d3f6e8acd1d544ed1da9584000f899d39b17fd5d66c192c4b50d343e42f7235b30504c8ae7619f93c828dc6dce4568dd69177c551828492d777a6727fd66c2fbccbda8c2aeed92032c99790a0581840200d87a808200000781591438591435010100332323232323232323232323232322259800991919191919191919191919192994c004c0040262646464b300100e8acc004c024c06cdd500744c9660020030158992cc004006264b300100180bc4c96600200315980098120014566002601a603e6ea800e264b300100180cc4c96600200301a80d406a0351323259800800c072264b300100180ec07603b01d899192cc00400603f13259800800c08204102081044c966002605a007159800980b18141baa00a8992cc00400604513259800800c08e047023811c4c8c9660020030258992cc00400604d026813409a26464b300100181444c966002003029814c0a605313259800981b001c4c8c8c8c8c8c94cc0d8cdcb24810d6368616c6c656e676549643a20003732660426ea40052201001325330373372c9201157369676e616c73206368616c6c656e676549643a2000373266044600260726ea80192201001325330383372c920114697320666f72206576616c756574696f6e3f3a2000598009811181c9baa3001303a375406314910474727565008a490566616c73650040dc2646464b3001302a303c37540031325980099b8748010c0f4dd5000c4c94cc0f4cdcb249095a6b446174756d3a2000373266050002910100159800800c5660026058607c6ea8006264b300100181cc4c96600200303a81d40ea0751323259800800c0f2264b300100181ec0f607b03d899192cc00400607f13259800800c5660026096005159800981a18231baa0018992cc00400608313259800800c10a08504282144c8c9660020030448992cc00400608b045822c11626464b3001001823c4c96600200304882441220911323259800800c12a264b3001001825c12e09704b899192cc00400609b13259800800c13a09d13259800982d001c4c8cc00400400888c96600200515330573372c9201117665726966696564207573657249643a20003732660846ea406122010015330573372c9201087573657249643a2000373266084603c60b26ea809922010015980099b8f018375c603c60b26ea809a2a660ae66e592410f766572696669656420686173683a20003732660846ea405522010015330573372c920106686173683a2000373266084604060b26ea809922010015980099b8f015375c604060b26ea809a2646464b30013049305b375400313232598009825982e9baa001899191919192cc004c140c188dd500144c94cc188cdcb24811175736572496420286e756d626572293a200037326609a6ea002122010015330623372c9201127077644861736820286e756d626572293a200037326609a6ea001922010015330623372c9201146368616c6c656e676520286e756d626572293a200037326609a6ea000522010015330623372c92010a6f766572666c6f773a200037326609a6ea000922010015980099919119bc6337886eecdd7181618339baa03337846eb8c0bcc19cdd501999bc53378a66f10ddd9bae302c306737540426f08dd7181798339baa0213378864b30010018a998332491077726f6e6720766b5f69632073697a6500168994c004c1b400a00737760028020dd71835800a0d2375860d460d660d660d660d660ce6ea8084de11bae302e3067375404266f10ddd9bae302e306737540666f08dd7183518359835983598339baa0213001001222259800801c400626464b30010048b46600200d00198370024cddb00199bb8375a60da0086eec00900620d6306d004375c60d60068348cc198dd4004198331ba8006330663750002660cc6ea0020cc198dd4000998331ba80064bd704528c54cc1892401267a6b5f7665726966792870726f6f662c207075626c69632c207a6b657929203f2046616c73650014a08308dd6983318319baa0028a99830a49b86578706563742028536f6d65286368616c6c656e6765292c206f766572666c6f7729203d0a2020202020207768656e207363616c61722e6e6577286e756d4368616c6c656e676529206973207b0a20202020202020204e6f6e65202d3e20287363616c61722e6e6577286d6f645f696e7465676572286e756d4368616c6c656e67652c207363616c61722e6669656c645f7072696d6529292c2031290a20202020202020206e202d3e20286e2c2030290a2020202020207d001641806eb4c194c198008c190004c966002609260c06ea80062660c6601066e180092082808080e0fffffffffbdfe5ffbf81a4fbceaa80bbe88488b0e79983a9dfcea9a69dedbe0e330634c10101004bd7044cc18c004cc18d30010100004bd7020bc300700133794944dd71813982f9baa02c375a60c260bc6ea80062a660b892014265787065637420536f6d65286861736829203d207363616c61722e66726f6d5f6279746561727261795f6269675f656e6469616e287369676e616c732e68617368290016416c60066eb8c090c174dd50151bad305f305c3754003153305a49014665787065637420536f6d652875736572496429203d207363616c61722e66726f6d5f6279746561727261795f6269675f656e6469616e287369676e616c732e757365724964290016416460026eb8c080c16cdd50141180119bca4a20024b30015980099b8948000006266e200052082808080e0fffffffffbdfe5ffbf81a4fbceaa80bbe88488b0e79983a9dfcea9a69dedbe0e8a50415d130243305c375000297ae08a60103d87a8000415d15330574912365787065637420766572696669656448617368203d3d207369676e616c732e6861736800164159153305749127657870656374207665726966696564557365724964203d3d207369676e616c732e7573657249640016415913259800800c14e0a7053829c4c8c00cc17c010dd7000a0be305c0024168600400504f415c6eb000609d04e416860ae00282a8c15c00cdd7000a0ae3054001414860a80066eb80050541828800a09e3051003375c0028288c13800504c18270019bae001413860960028248c11cdd5000c1010444101048410208104082020983049001411c60920066eb80050491823000a0883046003375c0028230c10c005041181f9baa00181c207881c40e207103841106082607c6ea80062a6607892012765787065637420496e6c696e65446174756d286461746129203d206f75747075742e646174756d001640ec6008607a6ea8c100c104c0f4dd51820181e9baa0018a9981da497565787065637420536f6d65286163636f756e74496e70757429203d0a2020202020207265666572656e63655f696e707574730a20202020202020207c3e2066696e645f6163636f756e745f696e70757428706172616d732e706f6c6963795f69642c20706172616d732e61737365745f6e616d6529001640e86644646600200201444b30010018a60103d87a8000899192cc004c0a8c966002605660846ea80062900044dd6982318219baa001410064b3001302b3042375400314c103d87a8000899198008009bab30473044375400444b30010018a6103d87a80008991919192cc004cdc8806001456600266e3c03000a26026660966ea00052f5c114c0103d87a8000411913300600600341186eb4c12000cdd7182300118250011824000a08c410064660020026eacc118c11cc10cdd51823182398219baa0032259800800c530103d87a80008991919192cc004cdc8806001456600266e3c03000a26024660946e980052f5c114c0103d87a8000411513300600600341146eacc11c00cdd7182280118248011823800a08a898061982200125eb8226600800800281f8c114008c10c0050411bae3001303c37540666eb8c010c0f0dd50199181f800a994c004c08cc0e8dd51801181d9baa0328acc00566002600200914a313001375c600660766ea802103845268a9981ca49596578706563740a20202020202020207369676e616c732e6368616c6c656e6765203d3d206368616c6c656e67654964207c7c207369676e616c732e6368616c6c656e6765203d3d207369676e616c732e6368616c6c656e6765001640e1159800980080245268a9981ca48127657870656374207369676e616c732e6368616c6c656e6765203d3d206368616c6c656e67654964001640e081c0dc79bae3002303a375400e4607a607c607c00246078607a00264646e50004dd9800991919191919191804198201ba7300537586082006660806e9cc014dd61820802198201ba798009bac3041002a5eb82446464646608a601a6608a608c0066608a6ea4c030dd59823001198229ba93232598009819000c5221008acc004c0b400626eb8c120c114dd500144c8c8dca0009bb3001304830453754004821104218219baa001304600133045304630470014bd700021823000982280098201baa0024018660806ea4c01cdd598208009982018209821000a5eb80c104c104004c100004c0fc004c0e8dd501714c00400697ae0911981f181f981e1baa0020014008444646600200200844b3001001880244cc00cc100004cc008008c10400503e11bb3374c0026e952000375860706072606a6ea80a4c0dcc0e0008c0d8004c0c8dd501240a90331bae00140d860660028188c0cc00cdd7000a066303000140b860600066eb80050301816800a05630293754015021409902140a86eb800502d1815000a050302a003375c0028150c09c00502518138019bae001409c60480028110c080dd5001c06101d4061021406203101880c204a30220014080604400501680b405a02c8118c08000501e180e1baa00e80a203280a40520290144084603c603e004603a00260326ea802a2b30013370e9003004c4c8c8c96600201d13232598009805800c566002603c6ea80422a005018407d1598009803000c566002603c6ea80422a005018407d15980099b87480100062b3001301e37540211500280c203e80c2036406c80d8c070dd50078992cc004c0280062b3001300a301c37540051323232598009804180f9baa0028992cc004c024c080dd5001454cc07ccdcb2490d73637269707420686173683a20003732660146ea400522010014a301c40786eb8c08cc080dd5001406d01d181118118011810800980e9baa00280c20348acc004c0140062b30013370e9003180e1baa002899191919192cc004c028c084dd5002454cc080cdcb2490d73637269707420686173683a2000373266016604a60446ea801122010015980099b87001482024bd00629462a6604092012b6465706f736974203d3d207374616b65526567697374726174696f6e4465706f736974203f2046616c73650014a080fa03c80f8dd698121812801181180098118011810800980e9baa00280ca0348a9980da491a496e636f7272656374205075626c6973682052656465656d65720016406880d0c06cdd5007405a02d01680b2042301e301f002375a603a00260326ea802a2c80b10161b8748008c004004889660026e29221022c20008998029bad0020018991919b8a488102682700001329800800ccdc01b8d0024800666e2922010127000034004444b3001337100049000440062646465300100699b800054800666e2ccdc00012cc004cdc40012402914818229037203a3371666e000056600266e2000520148a40c11481b901d002200c3370c004901019b8300148080cdc70020012034375c00494c00400e26464646464646601800400266e2922010128000025980099b880034803a266e0120f2010038acc004cdc4001a41000513370066e01208014003480362c80d901b2cc004006266e292201035b5d2900005899b8a489035b5f20009800800ccdc52441025d2900005914c00402600530060014025229800804c00a0028049008203c375860380046eb4c068004c8cdd81ba8301a001374e60360026ea800e264b3001001899b8a4881027b7d00003899b8a489037b5f20003232330010010032259800800c400e2b300130220018994c004026603c003337149101023a20009800804cc07c00600880490091810800c4ca6002013301e00199b8a489023a20009800804cc07c006600c66006006604600480490091810800a03e407c66e2922102207d0000340706eac00e264b3001001899b8a489025b5d00003899b8a489035b5f20009800800ccdc52441015d00003914c00401e0053004001401d229800803c00a00280390062038375800680f84444646600200200a44b30010018802c566002603e003133003301e001005899802180f00099801001180f800a038407044646600200200644b30013005001899b8a4890130000038acc004cdc4000a40011337149101012d0033002002337029000000c4cc018cdc2000a402866e2ccdc019b85001480512060003405480a8dc3a40006002002444b3001337120049000440063300100399b840024805266e2ccdc019b85002480512060001400c8088c03cdd50009809180980118088009808801180780098059baa0018a4d153300949011856616c696461746f722072657475726e65642066616c7365001365640202a6600c92011272656465656d65723a2052656465656d6572001615330054914a657870656374205a6b446174756d207b207573657249643a2076657269666965645573657249642c20686173683a207665726966696564486173682c207a6b6579207d203d2064617461001615330044911972656465656d65723a205075626c69736852656465656d6572001615330034917865787065637420526567697374657243726564656e7469616c207b0a2020202020202020202063726564656e7469616c3a20536372697074287363726970745f68617368292c0a202020202020202020206465706f7369743a204e657665722c0a20202020202020207d203d2063657274696669636174650016153300249190657870656374205265676973746572416e6444656c656761746543726564656e7469616c207b0a2020202020202020202063726564656e7469616c3a20536372697074287363726970745f68617368292c0a2020202020202020202064656c65676174652c0a202020202020202020206465706f7369742c0a20202020202020207d203d20636572746966696361746500165734ae7155ceaab9e5573eae815d0aba2574898130d8799f581cb8a5e329b500a66376047165cdfce62c3ecf245fd81d101533f814224a466f6e74757323303030d87980ff0001f5f6