Browse Source

Critical Ethereum THORChain swap bugfix

If you swap from Ethereum, please upgrade immediately.

The bug caused the funds to be returned to the wallet, minus a small fee.  No
significant loss of funds would have occurred.  Swaps to ETH were unaffected.
The MMGen Project 8 months ago
parent
commit
2adf35502d
3 changed files with 3 additions and 3 deletions
  1. 1 1
      mmgen/data/version
  2. 1 1
      mmgen/proto/eth/tx/unsigned.py
  3. 1 1
      test/cmdtest_d/ethswap.py

+ 1 - 1
mmgen/data/version

@@ -1 +1 @@
-15.1.dev28
+15.1.dev29

+ 1 - 1
mmgen/proto/eth/tx/unsigned.py

@@ -47,7 +47,7 @@ class Unsigned(Completed, TxBase.Unsigned):
 			'gasprice': o['gasPrice'].toWei(),
 			'value':    o['amt'].toWei() if o['amt'] else 0,
 			'nonce':    o['nonce'],
-			'data':     bytes.fromhex(o['data'])}
+			'data':     self.swap_memo.encode() if self.is_swap else bytes.fromhex(o['data'])}
 
 		from ..pyethereum.transactions import Transaction
 		etx = Transaction(**o_conv).sign(wif, o['chainId'])

+ 1 - 1
test/cmdtest_d/ethswap.py

@@ -245,7 +245,7 @@ class CmdTestEthSwapEth(CmdTestEthSwapMethods, CmdTestSwapMethods, CmdTestEthdev
 
 	bals = lambda self, k: {
 		'swap1': [('98831F3A:E:1', '123.456')],
-		'swap2': [('98831F3A:E:1', '114.690979')],
+		'swap2': [('98831F3A:E:1', '114.690978056')],
 	}[k]
 
 	cmd_group_in = CmdTestEthdev.cmd_group_in + (