FourthState / plasma-mvp-sidechain

Cosmos SDK (Tendermint consensus) side-chain implementation for plasma
Apache License 2.0
112 stars 35 forks source link

Spending Tx with a fee #134

Closed colin-axner closed 5 years ago

colin-axner commented 5 years ago

Summary of bug

Unable to do a successful spend with a fee. ## Expected behavior

Successful transaction

Actual behavior

plasmacli spend 0x5475b99e01ac3bb08b24fd754e2868dbb829bc3a 900 acc1 --position "(0.0.0.3)" --fee 100 

Error: [{"msg_index":"0","success":false,"log":{\"codespace\":\"sdk\",\"code\":6,\"message\":\"output does not exist\"}"}]

Transaction printed out:

Input0: Position: (0.0.0.3), Signature: 0xec5ae10d85672b2408e1f176c5b663979fcb34c0705e63bffe33ae125f02b1272ed5ace8854a18e6f069f11e47c4e374019546325248a25d7f8e7c2eace4990300, Confirm Signatures: nil
Input1: Position: (0.0.0.0), Signature: 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, Confirm Signatures: nil
Output0: Owner: 5475b99e01ac3bb08b24fd754e2868dbb829bc3a, Amount: 900
Output1: Owner: 0000000000000000000000000000000000000000, Amount: 0
Fee: 100
plasmacli query balance acc1
Position: (0.0.0.3) , Amount: 1000
Total: 1000

Steps to reproduce

Deposit on rootchain, send include-deposit transaction. Attempt to spend deposit with fee ## Versions/External Software

On branch colin/client

colin-axner commented 5 years ago

Ante handler is modifying the output here and here

This caused the signing address to be returned differently since the TxHash would now be different, leading to a non existent output being spent in the spendhandler.

colin-axner commented 5 years ago

Should be fixed in #129

AdityaSripal commented 5 years ago

Verified that it has been fixed 👍