GithubHelp home page GithubHelp logo

magmo / apps Goto Github PK

View Code? Open in Web Editor NEW
9.0 5.0 5.0 17.8 MB

Proof of concept applications that use the Force Move Game framework.

Shell 0.04% JavaScript 9.02% Solidity 1.50% TypeScript 75.66% HTML 7.95% CSS 5.84%
ethereum state-channels

apps's People

Contributors

amhunt avatar andrewgordstewart avatar geoknee avatar kerzhner avatar lalexgap avatar n-white avatar snario avatar tomclose avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

apps's Issues

ttt bot

For the initial implementation, the bot will use a random strategy

Handle an invalid message nicely

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.

Configure google storage bucket permission correctly

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)

Running a development build of the Wallet against Ropsten fails

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)

Run CircleCI tests for a package only if that package has changed

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)

Change Resign to Conclude?

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.

Standardize actions

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.

Handle when a user declines funding

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

Reinstate / rewrite tests

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.

upgrade fmg-core and fmg-simple-adjudicator

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).

Sanitize Contract Artifacts

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.

Fix asynchronous game opening

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.

Handle when both players attempt to close the game on-chain at the same time

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.

Redux upload state not working

To repro:

  1. Play as A and B through funding and one round of RPS.
  2. Download redux state for both players.
  3. Refresh both browsers.
  4. Upload one state.json file in each browser window.

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.

Hook up the channel wallet

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.

Return success/failure for opening a channel

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.

Get storybook working in the wallet

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

Get insufficient funds -> withdraw working

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.

End-to-end testing of SimpleAdjudicator

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.

Figure out CircleCI failures

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.

Address silent failures

There are multiple places in the wallet and the app where things will fail silently. Two places that are pretty pervasive:

  • The app getting back a something_FAILURE from the wallet.
  • The wallet reducer checking that its ourTurn or that a signature is valid, etc..

rps-poc -> rps

We should probably get rid of the poc suffix in all references to rps

Fix asynchronous game opening in TTT

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.

Get resign -> withdraw flow working

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.

Handle metamask errors gracefully

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.