Remove obsolete utils
This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
import { computed } from '@ember/object';
|
|
||||||
import ethers from 'ethers';
|
|
||||||
|
|
||||||
export default function(dependentKey, converterMethod) {
|
|
||||||
return computed(dependentKey, {
|
|
||||||
get () {
|
|
||||||
let value = this.get(dependentKey);
|
|
||||||
if (value && ethers.utils.BigNumber.isBigNumber(value)) {
|
|
||||||
return value[converterMethod]();
|
|
||||||
} else {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
set (key, value) {
|
|
||||||
const bnValue = ethers.utils.bigNumberify(value);
|
|
||||||
this.set(dependentKey, bnValue);
|
|
||||||
return bnValue[converterMethod]();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import { computed } from '@ember/object';
|
|
||||||
import ethers from 'ethers';
|
|
||||||
import formatKredits from 'kredits-web/utils/format-kredits';
|
|
||||||
|
|
||||||
export default function(dependentKey, options = {}) {
|
|
||||||
return computed(dependentKey, {
|
|
||||||
get () {
|
|
||||||
const value = this.get(dependentKey);
|
|
||||||
return formatKredits(value, options);
|
|
||||||
},
|
|
||||||
set (key, value) {
|
|
||||||
const bnValue = ethers.utils.bigNumberify(value);
|
|
||||||
this.set(dependentKey, bnValue);
|
|
||||||
return formatKredits(bnValue, options);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user