Browse Source

objtest.py: add `CoinAddr` test for ETH

The MMGen Project 5 months ago
parent
commit
9a859bac70
1 changed files with 17 additions and 0 deletions
  1. 17 0
      test/objtest_py_d/ot_eth_mainnet.py

+ 17 - 0
test/objtest_py_d/ot_eth_mainnet.py

@@ -11,8 +11,25 @@ from decimal import Decimal
 
 from mmgen.obj import ETHNonce
 from mmgen.amt import ETHAmt
+from mmgen.protocol import init_proto
+from mmgen.addr import CoinAddr
+
+from ..include.common import cfg
+
+proto = init_proto(cfg, 'eth', need_amt=True)
 
 tests = {
+	'CoinAddr': {
+		'arg1': 'addr',
+		'good':  (
+			{'addr':'beadcafe' * 5, 'proto':proto},
+		),
+		'bad':  (
+			{'addr':'aaaaxxxx' * 5, 'proto':proto},
+			{'addr':'beadcafe' * 2, 'proto':proto},
+			{'addr':'beadcafe' * 6, 'proto':proto},
+		),
+	},
 	'ETHAmt': {
 		'bad':  ('-3.2','0.1234567891234567891',123,'123L',
 					{'num':'1','from_decimal':True},