How to raise the bad-txns-vout-negative error? I wanted to replicate the bad-txns-vout-negative error scenario. I tried the following but getting 'Amount out of range' only:
Here is the command i tried:
bitcoin-cli -named createrawtransaction inputs=&quot;[{\&quot;txid\&quot;:\&quot;af7cc9204d0ab7d52f66a5dacb79b77c34c90013e3288a391557ee8e07c3c307\&quot;,\&quot;vout\&quot;:&quot;0&quot;}]&quot; outputs=&quot;{\&quot;data\&quot;: \&quot;6e636861696e20626974636f696e207361746f73686920766973696f6e\&quot;,\&quot;myTmAe67rCuJU5X1fqKiEYohb53TEQrxP3\&quot;: 6.249996,\&quot;mt8QSx6m6Fwqt8zMVcji16UiVYS8xYRwFi\&quot;: -0.001000}&quot;
error code: -3
error message:
Amount out of range
The createrawtransaction command will do a sanity check of the arguments and return the Amount out of range error if the value is not &gt;= 0 and &lt;= 21000000 * 10e7, so that you don't shoot yourself in the foot.
You need to craft the invalid on your own, you can see an example of precisely what you are trying to achieve in the functional test suite (which uses python-bitcoinlib).