Use ethers.js instead of the old web3
the web3 we are using is old and everything will change with web3 1.0 which is currently in beta for ages. ethers.js seems to be a bit more lightweight and implements pretty much the same API so let's give it a try.
This commit is contained in:
+3
-3
@@ -8,8 +8,8 @@ export default Ember.Route.extend({
|
||||
const kredits = this.get('kredits');
|
||||
|
||||
if (kredits.get('web3') && kredits.get('web3Provided')) {
|
||||
kredits.get('web3').eth.getAccounts((error, accounts) => {
|
||||
if (error || accounts.length === 0) {
|
||||
kredits.get('listAccounts').then((accounts) => {
|
||||
if (accounts.length === 0) {
|
||||
if (confirm('It looks like you have an Ethereum wallet available. Please unlock your account.')) {
|
||||
transition.retry();
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export default Ember.Route.extend({
|
||||
|
||||
let kredits = this.get('kredits');
|
||||
let totalSupply = kredits.get('tokenContract')
|
||||
.then((contract) => contract.invoke('totalSupply'));
|
||||
.then((contract) => contract.totalSupply());
|
||||
|
||||
return Ember.RSVP.hash({
|
||||
contributors: kredits.getContributors(),
|
||||
|
||||
Reference in New Issue
Block a user