magmo / apps Goto Github PK
View Code? Open in Web Editor NEWProof of concept applications that use the Force Move Game framework.
Proof of concept applications that use the Force Move Game framework.
Now that funding, conclusion, withdrawing and challenging are part of the wallet, we have quite a bit of unused code sprinkled throughout the app.
This is currently a TODO
For the initial implementation, the bot will use a random strategy
Currently if the app receives an invalid message we simply throw an error and the app stops working. We should show a message to the user.
Currently when accessing wallet.magmo.com it defaults to displaying the asset manifest not the actual index.html. This causes sites to embed the wallet to fail until the user visits wallet.magmo.com/index.html for the first time. (Then it works consistently after that)
It seems to fail in truffle with the following error:
ERROR: /Users/alexgap/code/apps/packages/wallet/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/src/index.js:50
throw new Error("Mnemonic invalid or undefined");
^
Error: Mnemonic invalid or undefined
at new v (/Users/alexgap/code/apps/packages/wallet/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/src/index.js:50:1)
at Object.provider (/Users/alexgap/code/apps/packages/wallet/truffle.js:28:23)
at Object.create (/Users/alexgap/code/apps/packages/wallet/node_modules/truffle/build/webpack:/packages/truffle-provider/index.js:15:1)
at Config.get [as provider] (/Users/alexgap/code/apps/packages/wallet/node_modules/truffle/build/webpack:/packages/truffle-config/index.js:202:1)
at Object.detect (/Users/alexgap/code/apps/packages/wallet/node_modules/truffle/build/webpack:/packages/truffle-core/lib/environment.js:59:1)
at Object.<anonymous> (/Users/alexgap/code/apps/packages/wallet/node_modules/truffle/build/webpack:/packages/truffle-core/lib/commands/migrate.js:170:1)
at cb (util.js:1420:39)
at process._tickCallback (internal/process/next_tick.js:63:19)
We currently only have deploy hooked up for the rps-poc
branch. (see here: https://console.cloud.google.com/cloud-build/triggers?authuser=1&project=rock-paper-scissors123)
We need to configure this for the apps
branch and figure out how the deployment script works with a monorepo.
Thinking of code line webpack config
Ideally instead of running all the tests every time a PR occurs we could make CircleCI testing a bit smarter and only run the tests for a package has changed (or it's dependency has changed).
This means if a change was made to rps
only the tests for rps
would be run. (On the flipside a change to wallet-client
would trigger all tests to run since all the other packages are dependent on it)
We need a subdomain (wallet.magmo.com?) and to have it hooked up to the deploy (permissions?)
Resign is not part of the language of our state machine. It would be nice for the UI to be consistent with the way we think about our code.
We should add solid documentation for the wallet-client
interfaces.
We could use jsdoc to generate html documentation from the interface comments.
Currently we have separate actions to approve funding, closing etc..(IE: FUNDING_APPROVED
, CONCLUDE_APPROVED
).
Instead of having separate actions for various different states we could consolidate these into a standard set of actions (APPROVE
, REJECT
) and rely on the current state to figure out what these actions apply to.
We currently do something like with transactions
as we have a set of actions that can apply to multiple states (TRANSACTION_SENT_TO_METAMASK
, TRANSACTION_SUBMITTED
, etc..)
Some actions will have to remain as state specific but a lot of them could be consolidated.
Currently we offer the user the option to approve/decline funding but we don't handle it gracefully.
When a user declines funding we should probably show a message and then dump them back in the lobby.
We should also let the other user know so they're not waiting indefinitely for funding
The tests for an app which interfaces the new wallet are quite RPS-specific, so for now are simply omitted. May need some work to reinstate.
We are using an old version (0.1.6) at present (latest version 0.3.5).
Since this will introduce some breaking changes (most notably the use of structs), we ought to think carefully about when to do it (i.e. before or after ETHDenver).
Following those in rps-poc/src/integration-tests
Currently our prebuilt artifacts for the testnets contain hard coded paths to my local machine. We only use the abi
, networks
and bytecode
section from these artifacts so we can sanitize the other information out.
This card is stolen from the TTT zube: When Player A funds and then picks a move before Player B clicks 'return to game' in the wallet, this move will not be reflected in Player B's app when they eventually do click 'return to game'. Moreover both players are now waiting for a move and the game cannot progress.
Needs an actionToRetry.
We should add some kind of splash screen to the wallet app so if someone goes to wallet.magmo.com they see something.
Currently when a game concludes, either player can send the concludeGame
to the adjudicator
. On slower networks this means both players can end up trying call concludeGame
. We need to handle the case where this happens gracefully. It might also be a good idea to proactively send the other wallet a message that a player is calling concludeGame
and display a message to avoid a failed transaction.
To repro:
At this point, you would expect to be able to play another round. But, one of the players gets stuck.
I am using Chrome for player A and Firefox for player B, but I doubt this issue is related to a specific browser.
Could just be copy-and-paste from rps-poc. Might want to wait until we've finished the refactor and extraction.
From Tom: Can do this as the very last step. All this adds is the signatures, deposits and security. The entire app (e.g. the user experience) can basically work without this.
Currently we do not return any event from the wallet when a channel is opened successfully and if something goes wrong we fail silently. We should throw events for both cases.
Currently fails with this error:
ERROR in ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'child_process' in '/Users/alexgap/code/apps/packages/wallet/node_modules/xmlhttprequest/lib'
@ ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js 15:12-36
@ ./node_modules/ethers/utils/web.js
@ ./node_modules/ethers/utils/index.js
@ ./src/utils/transaction-generator.ts
@ ./src/integration-tests/test-utils.ts
@ ./src/redux/reducers/__tests__/test-scenarios.ts
@ ./src/__stories__/index.tsx
@ ./.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/config/polyfills.js ./node_modules/@storybook/core/dist/server/config/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true
ERROR in ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'fs' in '/Users/alexgap/code/apps/packages/wallet/node_modules/xmlhttprequest/lib'
@ ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js 16:9-22
@ ./node_modules/ethers/utils/web.js
@ ./node_modules/ethers/utils/index.js
@ ./src/utils/transaction-generator.ts
@ ./src/integration-tests/test-utils.ts
@ ./src/redux/reducers/__tests__/test-scenarios.ts
@ ./src/__stories__/index.tsx
@ ./.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/config/polyfills.js ./node_modules/@storybook/core/dist/server/config/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true
For Player A (Xs) and Player B (Os).
Possibly also for Player A (Os) and Player B (Xs).
Be warned: this can take up to around turnNum ~ 40, and upwards of 100 mouse-clicks to test through the UI.
For Player A (Xs) and Player B (Os).
Possibly also for Player A (Os) and Player B (Xs).
input -> output tests of contracts that use the rps and/or ttt game libraries
While the fmg-simple-adjudicator
package has good tests, they implement only a very simple game library (namely a Counting Game).
If those tests pass, and the game-specific validTransition
function is also passing thorough tests, this ought to give us confidence that the whole thing works. However, end-to-end testing will give us more confidence and should help troubleshoot problems such as not getting refunded from a channel. Without the end-to-end tests, we couldn't be sure if the contracts were at fault, or simply that the app is not preparing the transactions correctly.
Currently if a player hits resign then selects selects no when asked if they want to conclude by the wallet nothing happens.
If a user selects no we should abort the close process and return control to the app.
CircleCI was failing due a process being killed (see https://circleci.com/gh/magmo/apps/81)
I've upgraded the node docker image which has seemed to fix it for now but we should look into what the original cause was and if we can improve our process so we're not running into a memory/cpu limit.
We should use the WithdrawAndClose so we only have to use one transaction to end the game instead of the two we use now.
This isn't essential for the wallet to function but it does make it a lot nicer.
Some screens have blue text, others white.
There are multiple places in the wallet and the app where things will fail silently. Two places that are pretty pervasive:
something_FAILURE
from the wallet.Need to pull in an improved assertRevert, since this currently will never throw an assertion error.
Or did we lose this ability now that the wallet is in an iFrame?
We should probably get rid of the poc suffix in all references to rps
For Player A (Xs) and Player B (Os).
Possibly also for Player A (Os) and Player B (Xs).
When Player A funds and then picks a move before Player B clicks 'return to game' in the wallet, this move will not be reflected in Player B's app when they eventually do click 'return to game'. Moreover both players are now waiting for a move and the game cannot progress.
Needs an actionToRetry.
For Player A (Xs) and Player B (Os).
Possibly also for Player A (Os) and Player B (Xs).
Seems to work, so far -- only the withdrawal transactions don't have any funds in them.. this seems to be the case in rps, too.
We need to handle any metamask errors and communicate them gracefully to the user.
A retry button might be good for the case where the user has the wrong account selected?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.