new THORChainDataOutput class
This commit is contained in:
parent
4d1e17865b
commit
d4aaf70b30
2 changed files with 28 additions and 1 deletions
24
mmgen/proto/rune/tx/data_output.py
Executable file
24
mmgen/proto/rune/tx/data_output.py
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# MMGen Wallet, a terminal-based cryptocurrency wallet
|
||||
# Copyright (C)2013-2026 The MMGen Project <mmgen@tuta.io>
|
||||
# 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
|
||||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue