Fix bignumber computed property

The ethers.js bignumber API changed in v4.x
This commit is contained in:
2019-04-03 13:43:57 +02:00
parent c3f2afcaf5
commit 889f2c05fc
+4 -4
View File
@@ -5,16 +5,16 @@ export default function(dependentKey, converterMethod) {
return computed(dependentKey, {
get () {
let value = this.get(dependentKey);
if (value && ethers.utils.isBigNumber(value)) {
if (value && ethers.utils.BigNumber.isBigNumber(value)) {
return value[converterMethod]();
} else {
return value;
}
},
set (key, value) {
value = ethers.utils.bigNumberify(value);
this.set(dependentKey, value);
return value[converterMethod]();
const bnValue = ethers.utils.bigNumberify(value);
this.set(dependentKey, bnValue);
return bnValue[converterMethod]();
}
});
}