<p>Looks like the transaction is created with a different version of <code>cardano-cli</code>.</p>
<p>Can you please confirm the file <code>/tmp/tx.dummy</code> is the same as <code>tx-1622014393N.dummy</code>?</p>

CC BY-SA 4.0
2021-05-26T08:21:40.930Z
Yes. It turns out I indeed created with 1.26.2. Thanks
Rene SECUR
CC BY-SA 4.0
2021-05-26T08:15:47.470Z
2021-05-26T08:15:47.470Z
Marek Mahut - StakeNuts
<p>From you example, it looks like your <code>--tx-out-count</code> is <code>2</code> and not <code>1</code>, unsure about the <code>witness-count</code>, should be <code>1</code> I guess. Could fixing this help?</p>

CC BY-SA 4.0
2021-05-27T11:31:40.367Z
2021-05-27T11:52:15.480Z
2021-05-27T11:52:15.480Z
Alekseï Stakhanov
<p>When using cardano-cli version 1.27.0 I want to calculate the min fee for the transaction. The procedure is to create a dummy transaction and using that to calculate the fee.</p>
<p>When creating the dummy transaction using:</p>
<p><code>cardano-cli transaction build-raw  --tx-in 1...x#2 --tx-out addr1...a+0 --tx-out addr1...b+0 --invalid-hereafter 30458092 --fee 0 --out-file tx-1622014393N.dummy</code></p>
<p>The transaction file then contains the correct era indicator:</p>
<p><code>&quot;type&quot;:&quot;TxBodyMary&quot;</code></p>
<p>However, when I then calculate min fee on this transaction, an error occurs:</p>
<p><code>cardano-cli transaction calculate-min-fee --tx-body-file /tmp/tx.dummy --protocol-params-file /tmp/protocol.json --tx-in-count 1 --tx-out-count 1 --witness-count 2 --byron-witness-count 0 --mainnet</code></p>
<p>Response:</p>
<p><code>Command failed: transaction calculate-min-fee  Error: /tmp/tx.dummy: TextEnvelope decode error: DecoderErrorDeserialiseFailure &quot;Shelley TxBody&quot; (DeserialiseFailure 1 &quot;expected list of length 3&quot;)</code></p>

<cardano-cli>
cardano-cli calculate-min-fee expects Shelley era transaction body
# cardano-cli calculate-min-fee expects Shelley era transaction body

(Asked by: username_0 on 2021-05-26)

When using cardano-cli version 1.27.0 I want to calculate the min fee for the transaction. The procedure is to create a dummy transaction and using that to calculate the fee.

When creating the dummy transaction using:

`cardano-cli transaction build-raw --tx-in 1...x#2 --tx-out addr1...a+0 --tx-out addr1...b+0 --invalid-hereafter 30458092 --fee 0 --out-file tx-1622014393N.dummy`

The transaction file then contains the correct era indicator:

`"type":"TxBodyMary"`

However, when I then calculate min fee on this transaction, an error occurs:

`cardano-cli transaction calculate-min-fee --tx-body-file /tmp/tx.dummy --protocol-params-file /tmp/protocol.json --tx-in-count 1 --tx-out-count 1 --witness-count 2 --byron-witness-count 0 --mainnet`

Response:

`Command failed: transaction calculate-min-fee Error: /tmp/tx.dummy: TextEnvelope decode error: DecoderErrorDeserialiseFailure "Shelley TxBody" (DeserialiseFailure 1 "expected list of length 3")`

**Tags:** cardano-cli

---

## 2 answers

### Answer by username_1 on 2021-05-26. Score: 2 | Accepted answer

Looks like the transaction is created with a different version of `cardano-cli`.

Can you please confirm the file `/tmp/tx.dummy` is the same as `tx-1622014393N.dummy`?

> **Comments:**
> **username_0**: Yes. It turns out I indeed created with 1.26.2. Thanks  

---

### Answer by username_2 on 2021-05-27. Score: 0

From you example, it looks like your `--tx-out-count` is `2` and not `1`, unsure about the `witness-count`, should be `1` I guess. Could fixing this help?


---

