From d4aaf70b306cafa5abd43510e5b994ff222da875 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 6 Sep 2026 10:08:41 +0000 Subject: [PATCH] new THORChainDataOutput class --- mmgen/proto/rune/tx/data_output.py | 24 ++++++++++++++++++++++++ test/modtest_d/tx.py | 5 ++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 mmgen/proto/rune/tx/data_output.py diff --git a/mmgen/proto/rune/tx/data_output.py b/mmgen/proto/rune/tx/data_output.py new file mode 100755 index 00000000..8fb2072a --- /dev/null +++ b/mmgen/proto/rune/tx/data_output.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +# +# MMGen Wallet, a terminal-based cryptocurrency wallet +# Copyright (C)2013-2026 The MMGen Project +# Licensed under the GNU General Public License, Version 3: +# https://www.gnu.org/licenses +# Public project repositories: +# https://github.com/mmgen/mmgen-wallet +# https://gitlab.com/mmgen/mmgen-wallet + +""" +proto.rune.tx.data_output: THORChain data output class +""" + +from ....tx.data_output import DataOutput + +class THORChainDataOutput(DataOutput): + + desc = 'memo' + + @property + def max_len(self): + from ....swap.proto.thorchain.memo import THORChainMemo + return THORChainMemo.max_len diff --git a/test/modtest_d/tx.py b/test/modtest_d/tx.py index 2e97de97..e65228e8 100755 --- a/test/modtest_d/tx.py +++ b/test/modtest_d/tx.py @@ -116,6 +116,9 @@ class unit_tests: def data_output_btc(self, name, ut, desc='BitcoinDataOutput class'): return self._data_output(ut, 'btc') + def data_output_rune(self, name, ut, desc='THORChainDataOutput class'): + return self._data_output(ut, 'rune') + def _data_output(self, ut, coin): proto = init_proto(cfg, coin) from mmgen.tx.data_output import DataOutput @@ -151,7 +154,7 @@ class unit_tests: 'data:', 'hexdata:', 'data:' + 'x' * (max_len + 1), - 'hexdata:' + ('deadbeef' * (max_len // 4)) + 'ee', + 'hexdata:' + ('deadbeefdeadbeef' * (max_len // 2)) + 'ee', 'hex:0abc', 'da:xyz', 'hexdata:xyz',