You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug 🐛
It seems that the validTransition function I wrote for my program isn't being used when updating the state channel. I've experimentally verified this by purposefully sending incorrect states but they aren't being picked up by the wallet and flagged as incorrect. Using versions 0.3.0 for all packages.
To Reproduce
Steps to reproduce the behavior:
Go to monopoly.now.sh in two tabs, preferably in different browsers
Click on Create Room in one, and Join Room in the other
Click Start Game on host side
Click Next state and wait until a property purchase window shows up
Purchase property, note that balance deducted is 2x what it shows on the property card
Continue clicking nextState until it shows nextPlayer in the bottom left
Open console to see that the channel update succeeded even when incorrect states are sent
Expected behavior
Channel should not be updated to reflect incorrect states, instead there should be a revert or error or some kind to alert the user that an invalid transition was sent.
Thanks for raising this @SirNeural. Validating transitions is definitely something we need to support in our wallets -- in fact we have had this working in previous browser wallets and currently have it working in our server wallet. We'll look to get this integrated into our next release of the browser wallet.
@SirNeural commented on Sat Aug 29 2020
Describe the bug 🐛
It seems that the validTransition function I wrote for my program isn't being used when updating the state channel. I've experimentally verified this by purposefully sending incorrect states but they aren't being picked up by the wallet and flagged as incorrect. Using versions 0.3.0 for all packages.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Channel should not be updated to reflect incorrect states, instead there should be a revert or error or some kind to alert the user that an invalid transition was sent.
Screenshots (if applicable)
Popup for purchasing, note amount is $100 and balance of player test1 is $1500
Purchased, note balance is now $1300, meaning $200 was deducted
Channel update with this double purchase was allowed, which should fail
Additional context
src/store/index.ts in my code contains the double charging modification I made to test if the contract was being verified
contracts/Monopoly.sol in my code shows the verification method and where I use applyChange to tell the contract to expect how much to be deducted (not doubled)
@geoknee commented on Tue Sep 08 2020
Thanks for raising this @SirNeural. Validating transitions is definitely something we need to support in our wallets -- in fact we have had this working in previous browser wallets and currently have it working in our server wallet. We'll look to get this integrated into our next release of the browser wallet.
@geoknee commented on Tue Sep 22 2020
Code that does what we want in the
server-wallet
package https://github.com/statechannels/statechannels/blob/master/packages/server-wallet/src/evm-validator.tsThe text was updated successfully, but these errors were encountered: