485: Update assert_weight test to account for a range up to 8 bytes. r=bonomat a=bonomat
Fixes#482
Weights fluctuate because of the length of the signatures. Valid ecdsa signatures can have 68, 69, 70, 71, or 72 bytes. Since most of our transactions have 2 signatures the weight can be up to 8 bytes less than the static weight (4 bytes per signature).
Since it is really hard to get these short signatures (<1 in 100), I also include the transaction in the assert message which will help for debugging purposes.
Source: https://medium.com/coinmonks/on-bitcoin-transaction-sizes-97e31bc9d816
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>