Giter Club home page Giter Club logo

tictactoetuto's People

Contributors

antododo avatar dabana avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dabana

tictactoetuto's Issues

Game info displays the wrong balance

Au début les balances, ne s'updataient tout simplement pas quand tu chagait l'Address dans le menu défilant. Après avoir ajouter this.ShowBalances() dans les callsback du menu défilant les balances affichées sont celles qui correspondent à l'adresse sélectrionner présendamment. Exemple:

au début:

Player X address: 0xc06802472c07bf570CcBB38217d5C7a4b99937d7
Player X balance: 102.96498095999935 ETH
Player O address: 0x3b475ae0057e2F4BA1Fd24cF1e98d3e932C82c04
Player O balance: 96.9751453 ETH

Je change l'adresse du player O:

Player X address: 0xc06802472c07bf570CcBB38217d5C7a4b99937d7
Player X balance: 102.96498095999935 ETH
Player O address: 0xc89065e7Dbbaea74Bb3e63B398E259CA4cC685F2
Player O balance: 96.9751453 ETH <----- la balance n'a pas changée!

Je chage encore l'adresse du player O:

Player X address: 0xc06802472c07bf570CcBB38217d5C7a4b99937d7
Player X balance: 102.96498095999935 ETH
Player O address: 0x3b475ae0057e2F4BA1Fd24cF1e98d3e932C82c04
Player O balance: 100 ETH <----- la balance a changée mais c'est celle de l'adresse d'avant : 0xc8906...!

J'ai essayé d'utiliser un .then pour attendre que le call a this.setState() se termine avant de caller this.ShowBalance() mais ça sort un bug...

Betting works one time but fails the second time

first try: When you press the betting button, 3 ETH are removed from your account. When the game ends, you receive 6 ETH back if X wins.

second try: When you press the betting button, 3 ETH are removed from your account. When the game ends, Metamasks issues a transaction with 0 gaz limit and the call to BettingResults fails.

Warning: Cannot update during an existing state transition

The state shoudn't be updated in render()

1)render() calls this.SendWinner() who execute: this.setState({isGameStarted: false});

2)also SendWinner() calls this.ShowBalances() who execute multiple this.setState.
in ShowBalances() this.setState can be change by console.log()

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.