Commit Graph

171 Commits

Author SHA1 Message Date
EmbarkBot a5c7527d68 chore(prerelease): 5.1.1-nightly.1 2020-01-30 00:12:57 +00:00
Jonathan Rainville 3ceac534e1 fix(@embark/ens): fix registerSubDomain in tests and add test
registerSubDomain  didn't work in tests because it used the old way
of checking the env, which is checking the `this.env` string, but in
tests, we use the `test` env. So instead, we now check if it is a
known network using the network ID (like we do for other place)
2020-01-29 12:54:10 -05:00
EmbarkBot 03ca790ffd chore(prerelease): 5.1.1-nightly.0 2020-01-29 00:12:23 +00:00
Iuri Matias d328b9953a chore: update site urls 2020-01-28 12:07:17 -05:00
Michael Bradley, Jr 0d1da2971c chore(release): 5.1.0 2020-01-27 12:33:50 -06:00
EmbarkBot c891c2de95 chore(prerelease): 5.1.0-nightly.6 2020-01-25 00:12:13 +00:00
EmbarkBot 84448f8732 chore(prerelease): 5.1.0-nightly.5 2020-01-24 00:10:58 +00:00
dependabot-preview[bot] 9caa424aeb build(deps): bump solc from 0.5.0 to 0.6.1
Make various related changes to templates, tests, etc. The methodology for
finding files that needed changes was to search through the whole monorepo for
the strings "solc" and "solidity" and then inspect the hits to see whether
changes were needed/appropriate.

Remove `solc` as a dependency in `packages/embark/package.json` so that it's
only a proper dependency in `packages/plugins/solidity/package.json`. Adjust
how the "bundled" `solc` package's version is determined, i.e. inspect the
`package.json` of `embark-solidity` instead of `embark`.

When `solc`'s version is `>=0.6.0` use the [new callback API][api].

[api]: https://github.com/ethereum/solc-js/blob/master/README.md#example-usage-with-import-callback
2020-01-23 14:20:42 -05:00
EmbarkBot e8b5c7ab89 chore(prerelease): 5.1.0-nightly.4 2020-01-23 00:13:38 +00:00
EmbarkBot 99d629c8a0 chore(prerelease): 5.1.0-nightly.3 2020-01-22 00:13:43 +00:00
Michael Bradley, Jr 7e00786ee8 build(deps): bump ganache-cli from 6.7.0 to 6.8.2
Also, in `dapps/tests/contracts` move the `this.timeout(0);` inside the
`it(...)` for the expensive gas esimation (involving
`SimpleStorage.methods.set`) because it otherwise doesn't seem to have an
effect on the default 15 second timeout.
2020-01-21 15:13:01 -06:00
EmbarkBot bfda1b3124 chore(prerelease): 5.1.0-nightly.2 2020-01-21 00:12:55 +00:00
EmbarkBot c98e769d0d chore(prerelease): 5.1.0-nightly.1 2020-01-20 09:57:35 -06:00
Michael Bradley, Jr c093cf88ea feat: support Node.js v12.x and newer
Remove the `<12.0.0` restriction re: Node.js version in the `"engines"`
settings for all the packages in the monorepo that had that restriction.

Add missing `"engines"` settings in `packages/plugins/snark/package.json`.

Adjust the Azure Pipelines config to include builds for Node.js v12.x and
v13.x.

Bump `solc` to `0.4.26` in `dapps/tests/app` and `dapps/tests/contracts`. It
was discovered that older versions suffered a fatal `Maximum call stack size
exceeded` error when run on Windows with Node.js v12.x or newer. Display a
warning re: the bad combo (solc version + Windows + Node version) if it's
detected at runtime.

Adjust the root `yarn.lock` so that the `sha3` transitive dependency resolves
to a newer version that is compatible with Node v13.x.
2020-01-20 08:28:24 -06:00
EmbarkBot 4d44e29b3c chore(prerelease): 5.1.0-nightly.0 2020-01-17 00:15:31 +00:00
Iuri Matias 9aeddaa998 chore: rename org references from embark-framework to embarklabs 2020-01-16 15:36:29 -05:00
Jonathan Rainville f5849e0af7 fix(@embark/test-dapp): fix test_dapp broken for ENS resolve 2020-01-16 11:45:14 -05:00
Pascal Precht 73d04433cf feat(@embark/deployment): introduce `interfaces` and `libraries` configuration
This commit adds two new configuration settings for Smart Contract configuration:

- `interfaces` - Any Smart Contract that represent an interface or is used for inheritance
- `libraries` - Any Smart Contract that is used as a library

