Cleanup kredits service

This commit is contained in:
2018-04-21 11:05:02 +02:00
parent ade47dadde
commit 75650c19ab
5 changed files with 46 additions and 59 deletions
+6 -1
View File
@@ -4,7 +4,12 @@ import ethers from 'npm:ethers';
export default function(dependentKey, converterMethod) {
return computed(dependentKey, {
get () {
return this.get(dependentKey)[converterMethod]();
let value = this.get(dependentKey);
if (value && ethers.utils.isBigNumber(value)) {
return value[converterMethod]();
} else {
return value;
}
},
set (key, value) {
value = ethers.utils.bigNumberify(value);