Skip to content

Commit f3af412

Browse files
authored
Don't sign an empty commit (#2494)
Since fixing #2458 , we saw that we needlessly signed an empty commit; if we do this the fee estimation fails; because there's no need to sign an empty commit!
2 parents 0fd5d53 + cb6e708 commit f3af412

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

hydra-tui/src/Hydra/Client.hs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,18 @@ withClient Options{hydraNodeHost = Host{hostname, port}, cardanoSigningKey, card
120120
runReq defaultHttpConfig request
121121
<&> responseBody
122122
>>= \DraftCommitTxResponse{commitTx} ->
123-
case cardanoConnection of
124-
Left bfProject -> do
125-
prj <- liftIO $ BF.projectFromFile bfProject
126-
void $ BF.runBlockfrostM prj $ BF.submitTransaction $ signTx sk commitTx
127-
Right socketPath ->
128-
submitTransaction cardanoNetworkId socketPath $ signTx sk commitTx
123+
let tx =
124+
-- Don't sign the tx if there's nothing to commit (i.e. empty
125+
-- commit).
126+
if payload == mempty
127+
then commitTx
128+
else signTx sk commitTx
129+
in case cardanoConnection of
130+
Left bfProject -> do
131+
prj <- liftIO $ BF.projectFromFile bfProject
132+
void $ BF.runBlockfrostM prj $ BF.submitTransaction tx
133+
Right socketPath ->
134+
submitTransaction cardanoNetworkId socketPath tx
129135
where
130136
request =
131137
Req.req

0 commit comments

Comments
 (0)