Commit Graph

252 Commits

Author SHA1 Message Date
Ivan Danyliuk 4982e1b8b8 Add ConnectionChange API call to backend for handling network state changes 2018-02-16 13:02:41 +01:00
Alex Kohler 228bda9fb3 Remove //nolint: gas directives from fmt.Fprintf #590 (#656)
Summary:
Filter out gas linter error checks for fmt.Fprintf commands. This required defining a custom linter around gas that additionally included the offending code.

Notes:

Gas format, without piping it through gometalinter, gives output like this:

$ gas -fmt=csv geth/jail/console/console.go
geth/jail/console/console.go,21,Errors unhandled.,LOW,HIGH,"fmt.Fprintf(w, ""%s: %s"", consoleEventName, formatForConsole(fn.ArgumentList))"
Gometalinter, by default, does not grab the line of code when it filters gas errors. To resolve this, I created a wrapper around gas (I wasn't sure what to call this "gas wrapper", I opted for gasv2, open to other names).

The first part of the regular expression was taken directly from gometalinter (see https://github.com/alecthomas/gometalinter/blob/master/linters.go#L236), and I then appended ,\".*\" to additionally grab the line of code of the offending line. Lastly, I excluded ".*Errors unhandled.*fmt.Fprintf.*" to filter out only fmt.Fprintf errors around omitted errors.

Also as a result of this change, gas lint output will now include the offending code.

Closes #590
2018-02-14 19:58:20 +02:00
Dmitry Shulyak 0b979c507d Fix async status api (#663) 2018-02-14 17:32:36 +01:00
Alex Kohler 365bc662a2 Enable gometalinter on tests and fix static analysis issues #631 (#644)
* Enable gometalinter on tests and fix static analysis issues

* Remove unneeded change

* Fix additional lint errors

* Add nolint directives and error checks

* Add error assertions instead of nolint directives

* Go back to using lint directive for loop.Run goroutine

* Add error check to loop.Run
2018-02-12 13:16:06 +02:00
Dmitry Shulyak 2d964bfe9f Remove async operations from node manager (#584)
The main goal of this change is to remove async operations from node manager.
Additionally all of the signals from node manager are moved to status backend.

All of the async operation now will have the following behaviour:
- If node in the correct state exit immediatly without error
- If node not in the correct state exit immediatly with error
- In all other cases spawn a goroutine with wanted operation
- All the progress regarding that operation will be reported
  by using signals
- Signals should be handled in once place, which is StatusBackend

There are 2 potentially breaking changes:
- Empty event field will be ommited when Envelope is sent to a client
- All errors will be delivered to a client as an Envelope, previously
  some errors (NodeExists, NoRunningNode) were delivered synchronously

Signed-off-by: Dmitry Shulyak <yashulyak@gmail.com>
2018-02-09 14:37:56 +01:00
Pedro Pombeiro 8c3aa9a619
Fix a couple of lint warnings 2018-02-09 10:28:27 +01:00
Adrià Cidre 3c83c93039 Update jail README (#626) 2018-02-09 02:25:17 +02:00
Dmitry Shulyak 4cddc362ac
Fix all data races in jail package (#632)
* Rework how loop is stopped

* Use atomic int32 for DummyTask

* Close loop channel only once

* Rename closeChan to closedChan
2018-02-08 15:03:04 +02:00
Sebastian Klier 70912ab8f6 Group tests in a dedicated testing package (#629) 2018-02-08 13:52:47 +01:00
Azer Koçulu 5bea85fa9b Improve `fetch` tests in Cell (#627) 2018-02-08 12:41:07 +01:00
Adrià Cidre 00df3ff9f8 [#618] Jail.Call to return valid JSON string based results (#619) 2018-02-08 12:25:01 +01:00
Adam Babik 9885d74db0 Fix sync-and-exit option logic (#628)
* fix sync-and-exit logic

* fix reading from doneSync channel

* clean up

* make statusd before using it

* move syncAndStopNode to different file

* change log level in travis chain sync command

* do not use fmt but log

* add progress log and set timeout to 20 mins

* set datadir to .ethereumtest

* fix datadir
2018-02-08 10:51:53 +02:00
Dmitry Shulyak d0ef64a177 Maintain local copy of the nonce for each used address (#538) 2018-02-08 00:23:57 +02:00
Caner Çıdam ca719af71c Sync blockchain before running e2e tests on public testnet #568 (#612) 2018-02-07 11:48:03 +01:00
Dmitry Shulyak ca5a8f6669 Enable ethereum metrics collection (#616) 2018-02-05 21:25:40 +02:00
Caner Çıdam 0dd47ab7bc Cover transaction manager with additional test cases #561 (#601) 2018-02-05 17:28:21 +01:00
Sebastian Delgado 607954bfc3 Enforce type safety in `NodeCrashEvent` #602 (#607) 2018-02-05 11:37:59 +01:00
Denis Makogon 230e4febb1 Fixing test imports (#593) 2018-02-05 00:07:47 +01:00
Dmitry Shulyak 653da5bcd0 Result of tx processing returned as QueuedTxResult
Currently it is quite easy to introduce concurrency issues while working
with transaction object. For example, race issue will exist every time
while transaction is processed in a separate goroutine and caller will
try to check for an error before event to Done channel is sent.

This change removes all the data that is updated on transaction and leaves
it with ID, Args and Context (which is not used at the moment).

Signed-off-by: Dmitry Shulyak <yashulyak@gmail.com>
2018-02-02 09:47:56 +02:00
Dmitry Shulyak b41c4895fe Remove syncpool.go (#594) 2018-01-31 23:50:38 +01:00
Adam Babik 89d89681a3
Add support for metrics (#558)
It adds support for metrics (expvar and Prometheus) along with docker-compose files to run a Whisper test cluster.
2018-01-30 12:51:48 +01:00
Dmitry Shulyak ba0b20e53f Remove mocks for transaction manager and transaction queue
It is very unlikely that there will be 2 or more implementations
of tx manager and queue, as they are tailored specifically to status project
requirements.
2018-01-26 15:21:34 +01:00
Dmitry Shulyak 680d0513b7 Refactoring of TxQueue and Manager (#530) 2018-01-25 21:59:21 -08:00
Dmitry Shulyak 28a122f4aa Fix PeerCount lint warning 2018-01-25 12:16:59 +02:00
Dmitry Shulyak 889eeca31d Add a workaround for waiting till node is synced with network (#565) 2018-01-24 23:26:34 -08:00
Daniel Nephin 755a646bd4 Use gometalinter config instead of makefile (#560) 2018-01-24 00:25:28 -08:00
Adam Babik e214e1e270
Manage discovery from flags and refactor handling interrupt signals (#557) 2018-01-22 21:16:13 -08:00
Adam Babik c153a60dc3
Clean up whisper log delivery (#555) 2018-01-19 15:53:16 +01:00
Dmitry Shulyak 0771e7d1b7 Use single codepath for sending transactions to a local and remote nodes (#527)
- new EthereumTransactor that provides higher level API for working with ethereum network, and it is fully conformant with ethclient
- new test rpc service that improves flexibility and coverage of txqueue manager tests
- run complete transaction sequantially for each address
- go-ethereum: Get pending nonce from transaction pool
- add a patch with getting nonce from transaction pool
2018-01-18 17:55:17 +01:00
F. Eugene Aumson 83763e0401 Make gas linter happy (#544) 2018-01-17 17:46:21 +01:00
Ivan Daniluk f93cd81d83
Upgrade to geth 1.7.3 and add geth patches (#492) 2018-01-15 21:26:41 +01:00
Adam Babik 953790c641 Add a test case to reproduce the issue (#548) 2018-01-11 18:17:41 +01:00
Adrià Cidre 7ab6a062ec [#516] Fix panic based on wrong error in setImmediate function (#535)
Additionally, this change clean ups and improves organization of `geth/jail/internal/timers` package.
2018-01-10 10:42:40 +01:00
Igor Mandrigin 21132a441f Remove creating global `_status_catalog` variable 2018-01-09 17:53:33 +01:00
Caner Çıdam 5c8b7758d5 add the missing dot at the end of comment sentence 2018-01-04 09:38:53 +01:00
Caner Çıdam a3663fa1cc fewer s.reinitMock() lines using SetupTest 2018-01-04 09:38:53 +01:00
Caner Çıdam 2d4391704e short comment for TestAccounts 2018-01-04 09:38:53 +01:00
Caner Çıdam 813c6df5f0 reduce error check in TestSelectAccount 2018-01-04 09:38:53 +01:00
Caner Çıdam 83e71f3e4f fix order of s.Equal args 2018-01-04 09:38:53 +01:00
Caner Çıdam 74f38d4f94 update rest of the tests: expected errors 2018-01-04 09:38:53 +01:00
Caner Çıdam c0acd033a1 update table-driven tests: expected errors 2018-01-04 09:38:53 +01:00
Caner Çıdam 90123f4f40 remove unnecessary check in TestAddressToDecryptedAccount 2018-01-04 09:38:53 +01:00
Caner Çıdam 491b4ca3ce split TestCreateAndRecoverAccount 2018-01-04 09:38:53 +01:00
Caner Çıdam ca5b34afb7 verify accounts in TestAddressToDecryptedAccount 2018-01-04 09:38:53 +01:00
Caner Çıdam f31fcd6c90 fix NotNil misuse 2018-01-04 09:38:53 +01:00
Caner Çıdam 1daeeee4fd few changes to TestSelectedAndReSelectAccount 2018-01-04 09:38:53 +01:00
Caner Çıdam b37a1ced0d remove repetitive account creation from tests 2018-01-04 09:38:53 +01:00
Caner Çıdam 8c1b1e265c add TestAddressToDecryptedAccount 2018-01-04 09:38:53 +01:00
Caner Çıdam 1326a1ab36 add TestAccounts 2018-01-04 09:38:53 +01:00
Caner Çıdam f3257da15e add TestLogout and test errors 2018-01-04 09:38:53 +01:00