This snippet asserts that there is no overflow. So maybe we should rename it to safe_add_u128?
We certainly need some negative tests to check that the VM crashes on overflow. safe_mul_u128 has very thorough negative tests that could be used as inspiration.
This snippet asserts that there is no overflow. So maybe we should rename it to
safe_add_u128
?We certainly need some negative tests to check that the VM crashes on overflow.
safe_mul_u128
has very thorough negative tests that could be used as inspiration.