This makes the configuration less redundant in cases where otherwise the `deploy`
property has been set to `false`, such as:

```
deploy: {
  Ownable: {
    deploy: false
  },
  ...
}
```

The above can now be done via:

```
interfaces: ['Ownable'],
deploy: {
  ...
}
```
2020-01-15 09:45:42 -05:00
emizzle 81af3affc4 fix(@embark/tests): Fix failing test with `—node=embark`
## Problem
When using `embark test —node=embark` with the test app, the test that listens for contract events would always fail after timing out. Funnily enough, after the timeout, the subsequent test would run, executing a method that would ulimately fire the event listened for in the previous test, causing the second test to fail as well.

## Solution (workaround)
Update the contract events listener test in the test app to execute the `set2` method twice, successfully working around the issue.

## NOTES
The cause of the issue is unknown and why the workaround works is also unknown.

This change works with both `embark test` and `embark test —node=embark`.
2020-01-09 11:41:48 -05:00
Pascal Precht e37d3f73ff feat(@embark/test-runner): expose evmClientVersion for conditional tests
This commit introduces a new `global.getEvmVersion()` that can be used to
conditionally run tests, such as when tests rely on RPC APIs that are only
available in specific evm nodes.
2020-01-09 11:39:28 -05:00
Michael Bradley, Jr ba0d6d17f3 chore(release): 5.0.0 2020-01-07 12:14:37 -06:00
Michael Bradley, Jr 902dba0c02 chore(release): 5.0.0-beta.0 2020-01-03 09:37:36 -06:00
Iuri Matias b02b7ec751 chore(release): 5.0.0-alpha.10 2019-12-24 15:27:23 -05:00
Iuri Matias 472efbbf6e chore(release): 5.0.0-alpha.9 2019-12-20 18:13:47 -05:00
Iuri Matias e7059030fe chore(@embark/templates): remove embarkjs dependencies from test plugin 2019-12-20 17:13:48 -05:00
Iuri Matias 8fb502d777 chore(@embark/templates): add embarkjs dependencies to test apps 2019-12-20 17:13:48 -05:00
Iuri Matias 70333cd5d4 chore(@embark/templates): add embarkjs dependencies to templates
chore(@embark/templates): add embarkjs dependencies to templats

chore(@embark/templates): add embarkjs dependencies to templats
2019-12-20 17:13:48 -05:00
Iuri Matias 4091296924 chore(release): 5.0.0-alpha.8 2019-12-19 14:14:23 -05:00
Iuri Matias f72d6f2915 chore(release): 5.0.0-alpha.7 2019-12-18 12:07:13 -05:00
Iuri Matias 5893bc38b9 chore(release): 5.0.0-alpha.6 2019-12-17 15:41:00 -05:00
emizzle aea2b6f97f fix(@embark/ens): Show ENS controls for Test DApp
For the test DApp, when ENS is enabled, ENS controls were not showing in Cockpit (under Utils), nor were they available to test in the DApp interface as they did not exist.

Fix ENS controls not showing in Cockpit when enabled.

Add ENS tab to Test DApp for ENS UI.
2019-12-17 13:48:06 -05:00
emizzle 7dfa2b939c fix(@embark/dapps): Contracts app test failure
During `embark test`, the contracts dapp was throwing an error:
```
connection not open on send()
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/Users/michael/repos/embark/node_modules/web3-core-helpers/src/errors.js:42:16)
    at XMLHttpRequest.request.onreadystatechange (/Users/michael/repos/embark/node_modules/web3-providers-http/src/index.js:92:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/michael/repos/embark/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
    at XMLHttpRequest._setReadyState (/Users/michael/repos/embark/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
    at XMLHttpRequest._onHttpRequestError (/Users/michael/repos/embark/node_modules/xhr2-cookies/xml-http-request.ts:379:8)
    at ClientRequest.<anonymous> (/Users/michael/repos/embark/node_modules/xhr2-cookies/xml-http-request.ts:266:37)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:75120) UnhandledPromiseRejectionWarning: Error: Provider not set or invalid
...
```

This was due to the fact that during testing, the Ganache VM **provider** is used as the blockchain node, instead of spinning up an instance of Ganache. Due to this, there is no HTTP nor WebSockets RPC endpoint opened on the VM node, and the contracts dapp was not able to connect to the node during tests.

Add `$EMBARK` to the contract config’s `dappConnection` list, so that the contract test dapp can successfully connect to Embark’s proxy, which ultimately communicates with the Ganache VM.

