Skip to content

Commit

Permalink
tests: fix cashaddr checksum test unreliability
Browse files Browse the repository at this point in the history
needs to seed the RNG because there is some low chance of failure.
  • Loading branch information
EchterAgo committed Aug 3, 2020
1 parent 9954742 commit 2089176
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/tests/test_cashaddrenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@

import binascii
import unittest
import random
from random import Random
from .. import cashaddr


random = Random()


BCH_PREFIX = "bitcoincash"
BCH_TESTNET_PREFIX = "bchtest"

Expand Down Expand Up @@ -57,6 +60,10 @@
class TestCashAddrAddress(unittest.TestCase):
"""Unit test class for cashaddr addressess."""

def setUp(self):
global random
random = Random(42)

# Valid address sizes from the cashaddr spec
valid_sizes = [160, 192, 224, 256, 320, 384, 448, 512]

Expand Down

0 comments on commit 2089176

Please sign in to comment.