Update v1 Wallet Dapp (#6935)

* Start removing duplicated functionality (v1 inside v2)

* Update compilation targets

* Update locks

* Fix js-old build

* Update with removed extra references

* Adapt dev.{parity,web3}.html for extra debug info

* Update dependencies

* Remove Tooltips

* Update dependencies

* Only inject window.ethereum once

* Fix versions to 2.0.x for @parity libraries

* Update to @parity/api 2.1.x

* Update for @parity/api 2.1.x

* Freeze signer plugin dependency hashes

* Fix lint

* Move local account handling from API

* Update for 2.2.x @parity/{shared,ui}

* Update API references for middleware

* Install updated dependencies

* Update for build

* Always do local builds for development

* Remove unused hasAccounts property

* Fix Windows build for js-old

* Adjust inclusing rules to be Windows friendly

* Explicitly add --config option to webpack

* Add process.env.EMBED flag for Windows compatability

* Revert embed flag

* Fix build

* Merge changes from beta

* Update packages after merge

* Update Accounts from beta

* Update with beta

* Remove upgrade check

* Fix CI build script execution

* Make rm -rf commands cross-platform

* Remove ability to deploy wallets (only watch)

* Update path references for js-old (Windows)

* Render local dapps first

* Cleanup dependencies
This commit is contained in:
Jaco Greeff
2017-11-13 09:31:08 +01:00
committed by GitHub
parent bcdfc50a0b
commit ce1609726f
97 changed files with 8062 additions and 14290 deletions

View File

@@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import 'whatwg-fetch';
import Api from '@parity/api';
import Web3 from 'web3';
@@ -52,8 +50,12 @@ function initProvider () {
function initWeb3 (ethereum) {
// FIXME: Use standard provider for web3
const http = new Web3.providers.HttpProvider('/rpc/');
const web3 = new Web3(http);
const provider = new Api.Provider.SendAsync(ethereum);
const web3 = new Web3(provider);
if (!web3.currentProvider) {
web3.currentProvider = provider;
}
// set default account
web3.eth.getAccounts((error, accounts) => {
@@ -78,9 +80,11 @@ function initParity (ethereum) {
});
}
const ethereum = initProvider();
if (typeof window !== 'undefined' && !window.isParity) {
const ethereum = initProvider();
initWeb3(ethereum);
initParity(ethereum);
initWeb3(ethereum);
initParity(ethereum);
console.warn('Deprecation: Dapps should only used the exposed EthereumProvider on `window.ethereum`, the use of `window.parity` and `window.web3` will be removed in future versions of this injector');
console.warn('Deprecation: Dapps should only used the exposed EthereumProvider on `window.ethereum`, the use of `window.parity` and `window.web3` will be removed in future versions of this injector');
}