As a side note, without `$EMBARK` in the `dappConnection` list, the tests could run successfully when using `embark test —node=embark`. This succeeds because the geth node exposes the RPC WebSockets endpoint that the contracts app connects to on `ws://localhost:8546`.
2019-12-17 10:44:01 -05:00
Iuri Matias 78a06c9d76 chore(release): 5.0.0-alpha.5 2019-12-16 13:49:41 -05:00
Michael Bradley, Jr ee56f37713 build: implement collective typecheck
This PR replaces #2057.

Implement a collective typecheck action that can be invoked in the root of the
monorepo with `yarn typecheck` or in watch-mode with `yarn watch:typecheck`.
Include the watch-mode typecheck action as part of `yarn start` (a.k.a
`yarn watch`).

To activate collective typecheck for a package in the monorepo, its
`package.json` file should specify:

```
{
  "embark-collective": {
    "typecheck": true
  }
}
```
*-or-*
```
{
  "embark-collective": {
    "typecheck": {...}
  }
}
```

Where `{...}` above is a `tsconfig.json` fragment that will be merged into the
config generated for the package according the same rules that `tsc` applies
when merging [configs][config].

When collective typecheck begins, it generates a `tsconfig.json` for the root
of the monorepo and for each package that is activated for the action. If the
generated JSON is different than what's on disk for the respective root/package
config, or if the config is not present on disk, then it will be
written. Changes to generated `tsconfig.json` files should be committed; such
changes will arise when there are structural changes to the monorepo, e.g. a
package is added, removed, moved and/or the directory containing it is
renamed. Since the configs are only generated at the beginning of collective
typecheck, when structural changes are made in the monorepo `yarn typecheck`
(or `yarn start` or `yarn watch:typecheck`) should be restarted.

Nearly all of the packages in the monorepo (i.e. all those for which it makes
sense) have been activated for collective typecheck. Even those packages that
don't contain `.ts` sources are activated because `tsc` can make better sense
of the code base as a whole owing to the project references included in the
generated `tsconfig.json` files. Also, owing to the fully cross-referenced
`tsconfig.json` files, it's possible for `tsc` to type check the whole code
base without babel (`yarn build` or `yarn watch:build`) having been run
beforehand.

**NOTE** that a *"cold typecheck"* of the whole monorepo is resource intensive:
on this author's 2019 MacBook Pro it takes around three minutes, the fans spin
up, and `tsc` uses nearly 0.5 GB of RAM. However, once a full typecheck has
completed, the next full typecheck will complete in a few seconds or less; and
when running in watch-mode there is likewise a *big* speedup once a full
typecheck has completed, whether that full check happened before it's running
in watch-mode or when watch-mode itself resulted in a full check before
switching automatically to incremental check, as well a corresponding *big*
reduction in resource consumption. A full check will be needed any time
`yarn typecheck` (or `yarn start` or `yarn watch:typecheck`) is run in a fresh
clone plus `yarn install`, or after doing `yarn reboot[:full]` or `yarn reset`.

The combination of options in each generated package-level `tsconfig.json` and
the root `tsconfig.base.json` result in `tsc` writing `.d.ts` files (TypeScript
declaration files) into the `dist/` directory of each package. That
output is intended to live side-by-side with babel's output, and therefore the
`"rootDir"` option in each generated config is set to `"./src"`.

In projects activated for collective typecheck, `.js` may be converted to `.ts`
and/or `.ts` sources may be added without any additional changes needed in
package-level `package.json`.

---

Reorganize types in `packages/core/typings` (a.k.a `@types/embark`) into
`packages/core/core` (`embark-core`), refactor other packages' imports
accordingly, and delete `packages/core/typings` from the monorepo. This results
in some similarly named but incompatible types exported from `embark-core`
(e.g. `Events` and `EmbarkEvents`, the latter being the one from
`packages/core/typings`); future refactoring should consolidate those types. To
avoid circular dependency relationships it's also necessary to split out
`Engine` from `embark-core` into its own package (`embark-engine`) and to
introduce a bit of duplication, e.g. the `Maybe` type that's now defined in
both `embark-i18n` and `embark-core`.

In the process of the types reorg, move many dependencies spec'd in various
`package.json` to the `package.json` of the package/s that actually depend on
them, e.g. many are moved from `packages/embark/package.json` to
`packages/core/engine/package.json`. Related to those moves, fix some Node.js
`require`-logic related to bug-prone dependency resolution.

Fix all type errors that appeared as a result of activating collective
typecheck across the whole monorepo.

Reactivate `tslint` in `packages/core/core` and fix the remaining linter errors.

Tidy up and add a few items in the root `package.json` scripts.

