proto.eth.tx: add mmid to output; check addrs, amt before signing

This commit is contained in:
The MMGen Project 2025-03-16 10:46:37 +00:00
commit 76a34a05b5
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 9 additions and 1 deletions

View file

@ -1 +1 @@
15.1.dev20
15.1.dev21

View file

@ -96,6 +96,8 @@ class New(Base, TxBase.New):
amt = self.proto.coin_amt(arg.amt or '0'),
is_chg = not arg.amt)
self.add_mmaddrs_to_outputs(ad_f, ad_w)
def get_unspent_nums_from_user(self, unspent):
from ....ui import line_input
while True:

View file

@ -74,6 +74,12 @@ class Unsigned(Completed, TxBase.Unsigned):
o = self.txobj
m = 'mismatch -- a compromised online installation may have altered your serialized data!'
assert o['from'] == self.inputs[0].addr, f'from_addr {m}'
if self.outputs:
assert o['to'] == self.outputs[0].addr, f'to_addr {m}'
assert o['amt'] == self.outputs[0].amt, f'to_amt {m}'
msg_r(f'Signing transaction{tx_num_str}...')
try: