From 7d31c25a201d376ee8d2ac84aeda2da8995ea20e Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 6 Sep 2026 10:08:42 +0000 Subject: [PATCH] proto.vm.tx.new: check data arg with `DataOutput` --- mmgen/proto/vm/tx/new.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mmgen/proto/vm/tx/new.py b/mmgen/proto/vm/tx/new.py index 63a3756c..965d75b0 100755 --- a/mmgen/proto/vm/tx/new.py +++ b/mmgen/proto/vm/tx/new.py @@ -43,9 +43,10 @@ class New: async def process_cmdline_args(self, cmd_args, ad_f, ad_w): def process_data_arg(arg): - assert arg.startswith('data:'), f'{arg}: invalid data arg (must start with "data:")' - self.swap_memo = arg.removeprefix('data:') - self.set_gas_with_data(self.swap_memo.encode()) + from ....tx.data_output import DataOutput + res = DataOutput(self.proto, arg) # test data for validity + self.swap_memo = str(res) + self.set_gas_with_data(res) match len(cmd_args): case 1: