Commit Graph

650 Commits

Author SHA1 Message Date
Michael Bradley, Jr 5d61faa550 build(deps): bump ora from 2.1.0 to 4.0.3 2019-11-13 11:18:45 -06: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 aecb99d428 feat(@embark/tests): enable comms and storage in tests
But only enabled at the start and not changed per test
2019-11-12 09:31:05 -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
Iuri Matias 41c943f052
bugfix (@embark/embarkjs): fix required Web3 object so it can support brave and other browser not injecting a Web3 object with websockets (#2036) 2019-11-11 13:59:56 -05:00
Pascal Precht d2556af8ba refactor(@embark/core): move Engine into embark-core 2019-11-11 17:00:01 +01:00
Jonathan Rainville 8733ca911c chore(@embark/deploy-tracker): fix tests and make them run in CI 2019-11-08 16:53:57 -06:00
Michael Bradley, Jr 25d0510d5b feat(@embark/plugins/geth): bump min supported geth version from 1.8.14 to 1.9.7
This is not a breaking change because Embark doesn't strictly enforce the
mininum version, it only prints a warning.
2019-11-08 12:45:45 -06:00
Michael Bradley, Jr 4ee900480d fix(@cockpit/console): show contract names in the suggestions list
Update event name `"deploy:contract:deployed"` to
`"deployment:contract:deployed"`.

Also, listen one time for `"deployment:deployContracts:afterAll"` and then
request the full contracts list so as to pickup contract names that were
already deployed. This is necessary for subsequent `embark run` (without
reset), otherwise the suggestions list will be missing contracts.
2019-11-08 12:43:08 -06:00
Michael Bradley, Jr 7b991bb58a refactor(@embark/plugins/geth): don't run empty commands
The `WhisperGethClient` returns empty strings for its "new account" and "list
accounts" commands; if a command is an empty string then `Blockchain` should
not execute it.
2019-11-08 11:28:03 -06: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
dependabot-preview[bot] 98b688cc1a build(deps): bump remix-tests from 0.1.14 to 0.1.20
Bumps [remix-tests](https://github.com/ethereum/remix-tests) from 0.1.14 to 0.1.20.
- [Release notes](https://github.com/ethereum/remix-tests/releases)
- [Commits](https://github.com/ethereum/remix-tests/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-08 11:12:43 -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
Jonathan Rainville 776db1b7f7 feat(@embark/plugin): add priority to regsiterActionForEvents 2019-11-08 08:46:32 -05:00
dependabot-preview[bot] 6afe1ace08 build(deps-dev): bump @coreui/coreui from 2.1.0 to 2.1.16
Bumps [@coreui/coreui](https://github.com/coreui/coreui) from 2.1.0 to 2.1.16.
- [Release notes](https://github.com/coreui/coreui/releases)
- [Changelog](https://github.com/coreui/coreui/blob/v2.1.16/CHANGELOG.md)
- [Commits](https://github.com/coreui/coreui/compare/v2.1.0...v2.1.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-07 13:44:25 -06:00
Michael Bradley, Jr fccda21623 chore(release): 5.0.0-alpha.1 2019-11-05 14:55:06 -06:00
dependabot-preview[bot] 6bfbedb8f7 build(deps-dev): bump qs from 6.5.2 to 6.9.0
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.9.0.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-05 11:28:03 -06:00
Michael Bradley 1a43dcaa79 fix(@cockpit/dashboard): "Deployed Contracts" should auto-update after deployment (#2020) 2019-11-05 12:07:59 -05:00
Michael Bradley, Jr c320dcfbb5 refactor(@embark/core/console): silence errors when autocomplete is attempted on bad reference
Previously, in the embark cli dashboard/console, if you were to type `Foo.` and
hit tab for autocomplete then (assuming you hadn't defined `Foo`) there would
be unhandled errors and the console could even become unusable.

Refactor `packages/core/console` and related code so that nothing happens when
you attempt to autocomplete a bad reference (the same behavior as Node's own
REPL).
2019-11-05 11:01:43 -06:00
Michael Bradley, Jr 6b405d1d7e build(deps-dev): bump react-treebeard from 3.1.0 to 3.2.4
Also bump peerDeps: @emotion/core from 0.13.1 to 10.0.22 and @emotion/styled
from 0.10.6 to 10.0.23. Satisfy @babel/runtime peerDep with 7.6.3.

Make small refactors in components/FileExplorer and
containers/FileExplorerRowContainer re: the package upgrades.

Replaces #1998
2019-11-05 11:01:21 -06:00
Jonathan Rainville 863ae51a2f Fix embark test with --node (#2021)
* fix(@embark/solidity): fix solidity ipc connection with blockchain

When blockchain was run in another process, the IPC was connected,
but the compiler was not loaded, so the IPC calls never returned

* fix(@embark/geth): fix cb is not a fn because it needs request2
2019-11-05 12:00:42 -05:00
Iuri Matias dc64b99779
Remove unnecessary messages/traces from logs when not debugging (#1986)
* bugfix(@embark/stack/blockchain): fix issue with calling wrong callback variable

* chore(@embark/): remove unnecessary messages/warnings when not in debug mode

* refactor(@embark/core/events): add debugEventsEnabled method
2019-11-05 10:35:37 -05:00
Iuri Matias 830e91de7f
bugfix(@embark): fix upload and graph command (#1993)
bugfix(@embark): fix upload command

bugfix(@embark): fix graph command

update graph cmd

update upload cmd
2019-11-05 10:34:33 -05:00
Pascal Precht b0e71d9427 fix(@embark/console): ensure Cockpit is only started in non-secondary mode (#2026)
`embark console` registers and tries to spin up `Cockpit`, even when there's already
a Cockpit instance running and thefore exits with an error that a certain port is already
in use.

This commit ensures that Cockpit is only bootstrapped when `embark console` is
executed as a non-secondary process, meaning that there's no other `embark run`
process active that might occupy Cockpit's default port.
2019-11-05 10:22:11 -05:00
Pascal Precht abe79c87f4 fix(@embark/cockpit): ensure correct data is send to web3's `ecRecover` (#2024)
We've introduced a regression in https://github.com/embark-framework/embark/commit/f9557d4c9 where invalid data
has been sent to web3's `ecRecover()` method to verify signed messages.

This causes an internal server error and the utility feature inside Cockpit
unsuable.

This commit ensures that the correct data is sent to `ecRecover()` making verifying
messages through Cockpit functional again.
2019-11-05 10:21:43 -05:00
dependabot-preview[bot] d0f4236aff build(deps): bump core-js from 3.3.4 to 3.3.5
Bumps [core-js](https://github.com/zloirock/core-js) from 3.3.4 to 3.3.5.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/compare/v3.3.4...v3.3.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-01 12:21:12 -05: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
Iuri Matias ee15cd4c87
feature (@embark/core): show origin of each log in the logfile logs (#2018) 2019-10-30 16:01:59 -04:00
Jonathan Rainville fe3e604fec fix(@embark/test-runner): fix test contracts being tracked 2019-10-30 12:39:21 -05:00
Jonathan Rainville 72278aad72 fix(@embark/deploy-tracker): fix not storing different chains 2019-10-30 12:39:21 -05:00
Iuri Matias b8f7ec20d4 fix(@embark/core): set loglevel back to info 2019-10-30 12:19:24 -05:00
emizzle f9ad486edb fix(@embark/proxy): Fix contract event subscriptions
Fix the proxy’s handling of WebSocket connections when subscribing to contract events and node data using the `eth_subscribe` RPC request.

Previously, the client connection that the subscription data was sent to was often in a closed state. It was determined that this connection was the wrong connection to forward the data in the first place. The connection was in fact generally the connection created for the Ethereum service check which was then (correctly and subsequently) closed after it had finished its operation.

The flow of a proxy request handling a WebSocket “eth_subscribe” RPC request is now as follows:
1. A WebSocket RPC request `”eth_subscribe”` is sent from a client to the proxy.
2. Proxy forwards the request to the node by way of a new instance of `RequestManager`.
3. When the node receives an event matching the subscription, it sends the event data back to same socket connection it received the request on (ie the specific instance of `RequestManager`).
4. The `RequestManager` fires the `”data”` event containing the subscription data, and this event is picked up in the proxy.
5. The proxy then forwards the subscription data on to the originating WS client connection.

All other requests (ie non-WS or WS RPC requests that are not `eth_subscribe`) will be serviced to/from the node using a single `RequestManager` instance.

Co-authored-by: Pascal Precht <pascal.precht@gmail.com>
2019-10-30 12:19:24 -05:00
Michael Bradley, Jr 85235f88b2 chore(release): 5.0.0-alpha.0 2019-10-28 16:05:13 -05:00
Iuri Matias 867a55c98a
Revert "fix(@embark/proxy): Fix contract event subscriptions" (#2005)
* Revert "fix(@embark/core): set loglevel back to info"

This reverts commit a03ffd56e5.

* Revert "fix(@embark/proxy): Fix contract event subscriptions"

This reverts commit 173d53de2f.
2019-10-28 16:20:14 -04:00
Jonathan Rainville 395ae83f9c fix(@embark/transaction-logger): don't show logs for stray receipts 2019-10-28 13:20:25 -05:00
Michael Bradley, Jr 6ee2ca2b8d refactor(@embark/cmd): exit with error when command is unknown
Example: `embark rest && embark run`

The command/s following `&&` shouldn't run after the first one fails and prints
an "unknown command" message.
2019-10-28 13:00:50 -05:00
Iuri Matias a03ffd56e5 fix(@embark/core): set loglevel back to info 2019-10-28 13:00:18 -05:00
emizzle 173d53de2f fix(@embark/proxy): Fix contract event subscriptions
Fix the proxy’s handling of WebSocket connections when subscribing to contract events and node data using the `eth_subscribe` RPC request.

Previously, the client connection that the subscription data was sent to was often in a closed state. It was determined that this connection was the wrong connection to forward the data in the first place. The connection was in fact generally the connection created for the Ethereum service check which was then (correctly and subsequently) closed after it had finished its operation.

The flow of a proxy request handling a WebSocket “eth_subscribe” RPC request is now as follows:
1. A WebSocket RPC request `”eth_subscribe”` is sent from a client to the proxy.
2. Proxy forwards the request to the node by way of a new instance of `RequestManager`.
3. When the node receives an event matching the subscription, it sends the event data back to same socket connection it received the request on (ie the specific instance of `RequestManager`).
4. The `RequestManager` fires the `”data”` event containing the subscription data, and this event is picked up in the proxy.
5. The proxy then forwards the subscription data on to the originating WS client connection.

All other requests (ie non-WS or WS RPC requests that are not `eth_subscribe`) will be serviced to/from the node using a single `RequestManager` instance.

Co-authored-by: Pascal Precht <pascal.precht@gmail.com>
2019-10-28 13:00:18 -05:00
Jonathan Rainville a4b3ef454a fix(@embark/parity): fix version result not available 2019-10-28 12:10:34 -05:00
Jonathan Rainville 9803507221 fix(@embark/geth): fix version result not available 2019-10-28 12:10:34 -05:00
Jonathan Rainville 1302f9fb48 fix(@embark/ens): fix trying to resolve when ENS is not registered 2019-10-28 12:10:34 -05:00
Pascal Precht 8fee0b8ccc fix(@embark/core): make blockchain command work again
Running embark's `blockchain` command resulted in a runtime error where the `blockchain`
module couldn't be found. This is a bug introduced in ed0d3afb4f where
we forgot to update `blockchainStackComponents` in Embark's engine accordingly.

Fixing this results in `embark blockchain` hanging. This is because there's a similar bug
in `blockchainStackCopmnonents` introduced in 3b8f8f9ea7.

This commit fixes both bugs by ensuring `embark-blockchain` and `embark-blockchain-client`
packages are loaded using the correct APIs.
2019-10-28 11:55:09 -05:00
Michael Bradley, Jr db66f0e197 refactor(@embark/template_generator): account for prerelease in embark version
If the version in the embark package's own `package.json` has a prerelease
identifier then appending `.x` to the major version isn't viable for resolving
the latest version of the template package that's in the same prerelease line;
a more complex semver range must be used:

```
"${pkg}@^${major}.${minor}.${patch}- <${major}.${minor}.${patch}"
```
2019-10-28 11:43:00 -05:00
Michael Bradley, Jr 1225cb14e8 build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep
When making use of the `useBuiltIns: 'usage'` option for @babel/preset-env
(which is the case for all transpiled packages in Embark's monorepo) a package
needs to have both @babel/runtime-corejs3 and core-js@3 specified as
dependencies.
2019-10-28 11:40:48 -05:00
Michael Bradley, Jr 2407df5d11 test(@embark/stack/compiler): add tests for the compiler 2019-10-25 14:12:00 -05:00
Pascal Precht f289a6fc6a feat(@embark/testing): introduce plugin APIs to register compilers
Embark relies on certain specific plugin properties, e.g. registered compilers,
and retrieves them using `plugins.getPluginProperties('compilers', 'compilers')`.

In order to make this work in the testing environment, we need those same APIs
in the `embark-testing` package as well.

This commit adds necessary APIs to `Plugins` and `Plugin` to make registering and
loading compiler plugins work.
2019-10-25 14:12:00 -05:00
Michael Bradley, Jr f519befe1d build(deps-dev): bump remaining @storybook/* from 5.1.11 to 5.2.5 2019-10-25 12:34:25 -05:00
dependabot-preview[bot] a4128232a7 build(deps-dev): bump @storybook/react from 5.1.11 to 5.2.5
Bumps [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/app/react) from 5.1.11 to 5.2.5.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v5.2.5/app/react)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-25 12:34:25 -05:00
Michael Bradley b66d664c92 build(deps): upgrade create-react-app for cockpit by bumping react-scripts to latest (#1991)
* build(deps): move deps needed by embark-basic-pipeline from packages/embark

Introduce additional refactors to ensure the packages can be resolved by the
basic pipeline's webpack child process.

* build(deps): move @types/os-locale from packages/embark to packages/core/i18n

* build(deps) move @types/globule from packages/embark to packages/plugins/coverage

* build(deps): refactor stack/{api,proxy,webserver} deps relative to packages/embark

* build(deps): remove unneeded @types/async dep from packages/stack/test-runner

* build(deps): remove unneeded deps from packages/embark

* build(deps): upgrade create-react-app for cockpit by bumping react-scripts to latest

Also get rid of a peer dependency warning related to storybook. After some
investigation it seems that storybook can't practically (at present) be made
aware of CRA in the same project satisfying storybook's peer deps, so it's best
to just satisfy all of them explicitly, which in any case won't interfere with
CRA (react-scripts).
2019-10-25 13:05:16 -04:00