Commit Graph

72 Commits

Author SHA1 Message Date
Alex Kohler 4a01a395b4 Move status-go over to go-ethereum/log #717 (#727) 2018-03-20 19:35:28 +01:00
Igor Mandrigin 804fe949f7 Fix state names and log messages for status changes API. 2018-03-19 19:52:55 +02:00
Igor Mandrigin 3b92b61ef1 Add API to listen to app state changes. 2018-03-15 12:48:22 +01:00
Alex Kohler 5fbacb49e1 Remove GetObjectValue from JailCell interface #691 (#693) 2018-03-01 17:48:30 +01:00
Igor Mandrigin f7baca7835 Don't hide RPC error reason. 2018-02-27 12:10:48 +01:00
Igor Mandrigin c06d58addd Remove `notifications` package from go-ethereum. 2018-02-22 11:10:21 +01:00
Dmitry Shulyak b2580c79d7
Add destructive tests (#646)
Network disconnect is introduced by removing default gateway, easily reversible condition.

On my local machine it takes 30 seconds for peers to reconnect after connectivity is restored. As you guess this is not an accident, and there is 30 seconds timeout for dial expiration. This dial expiration is used in p2p.Server to guarantee that peers are not dialed too often.

Additionally I added small script to Makefile to run such tests in docker environment, usage example:

```
make docker-test ARGS="./t/destructive/ -v -network=4"
```
2018-02-19 17:32:58 +02:00
Igor Mandrigin b83666a90e Fix linter warnings for StatusBackend. (#675) 2018-02-16 15:58:13 +02:00
Ivan Danyliuk 716f1b1cb0 Fix comment 2018-02-16 13:02:41 +01:00
Ivan Danyliuk f78b79b49b Change default connection state to unknown 2018-02-16 13:02:41 +01:00
Ivan Danyliuk bc1c3e6337 Make linters happy 2018-02-16 13:02:41 +01:00
Ivan Danyliuk 4982e1b8b8 Add ConnectionChange API call to backend for handling network state changes 2018-02-16 13:02:41 +01:00
Dmitry Shulyak 0b979c507d Fix async status api (#663) 2018-02-14 17:32:36 +01: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
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 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 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
Adam Babik b7fb51d92a
Refactor shh_requestMessages method (#513) 2017-12-21 11:26:01 +01:00
b00ris ba6c96532b add enode to request messages params (#508) 2017-12-12 12:00:17 +01:00
b00ris 9559ff074a Support for historic messages from MailServer (#503)
Add `shh_requestMessages` RPC method. It sends a message to MailServer that can return cached, possibly expired, Whisper message.
2017-12-07 14:37:43 +01:00
Frank Mueller bddf15d74f Add internal RPC server and statusd-cli client (#463) 2017-12-02 19:51:55 +01:00
Adam Babik 98b3f330af bring back Parse binding 2017-11-23 13:37:59 +01:00
Adam Babik 086747a695 Refactor jail part 2 (#401)
Refactor jail so that it's more self-descriptive and easier to understand by newcomers. Also, the test coverage has been improved.

Changes requiring status-react team actions:
* Replace Parse calls with new CreateAndInitCell and ExecuteJS bindings,
* Make sure web3.isConnected is ok as its response change to boolean value.
2017-11-07 12:36:42 -05:00
Ivan Tomilov 21beb685b4 Add -network flag for Makefile to chose a network to run tests on #430
PR adds test flag -network to e2e pacakge, for the selection of the desired blockchain network for running tests. It updates readme to demonstrates usage of flag.
2017-10-26 22:51:04 +03:00
Alexander Ewetumo 8145412d1c Ensure to return err for nil RPCCLient 2017-10-26 14:25:38 +01:00
Evgeny Danienko 0e72e3d6b4
Update notify interface and mark old one as deprecated 2017-10-24 00:47:09 +03:00
Evgeny Danienko c823acfd04
All notifiers remaned into notification 2017-10-22 20:39:57 +03:00
Evgeny Danienko 9efed591da
Notifier constructor renamed 2017-10-22 20:39:57 +03:00
Eugene 42cb6446b9
Return error for notify 2017-10-22 20:39:56 +03:00
Eugene 804ed7c10c
Remove provider interface 2017-10-22 20:39:56 +03:00
Eugene 7195fe3f92
Create message provider interface 2017-10-22 20:39:55 +03:00
Eugene 4aaeeb6ebf
Extract notification into separete package and interface 2017-10-22 20:39:51 +03:00
b00ris e911666b5d Fix make lint warnings (#417)
fixed make lint warnings
cleared linter_exclude_list.txt
removed some commented code
fixed comments from #388
2017-10-20 12:06:22 +03:00
Oleg Raev 240149786f Jail.RemoveCells before logout and switching account (#382)
Called jail.Stop upon SwitchAccount and Logout to ensure all jail cells have been terminated.
2017-10-17 00:07:42 +03:00
Adam Babik 281b304edb Extract e2e tests to a separate package (#375)
This change moves our e2e tests into a separate package to make room for proper unit and integration tests.

This is Phase 1 described in #371.

Changes:

Makefile has separate directives to run unit/integration tests and e2e tests,
CI runs unit/integration tests first and then e2e tests,
E2e tests are in reliability order, i.e. the least reliable tests are run in the end to be sure that nothing else is broken,
Some tests are fixed or quarantined.
2017-10-11 17:20:51 +03:00
Adam Babik 90acfedf7a Rebase geth 1.7.0 (#353) 2017-10-10 12:38:49 +03:00
Ivan Daniluk 3540972f0e Refactor and cleanup Jail (#368)
Refactor and clean up Jail package:

 Removes account.Manager and txqueue.Manager from Jail as they are not used anymore
 Removes messageID related code from Jail.Send
 Simplifies Jail.Send to be a wrapper around RPC client's CallRaw
 Renames jail_cell* to cell*
 Related cleanups
2017-10-06 19:52:26 +03:00
Ivan Daniluk 9cc5fd2112 Move transaction queue code into separate package (#365) 2017-09-27 02:50:41 +02:00
Adam Babik d625ddacfd Validate password in CompleteTransaction with remote node (#367) 2017-09-26 18:08:24 +02:00
Ivan Daniluk 93492cf606 Move accounts to separate package (#360) 2017-09-26 15:44:26 +02:00
Ivan Daniluk 14a04c1b20 Fix null result field bug for JSON-RPC raw response (#362) 2017-09-26 12:19:17 +02:00
Ivan Daniluk 2acf1a1a6a Refactor/signals package (#359)
Move signals code to the separate package.
2017-09-25 20:22:57 +02:00
Ivan Tomilov fc8f59e121 Fixed eth_sendTransaction routing to the local node (#351)
* Fixed eth_sendTransaction routing to the local node
* Add local RPC handlers for eth_accounts and eth_sendTransaction
2017-09-25 18:04:40 +02:00
Adam Babik 750612f2bc fix SendTransaction signature in go-ethereum (#355)
I created a separate method SendTransactionWithPassphrase which accepts passphrase as a second argument. It's an exact copy of SendTransaction except for calling wallet.SignTxWithPassphrase.
2017-09-22 18:16:22 +03:00
Adam Babik ba963cc1bd estimate gas if missing in sending tx using upstream (#346)
I added a call to eth_estimateGas in case gas param is missing when using the upstream. This is a little bit ugly because I create an anonymous struct to match eth_call params. I spotted this struct in go-ethereum but I don't see it's exported.
2017-09-19 14:19:18 +03:00
Ivan Tomilov 5f19c9cd0a Implemented sendAsync for js commands with a callback (#321)
Geth js commands coming through jail with a callback will now be executed truly asynchronously blocking jail only when an actual interaction with VM is performed.

Technically, it registers a new handler jeth.sendAsync which executes functions with callbacks asynchronously.

Changes include:

1. Send and SendAsync now use cell.VM instead of otto.Otto providing proper locking.
2. Unmarshalling in ExecuionPolicy.ExecuteWithClient is now done into var result interface{} instead of var result json.RawMessage because test case 0 of TestJailWhisper failed providing byte codes instead of 5.0.
3. Due to the asynchronous nature of web3 calls new weird timeouts in tests have been introduced. They may fail sometimes but I gave up trying to implement a more reliable and readable solution.
2017-09-18 15:13:32 +03:00
Oskar Thorén f88de68f86 Push notifications: ability to trigger notifications via public API (#327)
This PR provides a way for status-react to trigger push notifications to contacts whose FCMToken they possess. It thus solves the basic user story as outlined in #326
2017-09-15 18:57:34 +03:00
Adam Babik 8153d935d2 Improve geth/api tests (#328)
The goal of this PR is to make geth/api tests to finally pass from the beginning to the end. I tried to achieve it here by:

Removing calls to common.PanicAfter so that we know which tests fail the most,
Better sync of some tests using channels,
Small test improvements.
2017-09-15 13:35:31 +03:00
Ivan Daniluk 1c9c0f08f4 Bugfix/eth accounts workaround #294 (#318)
This PR is dirty hack workaround for #294 issue. It starts LES service with sync disabled (by MaxPeers option set to 0), even if Upstream is enabled. This ensures that all RPC calls are registered in local node (they are registered during LES service initialization and do not exist if LES service is not activated).
2017-09-15 11:44:31 +03:00