Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
undoAsset(store) {
const errors = super.undoAsset(store);
const sender = store.account.get(this.senderId);
const updatedSenderBalanceAfterBonus = new BigNum(sender.balance).sub(
new BigNum(this.amount).div(10)
);
const updatedSender = {
...sender,
balance: updatedSenderBalanceAfterBonus.toString(),
};
store.account.set(sender.address, updatedSender);
return errors;
}
}
applyAsset(store) {
const errors = super.applyAsset(store);
const sender = store.account.get(this.senderId);
const updatedSenderBalanceAfterBonus = new BigNum(sender.balance).add(
new BigNum(this.amount).div(10)
);
const updatedSender = {
...sender,
balance: updatedSenderBalanceAfterBonus.toString(),
};
store.account.set(sender.address, updatedSender);
return errors;
}
undoAsset(store) {
const errors = super.undoAsset(store);
const sender = store.account.get(this.senderId);
const updatedSenderBalanceAfterBonus = new BigNum(sender.balance).sub(
new BigNum(this.amount).div(10)
);
const updatedSender = {
...sender,
balance: updatedSenderBalanceAfterBonus.toString(),
};
store.account.set(sender.address, updatedSender);
return errors;
}
}
applyAsset(store) {
const errors = super.applyAsset(store);
const sender = store.account.get(this.senderId);
const updatedSenderBalanceAfterBonus = new BigNum(sender.balance).add(
new BigNum(this.amount).div(10)
);
const updatedSender = {
...sender,
balance: updatedSenderBalanceAfterBonus.toString(),
};
store.account.set(sender.address, updatedSender);
return errors;
}