Bump lerna from `3.16.4` to `3.19.0`.

Bumpt typescript from `3.6.3` to `3.7.2`.

Bumpt tslint from `5.16.0` to `5.20.1`.

Make various changes related to packages' `import`/`require`ing packages that
weren't spec'd in their respective `package.json`. More refactoring is needed
in this regard, but changes were made as the problems were observed in the
process of authoring this PR.

[config]: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
2019-12-13 13:59:47 -05:00
Iuri Matias c00511a0e2 chore(release): 5.0.0-alpha.4 2019-12-12 11:38:22 -05:00
emizzle bd4b110a78 feat(@embark/whisper): Add Whisper client config
Add option in communication config to choose which Whisper client to use.

Because Parity’s implementation of Whisper is not compatible with Whisper v6, and therefore web3.js in its current form, the following changes have been made:
1. remove any functionality associated with launching a Parity Whisper process.
2. Warn the user when the Parity Whisper client has been opted for in the communication config.
3. Return an error for API calls when Parity Whisper client has been opted for in the communication config.
4. Update Cockpit’s Communication module to show errors returned from API calls.
5. Update the messaging configuration documentation for the new communication client option.
2019-12-11 11:12:18 -05:00
Pascal Precht 446197baff fix(@embark/blockchain): make disabling blockchain feature work
Users can turn of blockchain support if they want to using the blockchain.js
configuration. In practice however, this has never properly worked as several
places in Embark's codebase weren't actually honoring that configuration value.

This commit introduces the necessary changes so that disabling blockchain support will:

No longer generate blockchain related EmbarkJS artifacts
No longer try to deploy Smart Contracts but still compile them
2019-12-11 11:08:13 -05:00
emizzle db0e45e96e chore(@embark/site): Add `—template` deprecation notice. 2019-12-11 09:39:20 -05:00
Iuri Matias 37ae942b99 chore(release): 5.0.0-alpha.3 2019-12-06 06:15:07 -05:00
Iuri Matias 6efe791cfd chore(release): 5.0.0-alpha.2 2019-12-05 15:03:09 -05:00
Michael Bradley, Jr 5f33b93b31 refactor(@embark/core): make 8547 the default port of communication provider node
Client traffic with the communication provider node, e.g. a whisper node, is
not proxied so make the default port 8547 instead of 8557. It's not a technical
problem for it to be 8557, but our convention to present has been for 855*
ports to be proxied while the upstream is an 854* port.

Update the boilerplate and demo templates to match.
2019-11-29 11:49:30 +01:00
Michael Bradley, Jr eb77e8e4e0 build(deps-dev): in embark-dapp-template-demo bump reactstrap from 8.0.1 to 8.1.1 2019-11-25 17:51:09 -06:00
Michael Bradley, Jr 57db0abc69 build(deps-dev): bump react-dom from 16.9.0 to 16.12.0 2019-11-25 17:51:09 -06:00
dependabot-preview[bot] cc0a8d8b7b build(deps-dev): bump react from 16.9.0 to 16.12.0
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 16.9.0 to 16.12.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.12.0/packages/react)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 17:51:09 -06:00
emizzle 23e94d6197 fix(@embark/tests): Improve expiration unit test
Improve the reliability of the expiration unit test in the test dapp by explicitly setting the `block.timestamp` and comparing an expiration value against that.

This improves on the current implementation that relies on time passed which varies depending on the speed of unit tests run (CPU speed, logs shown, etc).
2019-11-22 11:23:18 +01:00
emizzle f6f45077e9
fix(@embark/proxy): Fix unsubsribe handling and add new provider
When `eth_unsubscribe` is received in the proxy, ensure this request is forwarded through on the correct socket (the same socket that was used for the corresponding `eth_subscribe`).

Move subscription handling for `eth_subscribe` and `eth_unsubscribe` to RpcModifiers (in `rpc-manager` package).

For each `eth_subscribe` request, a new `RequestManager` is created. Since the endpoint property on the proxy class was updated to be a provider, the same provider was being assigned to each new `RequestManager` and thus creating multiple event handlers for each subscription created. To circumvent this, we are now creating a new provider for each `RequestManager`.

Co-authored-by: Pascal Precht <pascal.precht@googlemail.com>
2019-11-21 15:38:48 +01:00
Michael Bradley, Jr 978e17daa1 build(deps): bump deprecated ipfs-api@17.2.4 to ipfs-http-client@39.0.2
BREAKING CHANGE:

Related to #1985. Prior to Embark's minimum supported version of Node.js being
bumped to to 10.17.0, Embark was incompatible with any relatively recent
release of the `ipfs-http-client` package.

