mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-03 17:34:22 +00:00
chore(templates): replace blockchain.connect by onReady
This commit is contained in:
parent
7eceaf6c0a
commit
4eee4dfc65
@ -1,11 +1,10 @@
|
|||||||
import EmbarkJS from 'Embark/EmbarkJS';
|
import EmbarkJS from 'Embark/EmbarkJS';
|
||||||
import config from '../../embarkArtifacts/config/blockchain.json';
|
|
||||||
|
|
||||||
// import your contracts
|
// import your contracts
|
||||||
// e.g if you have a contract named SimpleStorage:
|
// e.g if you have a contract named SimpleStorage:
|
||||||
//import SimpleStorage from 'Embark/contracts/SimpleStorage';
|
//import SimpleStorage from 'Embark/contracts/SimpleStorage';
|
||||||
|
|
||||||
|
|
||||||
EmbarkJS.Blockchain.connect(config, (err) => {
|
EmbarkJS.onReady((err) => {
|
||||||
// You can execute contract calls after the connection
|
// You can execute contract calls after the connection
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,6 @@ import Blockchain from './components/blockchain';
|
|||||||
import Whisper from './components/whisper';
|
import Whisper from './components/whisper';
|
||||||
import Storage from './components/storage';
|
import Storage from './components/storage';
|
||||||
import ENS from './components/ens';
|
import ENS from './components/ens';
|
||||||
import config from '../embarkArtifacts/config/blockchain';
|
|
||||||
|
|
||||||
import './dapp.css';
|
import './dapp.css';
|
||||||
|
|
||||||
@ -28,7 +27,7 @@ class App extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
EmbarkJS.Blockchain.connect(config, (err) => {
|
EmbarkJS.onReady((err) => {
|
||||||
this.setState({blockchainEnabled: true});
|
this.setState({blockchainEnabled: true});
|
||||||
if (err) {
|
if (err) {
|
||||||
// If err is not null then it means something went wrong connecting to ethereum
|
// If err is not null then it means something went wrong connecting to ethereum
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import EmbarkJS from 'Embark/EmbarkJS';
|
import EmbarkJS from 'Embark/EmbarkJS';
|
||||||
import {SimpleStorage, Test, SimpleStorageTest} from '../../embarkArtifacts/contracts';
|
import {SimpleStorage, Test, SimpleStorageTest} from '../../embarkArtifacts/contracts';
|
||||||
import config from '../../embarkArtifacts/config/blockchain';
|
|
||||||
|
|
||||||
window.SimpleStorageTest = SimpleStorageTest;
|
window.SimpleStorageTest = SimpleStorageTest;
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ var addToLog = function(id, txt) {
|
|||||||
// Blockchain example
|
// Blockchain example
|
||||||
// ===========================
|
// ===========================
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
EmbarkJS.Blockchain.connect(config, (err) => {
|
EmbarkJS.onReady((err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user