Changes Jail.createCell to Jail.obtainCell, which alters the error-throwing behaviour for better Jail.CreateAndInitCell
This PR allows cells to be reinitialized without being recreated.
Important changes:
- Calling with same cell ID won't cause any errors.
- Consecutive calls with same cell ID only reinitialize existing cell.
- Parse in library.go uses StatusAPI.CreateAndInitCell.
Fix failing tests for users w/o access to the ACCOUNT_PASSWORD env variable. Disable e2e public network tests in Travis pull requests. Exclude lib dir from unit tests.
* Accounts are now encrypted with a strong passphrase.
* The encrypted passphrase is stored in .travis.yml
* Public testnet tests are now run after tests on a private net
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.
As fetch.go was the only consumer of go.rice, it could be safely removed in favour of go-bindata and go generate.
Motivation to do that was the fact that go.rice throws panic in iOS when compiled with gomobile.
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.
Refactor and little bit clean up Notify api:
Created interface and package "notification" and extracted related code into it
Set dependencies into constructor notificatotion.Manager
Mocks for notificatotion.Manager and FCMClient
Bacis unit tests for Notify and Send
Notify func is now deprecated
Notify users uses new API: message, Payload and a list of tokens
1. A new private testing network (StatusChain) is introduced.
2. An example test case implemented (TestSendEtherOnStatusChainTx)
3. Genesis file added static/config/status-chain-genesis.json
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.
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
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.
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.
An issue arose that shh_newMessageFilter was routed to the upstream instead of local node. This PR fixes that. It also revisits routing logic and makes all requests go to the local node by default.
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.
This PR introduces solution for #333 - it adds support for array JSON-RPC payload.
unmarshalMessage tries to unmarshal JSON paylod into *jsonrpcMessage object, and in case of failure, analyzes error and, if it's unmarshalling array error, tries to unmarshal it as an array.
Updates and adds some package docs.
It also provides autogenerated README's using https://github.com/jimmyfrasche/autoreadme tool. To use it, make sure it's installed on your system, and every time you update documentation, run go generate to update the README.md file.
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
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.
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).
This PR refactors RPC subsystem for status-go:
cleans up two different RPC client implementations (RPCManager and rpc.Client)
creates new package under geth/rpc
moves routing logic into this package (rpc.(*router))
add tests for routing
cleans up NodeManager
This PR adds Fetch API and fixes#289 by using concurrency safe Otto VM wrapper wherever it's possible. This involves new package geth/jail/vm that is used by jail and by our forked ottoext/{fetch/timers/loop} packages.
It also adds more tests that are supposed to be run with --race flag of go test.
Geth requests have been revised and if the upstream is enabled, only queries regarding working Ethereum protocol are routed to upstream.
Whisper, most web3 requests and various utility methods are still routed to the local node as well as requests for accounts.
Now all transactions in both cases are waiting for CompleteTransaction or DiscardTransaction to proceed independently from their destination: upstream of local
* 3. Removed extra `jail` prefix in the jail package
* Removed sendMessage and showSuggestions handlers because they're already set in registerHandlers()
* Remove extra asserts
* Changed assertions everywhere to testify
* Exposed JailCell.Call and removed Jail.Cell duplicate method
* Fixed review comments
IMPORTANT: The known issue is that in case of configured UpstreamRPCServer transactions are sent immediately not waiting for CompleteTransaction or DiscardTransaction which brings inconsistency in behaviour and acts as a security breach.
* new UpstreamRPConfig in geth/params to provide upstream configuration
* conditional start of ethereum blockchain sequence based on NodeConfig.UpstreamConfig.Enabled flag state
Added a lightweight logger wrapper around go-ethereum/log which adds StatusIM prefix to all messages and allows to clearly distinguish between status-go and go-ethereum logs.
Logs under vendor/go-ethereum left unchanged because those pieces of code might undergo huge refactoring in the near term.
* Fixed tests (only when they run one by one; they can still fail if run together)
* Fixed TestJailSendQueuedTransaction: the second command in case 4 was altering status.message_id and thus the test was failing. Earlier it had been working because cells were cloned during every Call
* Added a check into TestJailVMPersistence: now its concurrent-resiliency is asserted
* Fixed CallRPC: shh_version now return "5.0" instead of "0x5"
* Fixed TestWhisperFilterRace: there was changed Whisper API which should just be adhered to
* Fixed geth1.6.7 rebase consequences: primarily genesis blocks which now contain metropolishash
* static: updates Whisper test (to work with Geth 1.6.1)
* jail: VM persistence implemented
* jail: sendMessage/showSuggestions minor fixes (to be squashed)
* node: CHT and boot nodes auto-load implemented
* Replaced CHT data file from farazdagi's to tiabc's
* Rewrote config_test.go using testify having reduced it twice in size
* Increased SyncTime and panic timeout in tests
* Fixed test - remove go default test to testify/suite (#207)
* Add flag setup for RPCEnabled and add comment (#225)
* jail: register method handlers before running initial js in jail (#226)
* Console Jail Mod #179 (#228)
* Added ./statusd-data into .gitignore
* Increased log level for the test node from INFO to ERROR
* Add call to loop.Run to evaluate all setTimeout/setIntervals methods. (#208)
* Rebase onto geth1.6.7 (#232)
* Got back sync duration from 60s to 30s, updated bindata.go
Changed all typos on bootstrap spelling from "bootstap" to "bootstrap".
For example in function makeBootstrapNodes, line 326 now reads:
var bootstrapNodes []*discover.Node
* Commit initial change for settimeout/setinterval
* Add initial tests for jail setTimeout/setInterval
* Add ottoext dependency
* Add fetch jail test with function
* Add dependencies of fetch from ottoext
* Refactor with regards to PR review
* Refactor with regards to PR review
* Fix syntax errors
* Fix missing return statement
* Add http enable flag for Node
* Fix errors with json test data
* Refactor changes with regards to review comments
* Return appropriate errors for novalue set
* Update changes with regard to config
* Update tests timeout value for makefile ci
* Add RPCEnabled for json config in api test
* Resolve test with RPCEnabled changes
* Remove RPCEnabled flag from unconcerned tests
- API is async
- Node manager, backend and API modules have more that 90% coverage
- For each level (node manager, backend, public API) random testing
was used to ensure that we don't have race conditions
- node: signals and node reset, fixes#152
- tests update (testify is used)
- node manager refactored, race conditions fixed
- node wrapper has been removed, we rely on go-ethereum node now
- tx queue refactored
- jail refactored
- backend and API introduced