Use real numbers for supply and contrib count

This commit is contained in:
2017-02-05 12:22:34 +08:00
parent 79b2d13326
commit d66573b6af
3 changed files with 5 additions and 8 deletions
+3 -1
View File
@@ -6,7 +6,9 @@ export default Ember.Route.extend({
model() {
return Ember.RSVP.hash({
contributors: this.get('kredits').getContributors()
contributors: this.get('kredits').getContributors(),
totalSupply: this.get('kredits').getValueFromContract('totalSupply'),
contributorsCount: this.get('kredits').getValueFromContract('contributorsCount')
});
}
-5
View File
@@ -40,11 +40,6 @@ export default Ember.Service.extend({
return contract;
}.property('web3'),
totalSupply: function() {
return 23000;
// return this.get('kreditsContract').totalSupply();
}.property('kreditsContract'),
getValueFromContract(contractMethod, ...args) {
return new Ember.RSVP.Promise((resolve, reject) => {
this.get('kreditsContract')[contractMethod](...args, (err, data) => {
+2 -2
View File
@@ -7,8 +7,8 @@
{{contributor-list contributors=model.contributors}}
<p class="stats">
<span class="number">{{kredits.totalSupply}}</span> kredits issued and distributed among
<span class="number">{{kredits.contributorsCount}}</span> contributors.
<span class="number">{{model.totalSupply}}</span> kredits issued and distributed among
<span class="number">{{model.contributorsCount}}</span> contributors.
</p>
</div>
</section>