Commit Graph

97 Commits

Author SHA1 Message Date
Maximilian Krüger 067759faa2 bridge.sol: SignerTest -> MessageSigningTest 2018-01-12 16:51:51 +01:00
Maximilian Krüger 7011150651 bridge.sol: signer -> recoverAddressFromSignedMessage 2018-01-12 16:46:00 +01:00
Maximilian Krüger 868ee4a10b test/foreign: increase coverage: add test "should not be possible to do same deposit twice for same authority" 2018-01-11 15:15:33 +01:00
Maximilian Krüger f1c74da470 test/foreign: fix test "should not be possible to submit signature twice" increasing coverage 2018-01-11 15:06:03 +01:00
Maximilian Krüger aed0a09ad8 test/foreign: should fail to transfer with value overflow both locally and to home 2018-01-11 15:00:30 +01:00
Maximilian Krüger 15c6e925d6 test/foreign: various improvements and more coverage for transferHomeViaRelay 2018-01-11 14:52:19 +01:00
Maximilian Krüger 23ea4be253 test/foreign: improve some variable names and test names 2018-01-11 14:51:17 +01:00
Maximilian Krüger 81a5d3f18d test/foreign: underscore -> camelcase 2018-01-11 14:50:43 +01:00
Maximilian Krüger c62cfd3692 adapt tests to split of ForeignBridge.transfer 2018-01-11 14:16:25 +01:00
Maximilian Krüger 56b5e6d22d test: isMessageValueSufficientToCoverRelay should work correctly 2018-01-09 14:35:31 +01:00
Maximilian Krüger 22e70cc079 test: remove unused var 2018-01-09 14:35:17 +01:00
Maximilian Krüger f7f78e7cfc improve test description 2018-01-09 12:52:49 +01:00
Maximilian Krüger 68d02ac5fd refactor test code a bit 2018-01-09 11:42:08 +01:00
Maximilian Krüger ba8aedecb1 add test for message part getters (getRecipientFromMessage) 2018-01-09 11:36:00 +01:00
Maximilian Krüger d66f51839c add test: should revert withdraw if value <= estimatedWeiCostOfWithdraw 2018-01-05 15:12:06 +01:00
Maximilian Krüger 3fccc2ad7f tests: add comment explaining gas price 2018-01-05 15:01:20 +01:00
Maximilian Krüger 5bfa568833 tests: remove console.log statements for debugging on travis 2018-01-05 15:00:59 +01:00
Maximilian Krüger 4ebe2a8e54 fix travis: remove assertion which fails during coverage testing
since coverage testing inserts instructions which increase the gas cost
2018-01-05 14:27:47 +01:00
Maximilian Krüger 0b12c2cc98 truffle: bump everything to newest version 2018-01-05 14:04:20 +01:00
Maximilian Krüger 49981435fb travis fix: fetch gas price dynamically 2018-01-05 13:51:25 +01:00
Maximilian Krüger b2bf3b6dfe use long argument when setting port on ganache-cli 2018-01-05 13:39:07 +01:00
Maximilian Krüger a900fcffd4 fix travis: explicitely setting gas price to lower value 2018-01-05 13:19:49 +01:00
Maximilian Krüger 6a64f4c6dc trying more things to debug why tests only fail on travis 2018-01-05 13:11:50 +01:00
Maximilian Krüger 609c8065a4 debugging test which only fails on travis 2018-01-04 19:05:40 +01:00
Maximilian Krüger 434b845319 force truffle gasPrice to make it consistent since it seems different on travis 2018-01-04 19:00:36 +01:00
Maximilian Krüger a28fa13f87 add test that recipient pays for relay 2018-01-04 18:49:54 +01:00
Maximilian Krüger 4834e25e97 tests: helpers: add getBalances helper 2018-01-04 18:49:32 +01:00
Maximilian Krüger 03aacc8f16 truffle tests: use camelcase consistently for variable names 2018-01-04 18:17:14 +01:00
Maximilian Krüger a7910aa5cd change ganache port to 8547 so it doesn't clash with vanilla parity rpc port 2018-01-04 17:38:47 +01:00
Maximilian Krüger 66bc676891 make tests pass again after introducing `estimatedGasCostOfWithdraw` 2018-01-04 15:15:32 +01:00
Maximilian Krüger 31a17f2644 add .soliumignore: without it solium complains 2017-12-15 11:01:44 +01:00
Maximilian Krüger d090b1d403 add .soliumrc.json. without it solium exits 2017-12-15 11:01:15 +01:00
Maximilian Krüger b270bb240b run solium on CI 2017-12-14 18:34:34 +01:00
Maximilian Krüger 71571b895d update yarn.lock 2017-12-14 18:33:31 +01:00
Maximilian Krüger f1e3dc05ea package.json: add solium 2017-12-14 18:33:16 +01:00
Maximilian Krüger d27347380b Migrations.sol: fix solium linter errors 2017-12-14 18:27:16 +01:00
snd 58a80b4ace fix for #61 and tests for withdraw (#66)
* readme: add section on running truffle tests

