Bug
votingScriptWitnessSingleton calls fromJust on the result of getVotingScriptCredentials, which returns Nothing when the VotingProcedures map is empty. Passing an empty VotingProcedures paired with a witness crashes at runtime.
The bug exists in two places:
Fix
votingScriptWitnessSingleton should return Map.empty when getVotingScriptCredentials returns Nothing, rather than calling fromJust.
Bug
votingScriptWitnessSingletoncallsfromJuston the result ofgetVotingScriptCredentials, which returnsNothingwhen theVotingProceduresmap is empty. Passing an emptyVotingProcedurespaired with a witness crashes at runtime.The bug exists in two places:
Cardano.Api.Experimental.Tx.Internal.BodyContent.New:529— full bug: noMaybeguard on the witness at allCardano.Api.Tx.Internal.Body:762— partial fix:Nothingwitness is handled, butJust witnesspaired with empty procedures still crashesFix
votingScriptWitnessSingletonshould returnMap.emptywhengetVotingScriptCredentialsreturnsNothing, rather than callingfromJust.