MCPcopy
hub / github.com/bigchaindb/bigchaindb / test_high_amounts

Function test_high_amounts

tests/validation/test_transaction_structure.py:194–209  ·  view source on GitHub ↗
(b, create_tx, alice)

Source from the content-addressed store, hash-verified

192
193
194def test_high_amounts(b, create_tx, alice):
195 # Should raise a SchemaValidationError - don't want to allow ridiculously
196 # large numbers to get converted to int
197 create_tx.outputs[0].amount = 10 ** 21
198 create_tx.sign([alice.private_key])
199 validate_raises(create_tx)
200 # Should raise AmountError
201 create_tx.outputs[0].amount = 9 * 10 ** 18 + 1
202 create_tx._id = None
203 create_tx.sign([alice.private_key])
204 validate_raises(create_tx, AmountError)
205 # Should pass
206 create_tx.outputs[0].amount -= 1
207 create_tx._id = None
208 create_tx.sign([alice.private_key])
209 validate(create_tx)
210
211
212################################################################################

Callers

nothing calls this directly

Calls 3

validate_raisesFunction · 0.85
signMethod · 0.80
validateFunction · 0.70

Tested by

no test coverage detected