From 4e0beb5947b7e75ee7974d82a1447e89a0b4b5d6 Mon Sep 17 00:00:00 2001 From: stringhandler Date: Wed, 28 Oct 2026 11:31:49 +0200 Subject: [PATCH] Generate Bitcoin jet CMRs and costs Remove unimplemented code in generated bitcoin jets. --- Haskell-Generate/GenRustJets.hs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Haskell-Generate/GenRustJets.hs b/Haskell-Generate/GenRustJets.hs index e0790889f..8ba6d5a37 100644 --- a/Haskell-Generate/GenRustJets.hs +++ b/Haskell-Generate/GenRustJets.hs @@ -154,11 +154,6 @@ showRustHash h = fillSep $ ((<> comma) . format <$> chunksOf 2 str_h) rustJetCmr :: Module -> Doc a rustJetCmr mod = vsep $ [ nest 4 (vsep ("fn cmr(&self) -> Cmr {" : --- Temporary if statement until Bitcoin Jets have weight costs assigned to them --- See Haskell/Simplicity/Bitcoin/Jets.hs: jetCost (BitcoinJet jt) = error "Simplicity.Bitcoin.Jets.jetCost: :TODO: Implement jets for Bitcoin and benchmark them." - if Just "Bitcoin" == moduleName mod - then ["unimplemented!(\"Bitcoin jet CMRs weights have not yet been implemented.\")"] - else [ nest 4 (vsep ("let bytes = match self {" : map (<>comma) [ nest 4 (vsep @@ -247,9 +242,7 @@ rustJetDecode mod = rustJetCost :: Module -> Doc a rustJetCost mod = vsep $ [ nest 4 (vsep ("fn cost(&self) -> Cost {" : - if modname == "Bitcoin" - then ["unimplemented!(\"Unspecified cost of Bitcoin jets\")"] - else [ nest 4 (vsep ("match self {" : + [ nest 4 (vsep ("match self {" : map (<>comma) [ pretty modname <> "::" <> pretty (jetName jet) <+> "=>" <+> "Cost::from_milliweight(" <> (pretty . milliWeight $ jetCost jet) <> ")"