Git Product home page Git Product logo

test-assignment's Introduction

Truffle installation

Tested with:

  • Node v7.10.0
  • npm 4.2.0

Install the dependencies:

npm install

Start a testrpc instance and leave it running:

npm run testrpc

In another terminal, run:

npm test

Tests have shown that initial id.js has several issues:

  • reference error
  • new very expensive resources with same ID get duplicated in memory instead of referencing to one resource
  • on close() the very expensive resource won't actually be deleted from memory My new commit contains fixes for these issues and other minor corrections as well.

Regarding this little Python piece: ''.join(itertools.chain(*zip(s[-2::-2], s[::-2])))

It shuffles the string s in a specific pattern, the resulting string is reversed sequence of the original symbols pair by pair: 'abcdef' will turn into 'efcdab' (first 'ef' then 'cd' then 'ab'). It does it by zipping together two sequences of symbols:

  1. a reversed sequence of every second symbol of the original string
  2. same but starting from the next-to-last symbol of the original string

The result is a list of two-tuples, which is then chained into one list of symbols, which is then joined into one string. If the original string contains an odd number of symbols, the first symbol of it is lost. The result length is always even.

MyContract.sol was vulnerable to reentrancy attack. The new commit contains fixes and also the implemented deposit() function.

test-assignment's People

Contributors

dworznik avatar sapph1re avatar

Watchers

 avatar  avatar

Forkers

dworznik

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.