From 144612c6fc1bdd987e5734f71c7da70217726626 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 18 May 2020 10:20:27 +0000 Subject: [PATCH] global rename: MMGenTXLabel -> MMGenTxLabel --- mmgen/obj.py | 2 +- mmgen/tx.py | 10 +++++----- test/objtest_py_d/ot_btc_mainnet.py | 2 +- test/test_py_d/common.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mmgen/obj.py b/mmgen/obj.py index cb1611f8..46971382 100755 --- a/mmgen/obj.py +++ b/mmgen/obj.py @@ -844,7 +844,7 @@ class TwComment(MMGenLabel): desc = 'tracking wallet comment' exc = BadTwComment -class MMGenTXLabel(MMGenLabel): +class MMGenTxLabel(MMGenLabel): max_len = 72 desc = 'transaction label' diff --git a/mmgen/tx.py b/mmgen/tx.py index 487202e7..9dbcffce 100755 --- a/mmgen/tx.py +++ b/mmgen/tx.py @@ -320,7 +320,7 @@ class MMGenTX(MMGenObject): self.send_amt = g.proto.coin_amt('0') # total amt minus change self.fee = g.proto.coin_amt('0') self.hex = '' # raw serialized hex transaction - self.label = MMGenTXLabel('') + self.label = MMGenTxLabel('') self.txid = '' self.coin_txid = '' self.timestamp = '' @@ -421,12 +421,12 @@ class MMGenTX(MMGenObject): # returns true if comment added or changed def add_comment(self,infile=None): if infile: - self.label = MMGenTXLabel(get_data_from_file(infile,'transaction comment')) + self.label = MMGenTxLabel(get_data_from_file(infile,'transaction comment')) else: # get comment from user, or edit existing comment m = ('Add a comment to transaction?','Edit transaction comment?')[bool(self.label)] if keypress_confirm(m,default_yes=False): while True: - s = MMGenTXLabel(my_raw_input('Comment: ',insert_txt=self.label)) + s = MMGenTxLabel(my_raw_input('Comment: ',insert_txt=self.label)) if s: lbl_save = self.label self.label = s @@ -1198,7 +1198,7 @@ class MMGenTX(MMGenObject): if len(tx_data) == 5: # rough check: allow for 4-byte utf8 characters + base58 (4 * 11 / 8 = 6 (rounded up)) - assert len(tx_data[-1]) < MMGenTXLabel.max_len*6,'invalid comment length' + assert len(tx_data[-1]) < MMGenTxLabel.max_len*6,'invalid comment length' c = tx_data.pop(-1) if c != '-': desc = 'encoded comment (not base58)' @@ -1206,7 +1206,7 @@ class MMGenTX(MMGenObject): comment = baseconv.tobytes(c,'b58').decode() assert comment != False,'invalid comment' desc = 'comment' - self.label = MMGenTXLabel(comment,on_fail='raise') + self.label = MMGenTxLabel(comment,on_fail='raise') desc = 'number of lines' # four required lines metadata,self.hex,inputs_data,outputs_data = tx_data diff --git a/test/objtest_py_d/ot_btc_mainnet.py b/test/objtest_py_d/ot_btc_mainnet.py index 85976e3e..5a13d3ef 100755 --- a/test/objtest_py_d/ot_btc_mainnet.py +++ b/test/objtest_py_d/ot_btc_mainnet.py @@ -184,7 +184,7 @@ tests = { text_jp[:40], text_zh[:40] ) }, - 'MMGenTXLabel':{ + 'MMGenTxLabel':{ 'bad': (utf8_text[:73],utf8_combining[:72],utf8_ctrl[:72],gr_uc_w_ctrl), 'good': (utf8_text[:72],) }, diff --git a/test/test_py_d/common.py b/test/test_py_d/common.py index 74df6793..ba556bb1 100755 --- a/test/test_py_d/common.py +++ b/test/test_py_d/common.py @@ -47,13 +47,13 @@ non_mmgen_fn = 'coinkey' ref_dir = os.path.join('test','ref') dfl_words_file = os.path.join(ref_dir,'98831F3A.mmwords') -from mmgen.obj import MMGenTXLabel,TwComment +from mmgen.obj import MMGenTxLabel,TwComment tx_label_jp = text_jp tx_label_zh = text_zh lcg = ascii_cyr_gr if g.platform == 'win' else lat_cyr_gr # MSYS2 popen_spawn issue -tx_label_lat_cyr_gr = lcg[:MMGenTXLabel.max_len] # 72 chars +tx_label_lat_cyr_gr = lcg[:MMGenTxLabel.max_len] # 72 chars tw_label_zh = text_zh[:TwComment.max_screen_width // 2] tw_label_lat_cyr_gr = lcg[:TwComment.max_screen_width] # 80 chars