test: create assert_not_equal util and add to where imports are needed

In the functional tests there are lots of cases where we assert != which
this new util will replace, we also are adding the imports and the new assertion
This commit is contained in:
kevkevin
2024-02-27 19:41:12 -06:00
committed by kevkevinpal
parent 930b237f16
commit 7bb83f6718
41 changed files with 137 additions and 83 deletions

View File

@@ -17,6 +17,7 @@ Exports:
import unittest
from hashlib import sha256
from test_framework.util import assert_not_equal
class FE:
"""Objects of this class represent elements of the field GF(2**256 - 2**32 - 977).
@@ -40,7 +41,7 @@ class FE:
num = (num * b._den) % FE.SIZE
else:
den = (den * b) % FE.SIZE
assert den != 0
assert_not_equal(den, 0)
if num == 0:
den = 1
self._num = num