poanetwork / poa-popa

DApp for proof of physical address (PoPA) attestation for validators of POA Network
https://popa.poa.network
GNU General Public License v3.0
24 stars 18 forks source link

(Test) Add basic tests for register_address method #39

Closed fvictorio closed 6 years ago

fvictorio commented 6 years ago

Add some tests for the smart contract, see #15.

A lot of things to improve here, mainly the generation of the { v, r, s } arguments. Right now a valid combination of arguments is hardcoded, and all the tests must be in their own contract block (so that they run in a "fresh" contract). I think the best approach would be to require the same module that the server uses to generate those arguments, web-dapp/server-lib/sign.js, and use it to build valid arguments.

phahulin commented 6 years ago

Can this be merged or do you plan on pushing more commits?

fvictorio commented 6 years ago

I think it can be merged, the improvement I mentioned and the rest of the tests can be done in future PRs.