While *internal* changes are needed re: ipfs's `Buffer` export for
e.g. `embark_demo` to function correctly *(and this PR makes those changes)*,
Embark otherwise runs/tests okay.

Keep in mind #2033.

However, if a dApp author were to explicitly `require('ifps-api')` in the
front-end that wouldn't work as before; and swapping `"ipfs-http-client"` for
`"ipfs-api"` might also not be enough — there are API changes that dApp authors
would need to consider, regardless of Embark presently supplying the dependency
and EmbarkJS wrapping around it.

Closes #1994.
2019-11-18 09:41:24 -06:00
Pascal Precht 3f4e12aa0f fix(@embark/dapps): add missing constructor argument in contracts config 2019-11-14 12:28:41 +01:00
Iuri Matias af51e2d793 bugfix (@embark/stack/embarkjs): set default gas so it's an optional parameter for onDeploy directives in the contracts config 2019-11-12 17:08:48 -05:00
Jonathan Rainville de9e667794 feat(@embark/ens): enable changing namesystem config per test
Adds back the feature to change ENS config per test
Fixes ENS not working in the console because EmbarkJS was not ready
2019-11-12 09:31:05 -05:00
Pascal Precht b4478a9c46 fix(@embark/ens): don't change shape of Smart Contract args in action hooks
This commit fixes the issue that it wasn't possible anymore to use named constructor arguments
in Smart Contract configurations.

For example, the following Smart Contract expects two constructor arguments:

```solidity
contract SomeContract {
  constructor(address[] _addresses, int initialValue) public {}
}
```

The first being a list of addresses, the second one a number. This can be configured as:

```js
SomeContract: {
  args: [
    ["$MyToken2", "$SimpleStorage"],
    123
  ]
}
```

Notice how the order of arguments matters here. `_addresses` come first in the constructor,
so they have to be defined first in the configuration as well.

Another way to configure this is using named arguments, which is what's broken prior to this commit:

```js
SomeContract: {
  args: {
    initialValue: 123,
    _addresses: ["$MyToken2", "$SimpleStorage"]
  }
}
```

Using a notation like this ^ the order no longer matters as Embark will figure out the right
values for the constructor arguments by their names.

The reason this is broken is because there are several modules in Embark that register and
run a `deployment:contract:beforeDeploy` action, which are allowed to mutate this configuration
object. One of those modules is the `ens` module, which searches for ENS names in the arguments
and figure out whether it has to replace it with a resolved address.

One thing that particular module didn't take into account is that `args` could be either and
array, or an object and will always return an array, changing the shape of `args` in case it was
an object.

This is a problem because another module, `ethereum-blockchain-client`, another action is registered
that takes this mutated object in `determineArguments()` and ensure that, if `args` is actually an
object, the values are put in the correct position matching the constructor of the Smart Contract in
question.