* extract `sign` from test/foreign into test/helpers and improve it

* add test helper signatureToVRS

* add test helper bigNumberToHexString

* add test helper bigNumberToPaddedBytes32

* add test "should allow correct withdraw" which fails and exposes #61

* resolve #61 and document it

* fix typo

* fix typo

* use num.toString(16) instead of bigNumberToHexString

https://github.com/paritytech/parity-bridge/pull/66#discussion_r156030874

* add comment

* use explicit transaction hash

* add test "withdraw without funds on HomeBridge should fail"

* add test "should not allow withdraw with message.length != 84"

* add test ""should allow second withdraw with different transactionHash but same recipient and value"

* add test "should not allow second withdraw with same transactionHash but different recipient and value"

* fix typo

* bridge.sol: add note that anyone can call HomeBridge.withdraw

* test that anyone can call withdraw provided they have the message and signatures

* test/home.js: improve wording of test
2017-12-14 17:54:49 +01:00
snd 63b0745ea0 Issue 58 solidity test code coverage (#70)
* add initial package.json with test, ci and coverage scripts

inspired by 86794a866b/package.json

* .travis.yml: use ci script from package.json

* upload coverage to coveralls

* README.md: add coveralls badge

* .travis.yml: run npm install

* package.json: make ganache ports match up so truffle can connect

* .travis.yml: call coveralls script directly

* README.md: try to put badges on one line [ci skip]

* README.md: try to fix badge formatting [ci skip]

* package.json: remove directories prop which is not needed

* add notice that code coverage is for contracts only

* .gitignore: node_modules

* package.json: improve description

* package.json: add license

* package.json: replace npm with yarn

* .travis.yml: use yarn instead of npm

* add yarn.lock

* .travis.yml: cache cargo to speed things up
2017-12-14 17:52:36 +01:00
debris e4f9f24792 check ForeignBridge transfer() overflow 2017-10-24 13:23:17 +08:00
debris 59403966fc rename to home/foreign, closes #46 2017-10-10 11:02:58 +02:00
debris 9a893c9842 test for submitting signature twice 2017-09-04 16:05:47 +02:00
debris 57c8427539 submitSignature tests 2017-09-04 16:02:41 +02:00
debris c475cb9009 tests for solidity contract transfer 2017-09-04 14:42:10 +02:00
debris 9046cf8d62 fixed signature validation in solidity, added truffle tests for it 2017-09-04 12:49:05 +02:00
debris f0d9e56699 fix KovanBridge vulnerability when one of the authorities is misbehaving 2017-09-01 16:26:06 +02:00
debris e69c9ce08d tests for solidity contract consturctor params 2017-09-01 15:44:36 +02:00
debris 9eadffcfdd first truffle tests for EthereumBridge 2017-09-01 15:11:20 +02:00