pub fn has_inputs_and_outputs(tx: &Transaction) -> Result<(), TransactionError>Expand description
Checks that the transaction has inputs and outputs.
ยงConsensus
[Sapling onward] If effectiveVersion < 5, then at least one of tx_in_count, nSpendsSapling, and nJoinSplit MUST be nonzero.
[Sapling onward] If effectiveVersion < 5, then at least one of tx_out_count, nOutputsSapling, and nJoinSplit MUST be nonzero.
[NU5 onward] If effectiveVersion = 5 then this condition MUST hold: tx_in_count > 0 or nSpendsSapling > 0 or (nActionsOrchard > 0 and enableSpendsOrchard = 1).
[NU5 onward] If effectiveVersion = 5 then this condition MUST hold: tx_out_count > 0 or nOutputsSapling > 0 or (nActionsOrchard > 0 and enableOutputsOrchard = 1).
[NU6.3 onward] If effectiveVersion >= 6 then this condition MUST hold: tx_in_count > 0 or nSpendsSapling > 0 or (nActionsOrchard > 0 and enableSpendsOrchard = 1) or (nActionsIronwood > 0 and enableSpendsIronwood = 1).
[NU6.3 onward] If effectiveVersion >= 6 then this condition MUST hold: tx_out_count > 0 or nOutputsSapling > 0 or (nActionsOrchard > 0 and enableOutputsOrchard = 1) or (nActionsIronwood > 0 and enableOutputsIronwood = 1).
https://zips.z.cash/protocol/protocol.pdf#txnconsensus
This check counts both Coinbase and PrevOut transparent inputs.