One way to solve this was to use the newly introduced [priority](https://github.com/embark-framework/embark/pull/2031) and ensure
that `ens` action is executed after `ethereum-blockchain-client`'s.

However, the actual bug here is that the ENS module changes the shape of `args` in the first place,
so this commit ensures that it preserves it.
2019-11-11 14:01:48 -05:00
Michael Bradley, Jr 2543acad75 refactor(@embark/library-manager): restrict versionable packages to only solc
BREAKING CHANGE:

Remove support for specifying the versions of `web3` and `ipfs-api` in a
project's `embark.json`.
2019-11-08 11:27:20 -06:00
Jonathan Rainville 95b5ae48c6 fix(@embark/accounts-manager): limit funding accounts to 1 at a time 2019-11-08 08:46:32 -05:00
Pascal Precht 92f6dd4ce9 fix(@embark/dapps): add missing Smart Contract configurations
Those had been removed in a refactor while the Smart Contract sources have been
kept around, resulting in deployment errors as Embark doesn't know what to do
with the Smart Contracts that don't come with a dedicated config.

This commit re-adds the configurations to make the deployment pass again.
2019-11-06 13:16:44 +01:00
Michael Bradley, Jr fccda21623 chore(release): 5.0.0-alpha.1 2019-11-05 14:55:06 -06:00
Pascal Precht bad22075ca fix(@embark/templates): ensure boilerplate template comes with valid whisper port
As part of the refactor in e330b338ea we've introduced a
second geth client process to enable whisper functionalities in DApps.
This introduced also a new default port for whisper (e330b338ea (diff-a61fbc84e4172487789d676437f26b5fR14)).
This default port has not been introduced on our boilerplate template which is
used in `embark new` when developers scaffold new apps.

This resulted in runtime errors where the geth process for whisper wasn't
able to successfuly boot up as its configured port address is already in use:

```
geth exited with error code 1
geth exited with error code 1
Blockchain process ended before the end of this process. Try running blockchain in a separate process using `$ embark blockchain`. Code: null
```

This commit changes the default port for whisper in the boilerplate template
to ensure apps created using `embark new` don't run into this error anymore.
2019-11-05 10:57:14 -06:00
Jonathan Rainville 9e654c533e fix: fix ws providers to have the patch for a bigger threshold (#2017)
* fix: fix ws providers to have the patch for a bigger threshold

* chore (@embark/dapps): add big contract to test WS issue with large contracts
2019-10-30 16:02:17 -04:00
Jonathan Rainville fe3e604fec fix(@embark/test-runner): fix test contracts being tracked 2019-10-30 12:39:21 -05:00
Michael Bradley, Jr 85235f88b2 chore(release): 5.0.0-alpha.0 2019-10-28 16:05:13 -05:00
Michael Bradley d17fe33339 build: update babel and webpack dependencies (#1987)
Includes a switch from core-js@2 to core-js@3
2019-10-24 17:41:28 -04:00
Jonathan Rainville 6e9635c12b fix(@contract-app): fix contracts app tests (#1982)
* refactor(@embark/dapps/tests/app): use function syntax

These changes don't fix the race conditions related to the test dapp's tests
but are a step in the right direction.

* refactor(@embark/dapps/tests/contracts): adjustments to get tests passing

Further refactoring is needed re: potentially duplicated or overlapping logic
in `packages/plugins/solidity-tests` and
`packages/core/utils/src/solidity/remapImports.ts`, as well in disabled test
dapp tests

* test(dapps/tests/app): temporarily disable intermittently failing tests

They are failing because of a race condition; once that race condition has been
fixed these tests should be reenabled.

* fix(@embark/solidity-tests): fix importing the library for the tests
2019-10-23 14:58:40 -04:00
Jonathan Rainville 2193d82399 fix(test-app): make test app test all pass (#1980)
Fix a lot of bugs and reenable a couple of modules
Some tests were kept disabled, mostly the ENS and EmbarkJS tests
Those need to add back a fairly significant feature to work
Add back missing solidity contracts
2019-10-22 09:27:22 -04:00
Jonathan Rainville a3b52676fc Fix part of the test app and add new test util functions (#1977)
* fix: fix tests hanging because the console is not started

* fix(@embark/proxy): send back errors correctly to the client

Code originally by @emizzle and fixed by me

* feat(@embark/test-runner): add assert.reverts to test reverts

* fix: make test app actually run its test and not hang

* fix(@embark/proxy): fix listening to contract event in the proxy

* feat(@embark/test-runner): add assertion for events being triggered

* docs(@embark/site): add docs for the new assert functions

* feat(@embark/test-runner): add increaseTime util function to globals

* docs(@embark/site): add docs for increaseTime
2019-10-17 14:39:25 -04:00
Jonathan Rainville d86c26d71a Fix VM as a client and cleanup template configs (#1966)
* chore(templates): clean up template configs

* fix: enable vm as a client

Bug was caused by the web3 listening to events too late (race)
2019-10-14 10:42:13 +09:00
Jonathan Rainville c54b8d9e44 feat: call action before starting the blockchain node 2019-10-04 10:12:16 -04:00
Michael Bradley, Jr 17ccd5c1bd build: tidy up the monorepo in prep for v5.0.0-alpha.0 2019-10-01 13:29:53 -05:00
Michael Bradley, Jr 3b649fa455 build: phase 1 of introducing embark-collective 2019-10-01 13:28:13 -05:00
Jonathan Rainville f54fbf0b3d feat(@embark/test-runner): make vm default node (#1846)
* feat: make vm default node

* feat(@embark/tests): enable switching node between tests
2019-09-12 17:30:28 -04:00
Iuri Matias e330b338ea
Fix/whisper communication (#1895)
* fix(@cockpit/utils): make communications tab work again

* fix whisper node start; fix whisper console api registration; fix/refactor whisper web api
2019-09-11 14:21:53 -04:00
Jonathan Rainville ee634c8403 fix: fix test-app, contracts index file and reload on change (#1892)
* fix: fix test-app, contracts index file and reload on change

* fix(@embark/cmd_controller): fix missing nodes

Was removed by accident

* feat(@embark/demo): add favicon to embark demo

* chore(@embark/cockpit): change favicon to new Embark logo

* fix(@embark/embarkjs-ens): fix ENS config for embarkjs-ens

* remove comments
2019-09-11 12:31:57 -04:00
André Medeiros 5e560768ad chore: test runner tests (#1884)
* chore: test runner tests

* chore: mocha test runner tests

* chore: add solidity test file to dapp
2019-09-07 15:55:24 -04:00
Iuri Matias 718d19f7d3
re-add embarkjs generation (#1858)
* fix embarkjs generation

fix ens setProvider

fix embarkjs objects

fix generated embarkjs provider

generate contracts

fix embarkjs-ens

* address some of the issues in the code review

* address some of the issues in the code review

* address some of the issues in the code review

* address some of the issues in the code review
2019-09-05 16:04:52 -04:00
Michael Bradley b736ebefcd refactor: initial steps toward 5.0.0-alpha.0 (#1856)
BREAKING CHANGE:

There are more than several breaking changes, including DApp configuration for
accounts.
2019-08-30 16:50:20 -04:00
Michael Bradley, Jr 706e43c9c5 chore(release): 4.1.1 2019-08-28 14:52:21 -05:00
Jonathan Rainville dd07f6713a fix(@embark/demo): add back lights 2019-08-27 20:58:22 -05:00
Michael Bradley, Jr 190d8de5f8 build(deps-dev): in dapps/tests/app bump bootstrap back to 3.4.1 2019-08-26 09:41:27 -05:00
Michael Bradley, Jr 6a64124e13 build(deps-dev): bump react-dom to 16.9.0 2019-08-26 09:41:27 -05:00
dependabot-preview[bot] 97cc709d7f build(deps-dev): bump react from 16.7.0 to 16.9.0
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 16.7.0 to 16.9.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.9.0/packages/react)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-26 09:41:27 -05:00
Jonathan Rainville 844e8ca55f Fix demo style and improve (#1818)
* fix(@mbark/embarkjs): enable using wss in embarkjs and the Dapp

* fix(@embark/demo): fix demo style by and improvise

* update yarn.lock. CI please be gentle
2019-08-23 11:51:03 -04:00
dependabot-preview[bot] dca6342330 build(deps): bump rimraf from 2.6.3 to 3.0.0
Bumps [rimraf](https://github.com/isaacs/rimraf) from 2.6.3 to 3.0.0.
- [Release notes](https://github.com/isaacs/rimraf/releases)
- [Changelog](https://github.com/isaacs/rimraf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/isaacs/rimraf/compare/v2.6.3...v3.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-20 13:44:24 -05:00
dependabot-preview[bot] 113ff0a00f build(deps-dev): [security] bump bootstrap from 4.1.2 to 4.3.1
Bumps [bootstrap](https://github.com/twbs/bootstrap) from 4.1.2 to 4.3.1. **This update includes a security fix.**
- [Release notes](https://github.com/twbs/bootstrap/releases)
- [Commits](https://github.com/twbs/bootstrap/compare/v4.1.2...v4.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-19 09:15:34 -05:00
dependabot-preview[bot] e61921c43e build(deps-dev): [security] bump jquery from 3.3.1 to 3.4.0
Bumps [jquery](https://github.com/jquery/jquery) from 3.3.1 to 3.4.0. **This update includes security fixes.**
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.3.1...3.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-18 19:33:58 -05:00
dependabot-preview[bot] 80c7ff2264 build(deps-dev): [security] bump bootstrap from 3.3.7 to 4.1.2
Bumps [bootstrap](https://github.com/twbs/bootstrap) from 3.3.7 to 4.1.2. **This update includes security fixes.**
- [Release notes](https://github.com/twbs/bootstrap/releases)
- [Commits](https://github.com/twbs/bootstrap/compare/v3.3.7...v4.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-18 19:33:25 -05:00
Michael Bradley, Jr 4b4a00bd4d chore(release): 4.1.0 2019-08-12 12:14:12 -05:00
Michael Bradley, Jr cda40b93c4 chore(release): 4.1.0-beta.6 2019-08-09 17:50:05 -05:00
Michael Bradley, Jr ad30a98169 refactor: upgrade to web3 v1.2.1
Upgrade all dependencies on web3/web3-* v1.0.0-beta.37 to v1.2.1.

Make various adjustments related to the previous convention of
`"web3": "1.0.0-beta"` in `embark.json` signifying that embark's own web3
dependency should be used in dapp builds.

Fix bugs in library manager, including a switch from using the
live-plugin-manager package to using npm in a child process to install
`"versions"` dependencies specified in `embark.json` when a specified version
doesn't match up with embark's own version for that package.

Avoid race conditions when installing `"versions"` by completing all installs
prior to starting other services. If an install fails, then after all the
installs have completed or failed the embark command will exit with error.

Change various comments and update docs to reflect the new default of web3
v1.2.1.
2019-08-07 11:01:23 -05:00
Jonathan Rainville c2094dbc49 fix(@embark/test-runner): fix describe in describe tests 2019-08-07 11:00:25 -05:00
Jonathan Rainville b5c81bd41a feat(@embark/pipeline): enable choosing which fields to filter out 2019-08-01 13:53:47 -04:00
Jonathan Rainville b0cccaea05 feat(@embark/pipeline): add minimalContractSize to remove bytecode 2019-08-01 13:53:47 -04:00
Jonathan Rainville 1491028665 use callbacks instead of exiting 2019-07-23 10:55:14 -04:00
Michael Bradley, Jr 5930cce7dd chore(release): 4.1.0-beta.5 2019-07-10 16:21:47 -05:00
Pascal Precht 93ca3ad97c fix(@embark/embarkjs-whisper): Messages.isAvailable() should always return a promise
`EmbarkJS.Messages.isAvailable()` in some cases return synchronously (when whisper isn't
set up), in other cases asynchronously. This actually breaks our demo application for
the following reason:

We check for Whisper's availability via:

```
EmbarkJS.Messages.Providers.whisper.getWhisperVersion((err, _version) => {
  if (err) {
    return console.log(err);
  }
  this.setState({whisperEnabled: true});
});
```

There's a couple of problems here:

- This code will break right away when whisper isn't available, resulting in an error:
  ```
  Cannot read property _requestManager of undefined
  ```

- The reason this error happens is because there's no `web3` object available inside
  our EmbarkJS.Messages code. Even though there **is** a web3 object, EmbarkJS.Messages
  doesn't know about this because it only sets it when its `setProvider()` API is called,
  which effectively doesn't happen at all when Whisper isn't enabled on the connected
  node

- While this could be fixed with a simple check on whether EmbarkJS.Messages' internal
  `web3` references is a thing, really what should be used in the demo is the `isAvailable()`
  API.

`isAvailable()` should always return a promise (similar to `EmbarkJS.Storage.isAvailable()`.

This commit ensures that `isAvailable()` always returns a promise and changes the demo
template to use `isAvailable()` over `getWhisperVersion()`.
2019-07-01 11:11:03 +02:00
Michael Bradley, Jr eecb48f5b6 chore(release): 4.1.0-beta.4 2019-06-27 14:23:32 -05:00
Pascal Precht 1b6987ee8f fix(@dapps/templates/demo): ensure whisper channel state is set correctly 2019-06-27 14:11:24 -05:00
Michael Bradley, Jr d684b9af0f refactor(@embarkjs/web3): make web3 connector an internal plugin like the other embarkjs-* packages
Effectively deprecate the `embarkjs-connector-web3` package but don't introduce
a breaking change by simply not loading the plugin if it's specified in a
DApp's `embark.json`. If the deprecated plugin is specified, display a message
indicating the plugin was ignored and suggesting it be removed from the
project's `embark.json` and `package.json`.
2019-06-27 14:10:12 -05:00
Pascal Precht 322397f81c fix(@dapps/demo): don't allow subscription to whisper channels with less than 4 chars
This has been a problem in Cockpit as well and was fixed accordingly.
Whisper doesn't allow subscribing to channels with names that have less
than 4 characters.

This could be fixed in different ways, one being on the library level
(e.g. have embark check for the given length and not subscribing when it
doesn't pass the check), the other one being on the application/ui level.

The reason it makes sense to solve this in the application layers is because
we keep the it open for users of EmbarkJS.Messages APIs to handle errors
the way they want.

Fixes #1666
2019-06-27 08:36:05 -05:00
Jonathan Rainville 908aa3b148 fix(templates): fix templates because tests don't like empty files 2019-06-21 11:00:27 -04:00
Jonathan Rainville 332229ff9d feat(@embark/test-runner): return accounts in the describe callback 2019-06-21 11:00:27 -04:00
Jonathan Rainville 8c16541019 feat(@embark/test-runner): wait for deploy before enterning describe 2019-06-21 11:00:27 -04:00
Shailendra Shukla 09d7428e7e fix(@embark/dapps): old link updated to the latest documentation at website
The previous link was pointing to readthedocs.io, which wasn't active. So here I've replaced it with the link to the official documentation on the Embark website.
2019-06-11 09:50:44 -04:00